From ahughes at redhat.com Fri Oct 1 07:40:28 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Fri, 1 Oct 2010 15:40:28 +0100 Subject: [RFC] [Plugin] Fixes 100% cpu load In-Reply-To: <20101001003311.GA5671@redhat.com> References: <1777947099.906361285889846806.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> <1603551127.906811285890374081.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> <20101001003311.GA5671@redhat.com> Message-ID: <20101001144028.GA8183@rivendell.middle-earth.co.uk> On 20:33 Thu 30 Sep , Deepak Bhole wrote: > * Andrew Su [2010-09-30 19:46]: > > > > ----- "Deepak Bhole" wrote: > > > > > From: "Deepak Bhole" > > > To: "Andrew Su" > > > Cc: distro-pkg-dev at openjdk.java.net > > > Sent: Thursday, September 30, 2010 7:15:55 PM GMT -05:00 US/Canada Eastern > > > Subject: Re: [RFC] [Plugin] Fixes 100% cpu load > > > > > > * Deepak Bhole [2010-09-30 18:55]: > > > > * Andrew Su [2010-09-30 17:57]: > > > > > > > > > > ----- "Deepak Bhole" wrote: > > > > > > > > > > > From: "Deepak Bhole" > > > > > > To: "Andrew Su" > > > > > > Cc: distro-pkg-dev at openjdk.java.net > > > > > > Sent: Thursday, September 30, 2010 5:01:44 PM GMT -05:00 > > > US/Canada Eastern > > > > > > Subject: Re: [RFC] [Plugin] Fixes 100% cpu load > > > > > > > > > > > > Hi, > > > > > > > > > > > > Sorry I couldn't get to this earlier.. wanted to study the > > > patch > > > > > > carefully before commenting. > > > > > > > > > > > > * Andrew Su [2010-09-27 15:25]: > > > > > > > Hello, > > > > > > > > > > > > > > This patch fixes the following: > > > > > > > *Plugin goes into a deadlock waiting for another thread to > > > > > > initialize applet, and no more threads are available to consume > > > > > > messages. > > > > > > > *Plugin handles "destroy" message when another thread trying > > > to > > > > > > create the applet is kicked off processor before setting the > > > status to > > > > > > PRE_INIT. > > > > > > > > > > > > > > > > > > > I am a bit confused about this part. As it stands now, the > > > sequence > > > > > > is > > > > > > as follows: > > > > > > > > > > > > init message comes in -> start init > > > > > > destroy message comes in > > > > > > if init is done -> destroy > > > > > > if init is in progress -> wait, then destroy > > > > > > > > > > > > Determination of if init is done or in progress is done via the > > > > > > status > > > > > > hashmap which contains one of PRE_INIT, IN_INIT or > > > INIT_COMPLETE. > > > > > > Destroy cannot be handled before PRE_INIT is set, as PRE_INIT is > > > the > > > > > > first thing set, and this code will prevent destroy from > > > proceeding > > > > > > until it is: > > > > > > > > > > > > // Wait till initialization finishes > > > > > > while (!applets.containsKey(identifier) && > > > > > > ( > > > > > > !status.containsKey(identifier) || > > > > > > > > > > > > status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT) > > > > > > ) > > > > > > ); > > > > > > > > > > > > > > > > > > > > Example. > > > > > > > We have 2 MessageConsumer threads. > > > > > > > Passes "destroy" message to both of them for applet 1 and > > > applet 2. > > > > > > > Thread 1: Spinlock waiting for another thread to initialize > > > applet > > > > > > 1. > > > > > > > Thread 2: Spinlock waiting for another thread to initialize > > > applet > > > > > > 2. > > > > > > > Both threads are now in deadlock. > > > > > > > > > > > > > > Proposed Patch: > > > > > > > When message is destroy, don't spinlock, handle it right > > > away. > > > > > > > -Problem with this: handles destroy right before we start > > > > > > initializing the applet. > > > > > > > -Fix to new problem: Synchronize the two blocks > > > > > > > --Case 1:If in process of initializing, finish initializing. > > > handle > > > > > > the destroy. > > > > > > > --Case 2:If destroy already handled, don't initialize. > > > > > > > > > > > > > > > > > > > I don't understand the destroy-before-init case. Are you seeing > > > an > > > > > > instance > > > > > > where destroy gets sent before init does? And if that's what > > > happens, > > > > > > the while > > > > > > loop above would still keep destroy from proceeding until it is > > > > > > initialized. > > > > > > > > > > > > Is there a test case for this problem? > > > > > > > > > > You are indeed correct that that is the sequence of handling the > > > messages, but.. > > > > > Let's say I load a page with 10 applets (we have 5 threads that > > > handle message). > > > > > Now before the applets load, navigate to another page that loads > > > applets or not, then we will get destroy messages. Since the messages > > > are queued, when there is no workers free to do work, the messages are > > > sent to the back of the queue to be handled later. Assuming a better > > > case where each of our 5 threads are given the handle message (this is > > > the message we use to initialize our applets). Since now all our > > > workers are busy processing the init, the next 5 handle messages gets > > > dequeued then placed at the back of queue. Next the 5 threads finishes > > > initializing the applets. > > > > > > > > Where did you see the 5 thread count? There should be 6. 4 > > > non-priority, > > > > 2 priority. Priority threads do not handle blocking calls, and can > > > only > > > > be used for messages registered as priority. > > > > > > > > > Each dequeuing the from the readQueue. If the destroy messages are > > > the ones initialized, works as intended, if not, all 5 threads will > > > now go into a never-ending loop. If the user waits until all the > > > applets load before navigating somewhere else, it'll work out since > > > the inits will be processed and destroy will be carried out properly, > > > otherwise it'll just take up the cpu. > > > > > > > > > > > > > Okay, so I have 4 free workers (let's ignore priority for now). > > > > Thread 0, Thread 1, Thread 2 and Thread 3. > > > > > > > > 10 init messages come in. And we have: > > > > > > > > Thread 0 - Processing init 0 > > > > Thread 1 - Processing init 1 > > > > Thread 2 - Processing init 2 > > > > Thread 3 - Processing init 3 > > > > > > > > The remaining init messages get queued. So the queue now has: > > > > [init 3, init 4, init 5, init 6, init 7, init 8, init 9] > > > > > > > > 10 destroy messages come in. There are no free workers, so they get > > > > queued and the readQueue is: > > > > [init 3, init 4, init 5, init 6, init 7, init 8, init 9, destroy 0, > > > > destroy 1, destroy 2, destroy 3, destroy 4, destroy 5, destroy 6, > > > > destroy 7, destroy 8, destroy 9] > > > > > > > > At some point, as the system tests each message and requeues them, > > > the > > > > readqueue becomes: > > > > > > > > [destroy 4, destroy 5, destroy 6, destroy 7, destroy 8, destroy 9 > > > ....] > > > > > > > > And those first 4 destroy messages take up the 4 available threads. > > > > > > > > Is this the correct description of the issue? > > Yes. > > > > > > > > > > Assuming so, wouldn't just keeping messages at the front of the > > > queue > > > > instead of re-adding them to the back work? The fix would be a > > > one-liner > > > > and we wouldn't need any locks. > > > > > > > > I don't think it will make things worse either. Messages are > > > re-added to > > > > the queue only when no free workers are available. Adding to the > > > back > > > > of the queue does not guarantee FIFO processing order since the > > > order is > > > > constantly changing (as seen in your example). However at the end > > > of > > > > each cycle, the order resembles FIFO. This means that FIFO order > > > works > > > > as well. If FIFO works, we can just make that the default. > > > > > > > > > > Doh! So close. Just remembered why it needs to add them to the back > > > of > > > the queue. It is so that priority messages can be processed while the > > > others wait. > > > > > > Easy fix though. We would just have to scan the queue to see if there > > > are any priority messages, and if so, move them to the front and > > > retry > > > processing. > > I don't think having it sort the queue is worth the hit on performance. > > Since adding to the head of a queue will require recopying the rest of the messages, or keep track of which element is the head. > > > > It is a linked list. Cost of addition/deletion is constant. > > As for list traversal cost, the cost will be the same O(n) as now since > we append to the end of the queue and look at the next and keep doing it > until a priority message is found and processed. Even with locks, this > will stay at O(n). > > e.g. Say the list contains 4 non-priority messages (N) and 1 priority > message (P) for n=5. If at the start, the queue is [N, N, N, N, P], with the > current code the list changes as: > > [N, N, N, P, N] > [N, N, N, P, N] > [N, N, P, N, N] > [N, P, N, N, N] > [P, N, N, N, N] > > [N, N, N, N] > > For cost O(n) > > With the new code, it'd be: > [N, N, N, N, P] -> > > [P, N, N, N, N] > > [N, N, N, N] > > The cost is still O(n) > > Additionally, such a case where processors are full would be encountered > rarely since a vast majority of pages have a single applet which > wouldn't max out the thread pool. > Deepak, is this all documented somewhere? The code I looked at was very lax on comments. > Cheers, > Deepak > > > > > > > Deepak > > > > > > > This does no solve the problem of the applets 'hanging around in a > > > > separate window' until destroy is processed, > > When we set the handle using reframe at the bottom of the handle block, that's where the applet shows up in a separate window. If we do not reframe given that a destroy message is sent, we can avoid the window showing up at all. (I am still looking into doing this) > > > > > > but I don't imagine > > > too > > > > many regular users see that case. And even if they do, the applet > > > is > > > > always guaranteed to be destroyed eventually, ensuring a consistent > > > > state. > > Yes they will be eventually destroyed, but during that time do we we really want to have it using up their resources? > > > > > > > > > > Cheers, > > > > Deepak > > > > > > > > > > > > > > > > Sorry to be nitpicking.. I am trying to get rid of locks from > > > the code > > > > > > as much > > > > > > as possible by re-designing message sequencing... if a lock is > > > to be > > > > > > added, I > > > > > > want to make sure there is no other solution first :) > > > > > > > > > > > > Cheers, > > > > > > Deepak > > > > > > > > > > > > > Cheers, > > > > > > > Andrew > > > > > > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From ahughes at redhat.com Fri Oct 1 07:48:21 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Fri, 1 Oct 2010 15:48:21 +0100 Subject: what is patches/icedtea-timerqueue.patch? In-Reply-To: <4CA4FFBE.7080106@redhat.com> References: <4CA4FFBE.7080106@redhat.com> Message-ID: <20101001144821.GB8183@rivendell.middle-earth.co.uk> On 17:23 Thu 30 Sep , Omair Majid wrote: > Hi, > > I just came across patches/icedtea-timerqueue.patch. I cannot find any > bug number or explanation of the patch. The only thing I see is the > patch itself [1]. It might possibly be a fix for S6623943 [2], but if > so, I dont think it solves the problem. > > Does anybody know more about this patch? > http://icedtea.classpath.org/wiki/IcedTea_JDK6_Patches http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=87 There's a few patches like this. People don't always seem to bother to document them. > Thanks, > Omair > > [1] > http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2007-December/000778.html > [2] http://bugs.sun.com/view_bug.do?bug_id=6623943 > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From asu at redhat.com Fri Oct 1 07:52:08 2010 From: asu at redhat.com (Andrew Su) Date: Fri, 1 Oct 2010 10:52:08 -0400 (EDT) Subject: [RFC] [Plugin] Removing redundant call to reframe. In-Reply-To: <755537813.966791285944719494.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <1413835852.966811285944728006.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Hello, This attached patch is to remove the redundant call to reframe, since we already have the handle in our message we simply set it instead of assigning it to 0. Cheers, Andrew -------------- next part -------------- A non-text attachment was scrubbed... Name: 20101001_remove_redundant_reframe.patch Type: text/x-patch Size: 1109 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101001/8bdb09f9/20101001_remove_redundant_reframe.patch From bugzilla-daemon at icedtea.classpath.org Fri Oct 1 07:53:52 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 01 Oct 2010 14:53:52 +0000 Subject: [Bug 562] New: [METABUG] NetX code contains reference to non-standard sun.* classes Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=562 Summary: [METABUG] NetX code contains reference to non-standard sun.* classes Product: IcedTea Version: 6-hg Platform: all OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: NetX AssignedTo: unassigned at icedtea.classpath.org ReportedBy: gnu_andrew at member.fsf.org -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Fri Oct 1 07:56:10 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 01 Oct 2010 14:56:10 +0000 Subject: [Bug 563] New: NetX uses sun.security code Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=563 Summary: NetX uses sun.security code Product: IcedTea Version: 6-hg Platform: all OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: NetX AssignedTo: unassigned at icedtea.classpath.org ReportedBy: gnu_andrew at member.fsf.org OtherBugsDependingO 562 nThis: 86. ERROR in /home/andrew/projects/openjdk/icedtea6/netx/net/sourceforge/jnlp/tools/KeyTool.java (at line 51) import sun.security.provider.X509Factory; /home/andrew/projects/openjdk/icedtea6/netx/net/sourceforge/jnlp/tools/JarSigner.java:import sun.security.x509.*; /home/andrew/projects/openjdk/icedtea6/netx/net/sourceforge/jnlp/tools/JarSigner.java:import sun.security.util.*; /home/andrew/projects/openjdk/icedtea6/netx/net/sourceforge/jnlp/tools/KeyTool.java:import sun.security.provider.X509Factory; /home/andrew/projects/openjdk/icedtea6/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java:import sun.security.util.SecurityConstants; /home/andrew/projects/openjdk/icedtea6/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: if (perm.equals(new SecurityPermission("accessClassInPackage.sun.security.internal.spec"))) { /home/andrew/projects/openjdk/icedtea6/netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java:import sun.security.util.HostnameChecker; /home/andrew/projects/openjdk/icedtea6/netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java:import sun.security.validator.ValidatorException; /home/andrew/projects/openjdk/icedtea6/netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java:import sun.security.util.DerValue; /home/andrew/projects/openjdk/icedtea6/netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java:import sun.security.util.HostnameChecker; /home/andrew/projects/openjdk/icedtea6/netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java:import sun.security.x509.X500Name; /home/andrew/projects/openjdk/icedtea6/netx/net/sourceforge/jnlp/security/CertsInfoPane.java:import sun.security.x509.*; -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Fri Oct 1 07:56:10 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 01 Oct 2010 14:56:10 +0000 Subject: [Bug 562] [METABUG] NetX code contains reference to non-standard sun.* classes Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=562 gnu_andrew at member.fsf.org changed: What |Removed |Added ---------------------------------------------------------------------------- BugsThisDependsOn| |563 -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From dbhole at redhat.com Fri Oct 1 07:56:31 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Fri, 1 Oct 2010 10:56:31 -0400 Subject: [RFC] [Plugin] Fixes 100% cpu load In-Reply-To: <20101001144028.GA8183@rivendell.middle-earth.co.uk> References: <1777947099.906361285889846806.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> <1603551127.906811285890374081.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> <20101001003311.GA5671@redhat.com> <20101001144028.GA8183@rivendell.middle-earth.co.uk> Message-ID: <20101001145631.GA13374@redhat.com> * Dr Andrew John Hughes [2010-10-01 10:40]: > On 20:33 Thu 30 Sep , Deepak Bhole wrote: > > * Andrew Su [2010-09-30 19:46]: > > > > > > ----- "Deepak Bhole" wrote: > > > > > > > From: "Deepak Bhole" > > > > To: "Andrew Su" > > > > Cc: distro-pkg-dev at openjdk.java.net > > > > Sent: Thursday, September 30, 2010 7:15:55 PM GMT -05:00 US/Canada Eastern > > > > Subject: Re: [RFC] [Plugin] Fixes 100% cpu load > > > > > > > > * Deepak Bhole [2010-09-30 18:55]: > > > > > * Andrew Su [2010-09-30 17:57]: > > > > > > > > > > > > ----- "Deepak Bhole" wrote: > > > > > > > > > > > > > From: "Deepak Bhole" > > > > > > > To: "Andrew Su" > > > > > > > Cc: distro-pkg-dev at openjdk.java.net > > > > > > > Sent: Thursday, September 30, 2010 5:01:44 PM GMT -05:00 > > > > US/Canada Eastern > > > > > > > Subject: Re: [RFC] [Plugin] Fixes 100% cpu load > > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > Sorry I couldn't get to this earlier.. wanted to study the > > > > patch > > > > > > > carefully before commenting. > > > > > > > > > > > > > > * Andrew Su [2010-09-27 15:25]: > > > > > > > > Hello, > > > > > > > > > > > > > > > > This patch fixes the following: > > > > > > > > *Plugin goes into a deadlock waiting for another thread to > > > > > > > initialize applet, and no more threads are available to consume > > > > > > > messages. > > > > > > > > *Plugin handles "destroy" message when another thread trying > > > > to > > > > > > > create the applet is kicked off processor before setting the > > > > status to > > > > > > > PRE_INIT. > > > > > > > > > > > > > > > > > > > > > > I am a bit confused about this part. As it stands now, the > > > > sequence > > > > > > > is > > > > > > > as follows: > > > > > > > > > > > > > > init message comes in -> start init > > > > > > > destroy message comes in > > > > > > > if init is done -> destroy > > > > > > > if init is in progress -> wait, then destroy > > > > > > > > > > > > > > Determination of if init is done or in progress is done via the > > > > > > > status > > > > > > > hashmap which contains one of PRE_INIT, IN_INIT or > > > > INIT_COMPLETE. > > > > > > > Destroy cannot be handled before PRE_INIT is set, as PRE_INIT is > > > > the > > > > > > > first thing set, and this code will prevent destroy from > > > > proceeding > > > > > > > until it is: > > > > > > > > > > > > > > // Wait till initialization finishes > > > > > > > while (!applets.containsKey(identifier) && > > > > > > > ( > > > > > > > !status.containsKey(identifier) || > > > > > > > > > > > > > > status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT) > > > > > > > ) > > > > > > > ); > > > > > > > > > > > > > > > > > > > > > > > Example. > > > > > > > > We have 2 MessageConsumer threads. > > > > > > > > Passes "destroy" message to both of them for applet 1 and > > > > applet 2. > > > > > > > > Thread 1: Spinlock waiting for another thread to initialize > > > > applet > > > > > > > 1. > > > > > > > > Thread 2: Spinlock waiting for another thread to initialize > > > > applet > > > > > > > 2. > > > > > > > > Both threads are now in deadlock. > > > > > > > > > > > > > > > > Proposed Patch: > > > > > > > > When message is destroy, don't spinlock, handle it right > > > > away. > > > > > > > > -Problem with this: handles destroy right before we start > > > > > > > initializing the applet. > > > > > > > > -Fix to new problem: Synchronize the two blocks > > > > > > > > --Case 1:If in process of initializing, finish initializing. > > > > handle > > > > > > > the destroy. > > > > > > > > --Case 2:If destroy already handled, don't initialize. > > > > > > > > > > > > > > > > > > > > > > I don't understand the destroy-before-init case. Are you seeing > > > > an > > > > > > > instance > > > > > > > where destroy gets sent before init does? And if that's what > > > > happens, > > > > > > > the while > > > > > > > loop above would still keep destroy from proceeding until it is > > > > > > > initialized. > > > > > > > > > > > > > > Is there a test case for this problem? > > > > > > > > > > > > You are indeed correct that that is the sequence of handling the > > > > messages, but.. > > > > > > Let's say I load a page with 10 applets (we have 5 threads that > > > > handle message). > > > > > > Now before the applets load, navigate to another page that loads > > > > applets or not, then we will get destroy messages. Since the messages > > > > are queued, when there is no workers free to do work, the messages are > > > > sent to the back of the queue to be handled later. Assuming a better > > > > case where each of our 5 threads are given the handle message (this is > > > > the message we use to initialize our applets). Since now all our > > > > workers are busy processing the init, the next 5 handle messages gets > > > > dequeued then placed at the back of queue. Next the 5 threads finishes > > > > initializing the applets. > > > > > > > > > > Where did you see the 5 thread count? There should be 6. 4 > > > > non-priority, > > > > > 2 priority. Priority threads do not handle blocking calls, and can > > > > only > > > > > be used for messages registered as priority. > > > > > > > > > > > Each dequeuing the from the readQueue. If the destroy messages are > > > > the ones initialized, works as intended, if not, all 5 threads will > > > > now go into a never-ending loop. If the user waits until all the > > > > applets load before navigating somewhere else, it'll work out since > > > > the inits will be processed and destroy will be carried out properly, > > > > otherwise it'll just take up the cpu. > > > > > > > > > > > > > > > > Okay, so I have 4 free workers (let's ignore priority for now). > > > > > Thread 0, Thread 1, Thread 2 and Thread 3. > > > > > > > > > > 10 init messages come in. And we have: > > > > > > > > > > Thread 0 - Processing init 0 > > > > > Thread 1 - Processing init 1 > > > > > Thread 2 - Processing init 2 > > > > > Thread 3 - Processing init 3 > > > > > > > > > > The remaining init messages get queued. So the queue now has: > > > > > [init 3, init 4, init 5, init 6, init 7, init 8, init 9] > > > > > > > > > > 10 destroy messages come in. There are no free workers, so they get > > > > > queued and the readQueue is: > > > > > [init 3, init 4, init 5, init 6, init 7, init 8, init 9, destroy 0, > > > > > destroy 1, destroy 2, destroy 3, destroy 4, destroy 5, destroy 6, > > > > > destroy 7, destroy 8, destroy 9] > > > > > > > > > > At some point, as the system tests each message and requeues them, > > > > the > > > > > readqueue becomes: > > > > > > > > > > [destroy 4, destroy 5, destroy 6, destroy 7, destroy 8, destroy 9 > > > > ....] > > > > > > > > > > And those first 4 destroy messages take up the 4 available threads. > > > > > > > > > > Is this the correct description of the issue? > > > Yes. > > > > > > > > > > > > > Assuming so, wouldn't just keeping messages at the front of the > > > > queue > > > > > instead of re-adding them to the back work? The fix would be a > > > > one-liner > > > > > and we wouldn't need any locks. > > > > > > > > > > I don't think it will make things worse either. Messages are > > > > re-added to > > > > > the queue only when no free workers are available. Adding to the > > > > back > > > > > of the queue does not guarantee FIFO processing order since the > > > > order is > > > > > constantly changing (as seen in your example). However at the end > > > > of > > > > > each cycle, the order resembles FIFO. This means that FIFO order > > > > works > > > > > as well. If FIFO works, we can just make that the default. > > > > > > > > > > > > > Doh! So close. Just remembered why it needs to add them to the back > > > > of > > > > the queue. It is so that priority messages can be processed while the > > > > others wait. > > > > > > > > Easy fix though. We would just have to scan the queue to see if there > > > > are any priority messages, and if so, move them to the front and > > > > retry > > > > processing. > > > I don't think having it sort the queue is worth the hit on performance. > > > Since adding to the head of a queue will require recopying the rest of the messages, or keep track of which element is the head. > > > > > > > It is a linked list. Cost of addition/deletion is constant. > > > > As for list traversal cost, the cost will be the same O(n) as now since > > we append to the end of the queue and look at the next and keep doing it > > until a priority message is found and processed. Even with locks, this > > will stay at O(n). > > > > e.g. Say the list contains 4 non-priority messages (N) and 1 priority > > message (P) for n=5. If at the start, the queue is [N, N, N, N, P], with the > > current code the list changes as: > > > > [N, N, N, P, N] > > [N, N, N, P, N] > > [N, N, P, N, N] > > [N, P, N, N, N] > > [P, N, N, N, N] > > > > [N, N, N, N] > > > > For cost O(n) > > > > With the new code, it'd be: > > [N, N, N, N, P] -> > > > > [P, N, N, N, N] > > > > [N, N, N, N] > > > > The cost is still O(n) > > > > Additionally, such a case where processors are full would be encountered > > rarely since a vast majority of pages have a single applet which > > wouldn't max out the thread pool. > > > > Deepak, is this all documented somewhere? The code I looked at was very lax on comments. > It is a mixture of old and new code. Unfortunately it is not documented. The above class I am referring to (PluginMessageConsumer) is just a customized tread pool -- I am trying to add comments as much as possible as I re-design things (the C++ side for example is fairly well documented for all the new parts). Cheers, Deepak > > Cheers, > > Deepak > > > > > > > > > > Deepak > > > > > > > > > This does no solve the problem of the applets 'hanging around in a > > > > > separate window' until destroy is processed, > > > When we set the handle using reframe at the bottom of the handle block, that's where the applet shows up in a separate window. If we do not reframe given that a destroy message is sent, we can avoid the window showing up at all. (I am still looking into doing this) > > > > > > > > but I don't imagine > > > > too > > > > > many regular users see that case. And even if they do, the applet > > > > is > > > > > always guaranteed to be destroyed eventually, ensuring a consistent > > > > > state. > > > Yes they will be eventually destroyed, but during that time do we we really want to have it using up their resources? > > > > > > > > > > > > > Cheers, > > > > > Deepak > > > > > > > > > > > > > > > > > > > Sorry to be nitpicking.. I am trying to get rid of locks from > > > > the code > > > > > > > as much > > > > > > > as possible by re-designing message sequencing... if a lock is > > > > to be > > > > > > > added, I > > > > > > > want to make sure there is no other solution first :) > > > > > > > > > > > > > > Cheers, > > > > > > > Deepak > > > > > > > > > > > > > > > Cheers, > > > > > > > > Andrew > > > > > > > > > -- > Andrew :) > > Free Java Software Engineer > Red Hat, Inc. (http://www.redhat.com) > > Support Free Java! > Contribute to GNU Classpath and the OpenJDK > http://www.gnu.org/software/classpath > http://openjdk.java.net > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From bugzilla-daemon at icedtea.classpath.org Fri Oct 1 08:02:06 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 01 Oct 2010 15:02:06 +0000 Subject: [Bug 563] NetX uses sun.security code Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=563 gnu_andrew at member.fsf.org changed: What |Removed |Added ---------------------------------------------------------------------------- OS/Version|Linux |All -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Fri Oct 1 08:07:53 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 01 Oct 2010 15:07:53 +0000 Subject: [Bug 562] [METABUG] NetX code contains reference to non-standard sun.* classes Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=562 gnu_andrew at member.fsf.org changed: What |Removed |Added ---------------------------------------------------------------------------- BugsThisDependsOn| |564 -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Fri Oct 1 08:07:53 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 01 Oct 2010 15:07:53 +0000 Subject: [Bug 564] New: NetX depends on sun.misc.BASE64Encoder Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=564 Summary: NetX depends on sun.misc.BASE64Encoder Product: IcedTea Version: 6-hg Platform: all OS/Version: All Status: NEW Severity: normal Priority: P2 Component: NetX AssignedTo: unassigned at icedtea.classpath.org ReportedBy: gnu_andrew at member.fsf.org OtherBugsDependingO 562 nThis: -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From omajid at redhat.com Fri Oct 1 08:08:01 2010 From: omajid at redhat.com (Omair Majid) Date: Fri, 01 Oct 2010 11:08:01 -0400 Subject: [RFC] plugin: dont shadow *Version variables in JNLPFile Message-ID: <4CA5F951.9080205@redhat.com> Hi, The varaibles specVersion and fileVersion defined in PluginBridge are shadowing the variables with the same names in JNLPFile. This means that whenever JNLPFile tries to access fileVersion and specVerion for a plugin, it will see nulls. I am not sure if this matters - most of the uses of Version variables check for nulls. However, since we are setting specVersion and fileVersion explicitly, they should be set to the correct values. The attached patch makes sure the variables are not shadowed. Cheers, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea6-plugin-dont-shadow-versions.patch Type: text/x-patch Size: 723 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101001/e2218b45/icedtea6-plugin-dont-shadow-versions.patch From dbhole at redhat.com Fri Oct 1 08:14:28 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Fri, 1 Oct 2010 11:14:28 -0400 Subject: [RFC] [Plugin] Removing redundant call to reframe. In-Reply-To: <1413835852.966811285944728006.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> References: <755537813.966791285944719494.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> <1413835852.966811285944728006.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <20101001151428.GB13374@redhat.com> * Andrew Su [2010-10-01 11:00]: > Hello, > > This attached patch is to remove the redundant call to reframe, since we already have the handle in our message we simply set it instead of assigning it to 0. > > Cheers, > Andrew > diff -r 14ed93e7ecc5 plugin/icedteanp/java/sun/applet/PluginAppletViewer.java > --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Thu Sep 30 11:10:01 2010 +0100 > +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Fri Oct 01 10:52:32 2010 -0400 > @@ -140,7 +140,7 @@ > > > // put inside initial 0 handle frame > - PluginAppletViewer.reFrame(null, identifier, System.out, 0, panel); > + PluginAppletViewer.reFrame(null, identifier, System.out, handle, panel); > > panel.init(); > > @@ -557,10 +557,6 @@ > > if (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE)) > throw new Exception("Applet initialization timeout"); > - > - PluginAppletViewer oldFrame = applets.get(identifier); > - reFrame(oldFrame, oldFrame.identifier, oldFrame.statusMsgStream, > - handle, oldFrame.panel); > > } else { > PluginDebug.debug ("Handling message: " + message + " instance " + identifier + " " + Thread.currentThread()); Looks good. This change should have gone in with the previous serialization commit but was missed. Is any other part of the code other than above calling reFrame()? If not, that method should be removed altogether as well. Cheers, Deepak From asu at redhat.com Fri Oct 1 08:18:30 2010 From: asu at redhat.com (Andrew Su) Date: Fri, 1 Oct 2010 11:18:30 -0400 (EDT) Subject: [RFC] [Plugin] Removing redundant call to reframe. In-Reply-To: <842404448.970741285946252271.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <255786949.971001285946310217.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> ----- "Deepak Bhole" wrote: > From: "Deepak Bhole" > To: "Andrew Su" > Cc: distro-pkg-dev at openjdk.java.net > Sent: Friday, October 1, 2010 11:14:28 AM GMT -05:00 US/Canada Eastern > Subject: Re: [RFC] [Plugin] Removing redundant call to reframe. > > * Andrew Su [2010-10-01 11:00]: > > Hello, > > > > This attached patch is to remove the redundant call to reframe, > since we already have the handle in our message we simply set it > instead of assigning it to 0. > > > > Cheers, > > Andrew > > > diff -r 14ed93e7ecc5 > plugin/icedteanp/java/sun/applet/PluginAppletViewer.java > > --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Thu > Sep 30 11:10:01 2010 +0100 > > +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Fri > Oct 01 10:52:32 2010 -0400 > > @@ -140,7 +140,7 @@ > > > > > > // put inside initial 0 handle frame > > - PluginAppletViewer.reFrame(null, identifier, System.out, > 0, panel); > > + PluginAppletViewer.reFrame(null, identifier, System.out, > handle, panel); > > > > panel.init(); > > > > @@ -557,10 +557,6 @@ > > > > if > (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE)) > > throw new Exception("Applet initialization > timeout"); > > - > > - PluginAppletViewer oldFrame = > applets.get(identifier); > > - reFrame(oldFrame, oldFrame.identifier, > oldFrame.statusMsgStream, > > - handle, oldFrame.panel); > > > > } else { > > PluginDebug.debug ("Handling message: " + message > + " instance " + identifier + " " + Thread.currentThread()); > > Looks good. This change should have gone in with the previous > serialization commit but was missed. > > Is any other part of the code other than above calling reFrame()? If > not, that method should be removed altogether as well. Only createPanel calls reframe now. > > Cheers, > Deepak --Andrew From ptisnovs at icedtea.classpath.org Fri Oct 1 08:28:41 2010 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Fri, 01 Oct 2010 15:28:41 +0000 Subject: /hg/gfx-test: Alpha version of graphics test harness. Message-ID: changeset 967a5209d4f9 in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=967a5209d4f9 author: Pavel Tisnovsky date: Fri Oct 01 17:29:09 2010 +0200 Alpha version of graphics test harness. diffstat: 4 files changed, 693 insertions(+), 3 deletions(-) Makefile | 10 src/org/gfxtest/framework/GfxTest.java | 2 src/org/gfxtest/framework/TestImage.java | 2 src/org/gfxtest/harness/MainWindow.java | 682 ++++++++++++++++++++++++++++++ diffs (truncated from 751 to 500 lines): diff -r b86bf2b73222 -r 967a5209d4f9 Makefile --- a/Makefile Thu Sep 30 11:34:58 2010 +0200 +++ b/Makefile Fri Oct 01 17:29:09 2010 +0200 @@ -47,6 +47,7 @@ TESTSUITE_DIR=org/gfxtest/testsuites TESTSUITE_DIR=org/gfxtest/testsuites REPORTER_DIR=org/gfxtest/reporter IMAGE_DIFFER_DIR=org/gfxtest/ImageDiffer +HARNESS=org/gfxtest/harness TEST_PACKAGE=org.gfxtest.testsuites RUN_OPTIONS=-w=640 -h=480 -t=rgb @@ -87,7 +88,8 @@ FRAMEWORK_CLASSES = \ $(CLASSES)/$(IMAGE_DIFFER_DIR)/ResultWriters/HtmlStructureWriter.class \ $(CLASSES)/$(IMAGE_DIFFER_DIR)/ResultWriters/ResultWriter.class \ $(CLASSES)/$(IMAGE_DIFFER_DIR)/ResultWriters/HtmlWriter.class \ - $(CLASSES)/$(IMAGE_DIFFER_DIR)/ResultWriters/XmlWriter.class + $(CLASSES)/$(IMAGE_DIFFER_DIR)/ResultWriters/XmlWriter.class \ + $(CLASSES)/$(HARNESS)/MainWindow.class TESTSUITE_CLASSES = \ $(CLASSES)/$(TESTSUITE_DIR)/AALines.class \ @@ -191,6 +193,9 @@ test_suites: $(TESTSUITE_CLASSES) $(CLASSES)/$(IMAGE_DIFFER_DIR)/%.class: $(SOURCEPATH)/$(IMAGE_DIFFER_DIR)/%.java $(JAVAC) -d $(CLASSES) -sourcepath src/ $< +$(CLASSES)/$(HARNESS)/%.class: $(SOURCEPATH)/$(HARNESS)/%.java + $(JAVAC) -d $(CLASSES) -sourcepath src/ $< + gfxtest.jar: $(FRAMEWORK_CLASSES) $(TESTSUITE_CLASSES) jar cvf gfxtest.jar -C $(CLASSES) . @@ -223,6 +228,9 @@ report: compareresults gfxtest.jar report: compareresults gfxtest.jar java -cp gfxtest.jar org.gfxtest.reporter.Reporter -i=$(RESULTS) -o=$(RESULTS) +harness: gfxtest.jar + java -cp gfxtest.jar org.gfxtest.harness.MainWindow + cleanall: clean clean-output clean-results clean-samples clean-all: cleanall diff -r b86bf2b73222 -r 967a5209d4f9 src/org/gfxtest/framework/GfxTest.java --- a/src/org/gfxtest/framework/GfxTest.java Thu Sep 30 11:34:58 2010 +0200 +++ b/src/org/gfxtest/framework/GfxTest.java Fri Oct 01 17:29:09 2010 +0200 @@ -163,7 +163,7 @@ public abstract class GfxTest protected void runTestSuite(String[] args) { long t1 = System.currentTimeMillis(); - this.log = new Log(this.getClass().getName(), true); + this.log = new Log(this.getClass().getName(), false); this.log.logBegin("testsuite"); //$NON-NLS-1$ fillSuiteName(); GfxTestConfiguration configuration; diff -r b86bf2b73222 -r 967a5209d4f9 src/org/gfxtest/framework/TestImage.java --- a/src/org/gfxtest/framework/TestImage.java Thu Sep 30 11:34:58 2010 +0200 +++ b/src/org/gfxtest/framework/TestImage.java Fri Oct 01 17:29:09 2010 +0200 @@ -56,7 +56,7 @@ public class TestImage public TestImage(GfxTestConfiguration configuration, int zoom) { - this.log = new Log(this.getClass().getName(), true); + this.log = new Log(this.getClass().getName(), false); this.createImage(configuration, zoom); } diff -r b86bf2b73222 -r 967a5209d4f9 src/org/gfxtest/harness/MainWindow.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/gfxtest/harness/MainWindow.java Fri Oct 01 17:29:09 2010 +0200 @@ -0,0 +1,682 @@ +/* + Java gfx-test framework + + Copyright (C) 2010 Red Hat + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. +*/ + +package org.gfxtest.harness; + +import java.awt.Dimension; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.awt.event.*; +import java.awt.image.BufferedImage; +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.*; + +import javax.imageio.ImageIO; +import javax.swing.*; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import javax.swing.table.DefaultTableModel; + +/** + * Main window code and basic application logic for graphic test harness. + * + * TODO: dialog for setting reference and tested Java + * TODO: dialog for setting verbose output + * TODO: image comparator + * TODO: image viewer + * TODO: image zoomer + * TODO: grid + * TODO: refactoring! + * + * @author Pavel Tisnovsky + */ +public class MainWindow +{ + private static final String WINDOW_TITLE = "Gfx test harness"; + protected static final String ABOUT_TEXT = "Gfx test harness version 0.1\nAuthor: Pavel Tisnovsky, Red Hat"; + private static final int DEFAULT_WINDOW_WIDTH = 1024; + private static final int DEFAULT_WINDOW_HEIGHT = 768; + + private static final String BUILD_DIRECTORY = "test-build"; + private static final String SOURCE_DIRECTORY = "src"; + private static final String SAMPLES_DIRECTORY = "samples"; + private static final String OUTPUT_DIRECTORY = "output"; + private static final String PATH_TO_TESTSUITES = SOURCE_DIRECTORY + "/org/gfxtest/testsuites"; + private static final String RUN_OPTIONS = "-w=640 -h=480 -t=rgb"; + + private String referenceJava = "/usr/lib/jvm/java/bin/java"; + private String testedJava = "/usr/lib/jvm/java/bin/java"; + + DefaultListModel testList = new DefaultListModel(); + DefaultTableModel resultTable = new DefaultTableModel(new String[] + { "Name", "Sample", "Tested", "Result" }, 1); + + private String selectedTestSuite = null; + private JFrame mainWindow; + private JLabel testResultsLabel = new JLabel(); + private JTextArea resultTextArea = new JTextArea(5, 40); + private JButton commandCompile = new JButton("Compile"); + private JButton commandRun = new JButton("Run"); + protected JList jTestList = null; + protected JTable jResultsTable; + private boolean tableIsErasing; + private JLabel topRightLabel = new JLabel("sample image"); + private JLabel bottomLeftLabel = new JLabel("difference"); + private JLabel bottomRightLabel = new JLabel("test image"); + + private JMenuBar createMainMenu() + { + JMenuBar mainMenu = new JMenuBar(); + + JMenu fileMenu = new JMenu("File"); + fileMenu.setMnemonic(KeyEvent.VK_F); + + JMenuItem fileMenuQuit = new JMenuItem("Quit", KeyEvent.VK_Q); + fileMenuQuit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, ActionEvent.CTRL_MASK)); + fileMenuQuit.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + System.exit(0); + } + }); + fileMenu.add(fileMenuQuit); + + mainMenu.add(fileMenu); + + JMenu configureMenu = new JMenu("Configure"); + configureMenu.setMnemonic(KeyEvent.VK_C); + mainMenu.add(configureMenu); + + JMenu viewMenu = new JMenu("View"); + viewMenu.setMnemonic(KeyEvent.VK_V); + mainMenu.add(viewMenu); + + JMenu zoomMenu = new JMenu("Zoom"); + zoomMenu.setMnemonic(KeyEvent.VK_Z); + mainMenu.add(zoomMenu); + + JMenu helpMenu = new JMenu("Help"); + helpMenu.setMnemonic(KeyEvent.VK_H); + JMenuItem fileHelpAbout = new JMenuItem("About", KeyEvent.VK_A); + fileHelpAbout.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, ActionEvent.CTRL_MASK)); + fileHelpAbout.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + JOptionPane.showMessageDialog(getMainWindow(), + ABOUT_TEXT, WINDOW_TITLE, + JOptionPane.INFORMATION_MESSAGE); + } + }); + helpMenu.add(fileHelpAbout); + + mainMenu.add(helpMenu); + + return mainMenu; + } + + private GridBagConstraints constraints(int gridx, int gridy, int gridWidth, int gridHeight, double weightx, double weighty, int fill) + { + Insets insets = new Insets(2, 2, 2, 2); + return new GridBagConstraints(gridx, gridy, gridWidth, gridHeight, weightx, weighty, GridBagConstraints.CENTER, fill, insets, 0, 0); + } + + private void createTopLeftPanelControls(JPanel panel) + { + this.jTestList = new JList(this.testList); + this.jTestList.setVisibleRowCount(20); + this.jTestList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + this.jTestList.addListSelectionListener(new ListSelectionListener() + { + @Override + public void valueChanged(ListSelectionEvent e) + { + if (!e.getValueIsAdjusting()) + { + int selectedIndex = MainWindow.this.jTestList.getSelectedIndex(); + if (selectedIndex != -1) + { + selectTestSuite(selectedIndex); + } + } + } + }); + JScrollPane testListPane = new JScrollPane(this.jTestList); + + this.jResultsTable = new JTable(this.resultTable); + this.jResultsTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + this.jResultsTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() + { + @Override + public void valueChanged(ListSelectionEvent e) + { + if (!e.getValueIsAdjusting()) + { + int selectedIndex = MainWindow.this.jResultsTable.getSelectedRow(); + if (selectedIndex != -1) + { + selectTestResult(selectedIndex); + } + } + } + }); + JScrollPane resultsPane = new JScrollPane(this.jResultsTable); + + this.resultTextArea.setEditable(false); + JScrollPane resultTextPane = new JScrollPane(this.resultTextArea); + + this.commandCompile.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + compileSelectedTest(); + } + }); + + this.commandRun.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + runSelectedTest(); + } + }); + + JButton commandRefresh = new JButton("Refresh test list"); + commandRefresh.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + refreshTestList(); + } + }); + + this.resetTestResultsLabel(); + this.testResultsLabel.setOpaque(true); + this.testResultsLabel.setPreferredSize(new Dimension(200, 20)); + this.testResultsLabel.setMinimumSize(new Dimension(200, 20)); + + panel.add(new JLabel("Gfx. test"), constraints(0, 0, 1, 1, 0.4, 0.0, GridBagConstraints.HORIZONTAL)); + panel.add(new JLabel("Commands"), constraints(1, 0, 1, 1, 0.3, 0.0, GridBagConstraints.HORIZONTAL)); + panel.add(this.testResultsLabel, constraints(2, 0, 1, 1, 0.3, 0.0, GridBagConstraints.HORIZONTAL)); + panel.add(testListPane, constraints(0, 1, 1, 6, 0.4, 1.0, GridBagConstraints.BOTH)); + panel.add(resultsPane, constraints(2, 1, 1, 4, 0.3, 0.5, GridBagConstraints.BOTH)); + panel.add(resultTextPane, constraints(1, 5, 2, 1, 0.3, 0.5, GridBagConstraints.BOTH)); + + panel.add(this.commandCompile, constraints(1, 1, 1, 1, 0.1, 0.0, GridBagConstraints.HORIZONTAL)); + panel.add(this.commandRun, constraints(1, 2, 1, 1, 0.1, 0.0, GridBagConstraints.HORIZONTAL)); + panel.add(commandRefresh, constraints(1, 4, 1, 1, 0.1, 0.0, GridBagConstraints.HORIZONTAL)); + panel.add(new JPanel(), constraints(1, 3, 1, 1, 0.1, 1.0, GridBagConstraints.BOTH)); + } + + /** + * Create and set up the main window. + */ + protected void createMainWindow() + { + JFrame window = new JFrame(WINDOW_TITLE); + window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + window.setJMenuBar(createMainMenu()); + + JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); + horizontalSplitPane.setOneTouchExpandable(true); + horizontalSplitPane.setDividerLocation(1. / 2); + + JSplitPane leftVerticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); + leftVerticalSplitPane.setOneTouchExpandable(true); + leftVerticalSplitPane.setDividerLocation(1. / 2); + + JSplitPane rightVerticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); + rightVerticalSplitPane.setOneTouchExpandable(true); + rightVerticalSplitPane.setDividerLocation(1. / 2); + + horizontalSplitPane.add(leftVerticalSplitPane); + horizontalSplitPane.add(rightVerticalSplitPane); + + JPanel topLeftPanel = new JPanel(); + topLeftPanel.setLayout(new GridBagLayout()); + //topLeftPanel.setMinimumSize(new Dimension(320, 240)); + createTopLeftPanelControls(topLeftPanel); + leftVerticalSplitPane.add(topLeftPanel); + + JPanel topRightPanel = new JPanel(); + topRightPanel.setMinimumSize(new Dimension(320, 240)); + //topRightPanel.setBackground(Color.green); + topRightPanel.add(this.topRightLabel); + rightVerticalSplitPane.add(topRightPanel); + + JPanel bottomLeftPanel = new JPanel(); + bottomLeftPanel.setMinimumSize(new Dimension(320, 240)); + //bottomLeftPanel.setBackground(Color.blue); + bottomLeftPanel.add(this.bottomLeftLabel); + leftVerticalSplitPane.add(bottomLeftPanel); + + JPanel bottomRightPanel = new JPanel(); + bottomRightPanel.setMinimumSize(new Dimension(320, 240)); + //bottomRightPanel.setBackground(Color.yellow); + bottomRightPanel.add(this.bottomRightLabel); + rightVerticalSplitPane.add(bottomRightPanel); + + window.getContentPane().add(horizontalSplitPane); + + // Display the window. + window.setSize(DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT); + window.setVisible(true); + this.setMainWindow(window); + } + + /** + * @param mainWindow the mainWindow to set + */ + public void setMainWindow(JFrame mainWindow) + { + this.mainWindow = mainWindow; + } + + /** + * @return the mainWindow + */ + public JFrame getMainWindow() + { + return this.mainWindow; + } + + protected void resetTestResultsLabel() + { + this.testResultsLabel.setText("no test selected"); + this.commandCompile.setEnabled(false); + this.commandRun.setEnabled(false); + } + + private void setTestResultsLabel(String selectedTest) + { + this.testResultsLabel.setText(selectedTest + " results"); + this.commandCompile.setEnabled(true); + this.commandRun.setEnabled(true); + } + + protected void selectTestSuite(int selectedIndex) + { + if (selectedIndex != -1 && this.testList.getSize() > selectedIndex) + { + eraseResultTable(); + this.selectedTestSuite = String.valueOf(this.testList.get(selectedIndex)); + /* + JOptionPane.showMessageDialog(this.mainWindow, + "Selected test: " + this.selectedTest, WINDOW_TITLE, + JOptionPane.INFORMATION_MESSAGE); + */ + setTestResultsLabel(this.selectedTestSuite); + refreshTestResults(this.selectedTestSuite); + } + } + + protected void selectTestResult(int selectedIndex) + { + if (selectedIndex != -1 && this.resultTable.getRowCount() > selectedIndex && this.selectedTestSuite != null + && !this.tableIsErasing) + { + String testName = this.selectedTestSuite + "_" + this.resultTable.getValueAt(selectedIndex, 0).toString() + + ".png"; + String sampleFileName = constructTestDirectoryName(SAMPLES_DIRECTORY, this.selectedTestSuite); + String testFileName = constructTestDirectoryName(OUTPUT_DIRECTORY, this.selectedTestSuite); + + File sampleImageFile = new File(sampleFileName, testName); + if (sampleImageFile.exists() && sampleImageFile.isFile()) + { + BufferedImage sampleImage; + try + { + sampleImage = ImageIO.read(new File(sampleFileName, testName)); + this.topRightLabel.setIcon(new ImageIcon(sampleImage)); + this.topRightLabel.setText(""); + } + catch (IOException e) + { + e.printStackTrace(); + this.topRightLabel.setText(e.getMessage()); + } + } + + File testImageFile = new File(testFileName, testName); + if (testImageFile.exists() && testImageFile.isFile()) + { + BufferedImage testImage; + try + { + testImage = ImageIO.read(new File(testFileName, testName)); + this.bottomRightLabel.setIcon(new ImageIcon(testImage)); + this.bottomRightLabel.setText(""); + } + catch (IOException e) + { + e.printStackTrace(); + this.bottomRightLabel.setText(e.getMessage()); + } + } + /* + * JOptionPane.showMessageDialog(this.mainWindow, "Selected test: " + * + testName, WINDOW_TITLE, JOptionPane.INFORMATION_MESSAGE); + */ + } + } + + protected void refreshTestList() + { + this.selectedTestSuite = null; + File dir = new File(System.getProperty("user.dir"), PATH_TO_TESTSUITES); + Set testNames = new TreeSet(); + for (String name : dir.list()) + { + testNames.add(name.substring(0, name.indexOf('.'))); + } + this.testList.clear(); + for (String name : testNames) + { + this.testList.addElement(name); + } + this.resetTestResultsLabel(); + eraseResultTable(); + } + + private String constructTestNameFromFileName(String fileName) + { + // special cases - it should not happen! From omajid at redhat.com Fri Oct 1 08:30:44 2010 From: omajid at redhat.com (Omair Majid) Date: Fri, 01 Oct 2010 11:30:44 -0400 Subject: what is patches/icedtea-timerqueue.patch? In-Reply-To: <20101001144821.GB8183@rivendell.middle-earth.co.uk> References: <4CA4FFBE.7080106@redhat.com> <20101001144821.GB8183@rivendell.middle-earth.co.uk> Message-ID: <4CA5FEA4.1090209@redhat.com> Hi, On 10/01/2010 10:48 AM, Dr Andrew John Hughes wrote: > On 17:23 Thu 30 Sep , Omair Majid wrote: >> Hi, >> >> I just came across patches/icedtea-timerqueue.patch. I cannot find any >> bug number or explanation of the patch. The only thing I see is the >> patch itself [1]. It might possibly be a fix for S6623943 [2], but if >> so, I dont think it solves the problem. >> >> Does anybody know more about this patch? >> > > http://icedtea.classpath.org/wiki/IcedTea_JDK6_Patches > http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=87 > Ah, thanks for the links. I had forgotten about the wiki page we set up. > There's a few patches like this. People don't always seem to bother to document > them. > Yes, a lot of patches (including some of mine) should have had much better documentation :( Thanks, Omair From dbhole at redhat.com Fri Oct 1 08:35:49 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Fri, 1 Oct 2010 11:35:49 -0400 Subject: [RFC] plugin: dont shadow *Version variables in JNLPFile In-Reply-To: <4CA5F951.9080205@redhat.com> References: <4CA5F951.9080205@redhat.com> Message-ID: <20101001153549.GC13374@redhat.com> * Omair Majid [2010-10-01 11:15]: > Hi, > > The varaibles specVersion and fileVersion defined in PluginBridge > are shadowing the variables with the same names in JNLPFile. This > means that whenever JNLPFile tries to access fileVersion and > specVerion for a plugin, it will see nulls. I am not sure if this > matters - most of the uses of Version variables check for nulls. > However, since we are setting specVersion and fileVersion > explicitly, they should be set to the correct values. > > The attached patch makes sure the variables are not shadowed. > > Cheers, > Omair > diff -r 674b1799df8c netx/net/sourceforge/jnlp/PluginBridge.java > --- a/netx/net/sourceforge/jnlp/PluginBridge.java Wed Sep 29 13:37:46 2010 -0700 > +++ b/netx/net/sourceforge/jnlp/PluginBridge.java Fri Oct 01 10:47:59 2010 -0400 > @@ -35,8 +35,6 @@ > > public class PluginBridge extends JNLPFile > { > - Version specVersion = new Version("1.0"); > - Version fileVersion = new Version("1.1"); > > String name; > String[] jars = new String[0]; > @@ -48,6 +46,8 @@ > int width, int height, Hashtable atts) > throws Exception > { > + specVersion = new Version("1.0"); > + fileVersion = new Version("1.1"); > this.codeBase = codebase; > this.sourceLocation = documentBase; > Looks fine to me. OK for 1.7/1.8/1.9 and HEAD. Deepak From dbhole at redhat.com Fri Oct 1 08:37:11 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Fri, 1 Oct 2010 11:37:11 -0400 Subject: [RFC] [Plugin] Removing redundant call to reframe. In-Reply-To: <255786949.971001285946310217.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> References: <842404448.970741285946252271.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> <255786949.971001285946310217.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <20101001153710.GD13374@redhat.com> * Andrew Su [2010-10-01 11:18]: > > ----- "Deepak Bhole" wrote: > > > From: "Deepak Bhole" > > To: "Andrew Su" > > Cc: distro-pkg-dev at openjdk.java.net > > Sent: Friday, October 1, 2010 11:14:28 AM GMT -05:00 US/Canada Eastern > > Subject: Re: [RFC] [Plugin] Removing redundant call to reframe. > > > > * Andrew Su [2010-10-01 11:00]: > > > Hello, > > > > > > This attached patch is to remove the redundant call to reframe, > > since we already have the handle in our message we simply set it > > instead of assigning it to 0. > > > > > > Cheers, > > > Andrew > > > > > diff -r 14ed93e7ecc5 > > plugin/icedteanp/java/sun/applet/PluginAppletViewer.java > > > --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Thu > > Sep 30 11:10:01 2010 +0100 > > > +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Fri > > Oct 01 10:52:32 2010 -0400 > > > @@ -140,7 +140,7 @@ > > > > > > > > > // put inside initial 0 handle frame > > > - PluginAppletViewer.reFrame(null, identifier, System.out, > > 0, panel); > > > + PluginAppletViewer.reFrame(null, identifier, System.out, > > handle, panel); > > > > > > panel.init(); > > > > > > @@ -557,10 +557,6 @@ > > > > > > if > > (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE)) > > > throw new Exception("Applet initialization > > timeout"); > > > - > > > - PluginAppletViewer oldFrame = > > applets.get(identifier); > > > - reFrame(oldFrame, oldFrame.identifier, > > oldFrame.statusMsgStream, > > > - handle, oldFrame.panel); > > > > > > } else { > > > PluginDebug.debug ("Handling message: " + message > > + " instance " + identifier + " " + Thread.currentThread()); > > > > Looks good. This change should have gone in with the previous > > serialization commit but was missed. > > > > Is any other part of the code other than above calling reFrame()? If > > not, that method should be removed altogether as well. > Only createPanel calls reframe now. > Doh! Right, there is still a call being made to it above. It's fine then. Ok for commit into HEAD. Cheers, Deepak > > > > Cheers, > > Deepak > > --Andrew From asu at icedtea.classpath.org Fri Oct 1 08:40:26 2010 From: asu at icedtea.classpath.org (asu at icedtea.classpath.org) Date: Fri, 01 Oct 2010 15:40:26 +0000 Subject: /hg/icedtea6: Set handle when creating panel, and remove the red... Message-ID: changeset 94f30c67c2f9 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=94f30c67c2f9 author: Andrew Su date: Fri Oct 01 11:39:33 2010 -0400 Set handle when creating panel, and remove the redundant reframe called afterwards. diffstat: 2 files changed, 9 insertions(+), 6 deletions(-) ChangeLog | 7 +++++++ plugin/icedteanp/java/sun/applet/PluginAppletViewer.java | 8 ++------ diffs (39 lines): diff -r 14ed93e7ecc5 -r 94f30c67c2f9 ChangeLog --- a/ChangeLog Thu Sep 30 11:10:01 2010 +0100 +++ b/ChangeLog Fri Oct 01 11:39:33 2010 -0400 @@ -1,3 +1,10 @@ 2010-09-29 Andrew John Hughes + + * PluginAppletViewer.java: + (createPanel): Changed call to reframe with handle 0 to the handle + passed in. + (handleMessage): Removed the redundant reframe from initialization. + 2010-09-29 Andrew John Hughes * Makefile.am: diff -r 14ed93e7ecc5 -r 94f30c67c2f9 plugin/icedteanp/java/sun/applet/PluginAppletViewer.java --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Thu Sep 30 11:10:01 2010 +0100 +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Fri Oct 01 11:39:33 2010 -0400 @@ -139,8 +139,8 @@ import com.sun.jndi.toolkit.url.UrlUtil; - // put inside initial 0 handle frame - PluginAppletViewer.reFrame(null, identifier, System.out, 0, panel); + // create the frame. + PluginAppletViewer.reFrame(null, identifier, System.out, handle, panel); panel.init(); @@ -557,10 +557,6 @@ import com.sun.jndi.toolkit.url.UrlUtil; if (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE)) throw new Exception("Applet initialization timeout"); - - PluginAppletViewer oldFrame = applets.get(identifier); - reFrame(oldFrame, oldFrame.identifier, oldFrame.statusMsgStream, - handle, oldFrame.panel); } else { PluginDebug.debug ("Handling message: " + message + " instance " + identifier + " " + Thread.currentThread()); From ahughes at redhat.com Fri Oct 1 09:56:18 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Fri, 1 Oct 2010 17:56:18 +0100 Subject: [RFC] plugin: dont shadow *Version variables in JNLPFile In-Reply-To: <20101001153549.GC13374@redhat.com> References: <4CA5F951.9080205@redhat.com> <20101001153549.GC13374@redhat.com> Message-ID: <20101001165618.GC8183@rivendell.middle-earth.co.uk> On 11:35 Fri 01 Oct , Deepak Bhole wrote: > * Omair Majid [2010-10-01 11:15]: > > Hi, > > > > The varaibles specVersion and fileVersion defined in PluginBridge > > are shadowing the variables with the same names in JNLPFile. This > > means that whenever JNLPFile tries to access fileVersion and > > specVerion for a plugin, it will see nulls. I am not sure if this > > matters - most of the uses of Version variables check for nulls. > > However, since we are setting specVersion and fileVersion > > explicitly, they should be set to the correct values. > > > > The attached patch makes sure the variables are not shadowed. > > > > Cheers, > > Omair > > > diff -r 674b1799df8c netx/net/sourceforge/jnlp/PluginBridge.java > > --- a/netx/net/sourceforge/jnlp/PluginBridge.java Wed Sep 29 13:37:46 2010 -0700 > > +++ b/netx/net/sourceforge/jnlp/PluginBridge.java Fri Oct 01 10:47:59 2010 -0400 > > @@ -35,8 +35,6 @@ > > > > public class PluginBridge extends JNLPFile > > { > > - Version specVersion = new Version("1.0"); > > - Version fileVersion = new Version("1.1"); > > > > String name; > > String[] jars = new String[0]; > > @@ -48,6 +46,8 @@ > > int width, int height, Hashtable atts) > > throws Exception > > { > > + specVersion = new Version("1.0"); > > + fileVersion = new Version("1.1"); > > this.codeBase = codebase; > > this.sourceLocation = documentBase; > > > > Looks fine to me. OK for 1.7/1.8/1.9 and HEAD. > > Deepak Likewise. Good catch. -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From ahughes at redhat.com Fri Oct 1 09:57:44 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Fri, 1 Oct 2010 17:57:44 +0100 Subject: [RFC] [Plugin] Fixes 100% cpu load In-Reply-To: <20101001145631.GA13374@redhat.com> References: <1777947099.906361285889846806.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> <1603551127.906811285890374081.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> <20101001003311.GA5671@redhat.com> <20101001144028.GA8183@rivendell.middle-earth.co.uk> <20101001145631.GA13374@redhat.com> Message-ID: <20101001165744.GD8183@rivendell.middle-earth.co.uk> On 10:56 Fri 01 Oct , Deepak Bhole wrote: > * Dr Andrew John Hughes [2010-10-01 10:40]: > > On 20:33 Thu 30 Sep , Deepak Bhole wrote: > > > * Andrew Su [2010-09-30 19:46]: > > > > > > > > ----- "Deepak Bhole" wrote: > > > > > > > > > From: "Deepak Bhole" > > > > > To: "Andrew Su" > > > > > Cc: distro-pkg-dev at openjdk.java.net > > > > > Sent: Thursday, September 30, 2010 7:15:55 PM GMT -05:00 US/Canada Eastern > > > > > Subject: Re: [RFC] [Plugin] Fixes 100% cpu load > > > > > > > > > > * Deepak Bhole [2010-09-30 18:55]: > > > > > > * Andrew Su [2010-09-30 17:57]: > > > > > > > > > > > > > > ----- "Deepak Bhole" wrote: > > > > > > > > > > > > > > > From: "Deepak Bhole" > > > > > > > > To: "Andrew Su" > > > > > > > > Cc: distro-pkg-dev at openjdk.java.net > > > > > > > > Sent: Thursday, September 30, 2010 5:01:44 PM GMT -05:00 > > > > > US/Canada Eastern > > > > > > > > Subject: Re: [RFC] [Plugin] Fixes 100% cpu load > > > > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > > > Sorry I couldn't get to this earlier.. wanted to study the > > > > > patch > > > > > > > > carefully before commenting. > > > > > > > > > > > > > > > > * Andrew Su [2010-09-27 15:25]: > > > > > > > > > Hello, > > > > > > > > > > > > > > > > > > This patch fixes the following: > > > > > > > > > *Plugin goes into a deadlock waiting for another thread to > > > > > > > > initialize applet, and no more threads are available to consume > > > > > > > > messages. > > > > > > > > > *Plugin handles "destroy" message when another thread trying > > > > > to > > > > > > > > create the applet is kicked off processor before setting the > > > > > status to > > > > > > > > PRE_INIT. > > > > > > > > > > > > > > > > > > > > > > > > > I am a bit confused about this part. As it stands now, the > > > > > sequence > > > > > > > > is > > > > > > > > as follows: > > > > > > > > > > > > > > > > init message comes in -> start init > > > > > > > > destroy message comes in > > > > > > > > if init is done -> destroy > > > > > > > > if init is in progress -> wait, then destroy > > > > > > > > > > > > > > > > Determination of if init is done or in progress is done via the > > > > > > > > status > > > > > > > > hashmap which contains one of PRE_INIT, IN_INIT or > > > > > INIT_COMPLETE. > > > > > > > > Destroy cannot be handled before PRE_INIT is set, as PRE_INIT is > > > > > the > > > > > > > > first thing set, and this code will prevent destroy from > > > > > proceeding > > > > > > > > until it is: > > > > > > > > > > > > > > > > // Wait till initialization finishes > > > > > > > > while (!applets.containsKey(identifier) && > > > > > > > > ( > > > > > > > > !status.containsKey(identifier) || > > > > > > > > > > > > > > > > status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT) > > > > > > > > ) > > > > > > > > ); > > > > > > > > > > > > > > > > > > > > > > > > > > Example. > > > > > > > > > We have 2 MessageConsumer threads. > > > > > > > > > Passes "destroy" message to both of them for applet 1 and > > > > > applet 2. > > > > > > > > > Thread 1: Spinlock waiting for another thread to initialize > > > > > applet > > > > > > > > 1. > > > > > > > > > Thread 2: Spinlock waiting for another thread to initialize > > > > > applet > > > > > > > > 2. > > > > > > > > > Both threads are now in deadlock. > > > > > > > > > > > > > > > > > > Proposed Patch: > > > > > > > > > When message is destroy, don't spinlock, handle it right > > > > > away. > > > > > > > > > -Problem with this: handles destroy right before we start > > > > > > > > initializing the applet. > > > > > > > > > -Fix to new problem: Synchronize the two blocks > > > > > > > > > --Case 1:If in process of initializing, finish initializing. > > > > > handle > > > > > > > > the destroy. > > > > > > > > > --Case 2:If destroy already handled, don't initialize. > > > > > > > > > > > > > > > > > > > > > > > > > I don't understand the destroy-before-init case. Are you seeing > > > > > an > > > > > > > > instance > > > > > > > > where destroy gets sent before init does? And if that's what > > > > > happens, > > > > > > > > the while > > > > > > > > loop above would still keep destroy from proceeding until it is > > > > > > > > initialized. > > > > > > > > > > > > > > > > Is there a test case for this problem? > > > > > > > > > > > > > > You are indeed correct that that is the sequence of handling the > > > > > messages, but.. > > > > > > > Let's say I load a page with 10 applets (we have 5 threads that > > > > > handle message). > > > > > > > Now before the applets load, navigate to another page that loads > > > > > applets or not, then we will get destroy messages. Since the messages > > > > > are queued, when there is no workers free to do work, the messages are > > > > > sent to the back of the queue to be handled later. Assuming a better > > > > > case where each of our 5 threads are given the handle message (this is > > > > > the message we use to initialize our applets). Since now all our > > > > > workers are busy processing the init, the next 5 handle messages gets > > > > > dequeued then placed at the back of queue. Next the 5 threads finishes > > > > > initializing the applets. > > > > > > > > > > > > Where did you see the 5 thread count? There should be 6. 4 > > > > > non-priority, > > > > > > 2 priority. Priority threads do not handle blocking calls, and can > > > > > only > > > > > > be used for messages registered as priority. > > > > > > > > > > > > > Each dequeuing the from the readQueue. If the destroy messages are > > > > > the ones initialized, works as intended, if not, all 5 threads will > > > > > now go into a never-ending loop. If the user waits until all the > > > > > applets load before navigating somewhere else, it'll work out since > > > > > the inits will be processed and destroy will be carried out properly, > > > > > otherwise it'll just take up the cpu. > > > > > > > > > > > > > > > > > > > Okay, so I have 4 free workers (let's ignore priority for now). > > > > > > Thread 0, Thread 1, Thread 2 and Thread 3. > > > > > > > > > > > > 10 init messages come in. And we have: > > > > > > > > > > > > Thread 0 - Processing init 0 > > > > > > Thread 1 - Processing init 1 > > > > > > Thread 2 - Processing init 2 > > > > > > Thread 3 - Processing init 3 > > > > > > > > > > > > The remaining init messages get queued. So the queue now has: > > > > > > [init 3, init 4, init 5, init 6, init 7, init 8, init 9] > > > > > > > > > > > > 10 destroy messages come in. There are no free workers, so they get > > > > > > queued and the readQueue is: > > > > > > [init 3, init 4, init 5, init 6, init 7, init 8, init 9, destroy 0, > > > > > > destroy 1, destroy 2, destroy 3, destroy 4, destroy 5, destroy 6, > > > > > > destroy 7, destroy 8, destroy 9] > > > > > > > > > > > > At some point, as the system tests each message and requeues them, > > > > > the > > > > > > readqueue becomes: > > > > > > > > > > > > [destroy 4, destroy 5, destroy 6, destroy 7, destroy 8, destroy 9 > > > > > ....] > > > > > > > > > > > > And those first 4 destroy messages take up the 4 available threads. > > > > > > > > > > > > Is this the correct description of the issue? > > > > Yes. > > > > > > > > > > > > > > > > Assuming so, wouldn't just keeping messages at the front of the > > > > > queue > > > > > > instead of re-adding them to the back work? The fix would be a > > > > > one-liner > > > > > > and we wouldn't need any locks. > > > > > > > > > > > > I don't think it will make things worse either. Messages are > > > > > re-added to > > > > > > the queue only when no free workers are available. Adding to the > > > > > back > > > > > > of the queue does not guarantee FIFO processing order since the > > > > > order is > > > > > > constantly changing (as seen in your example). However at the end > > > > > of > > > > > > each cycle, the order resembles FIFO. This means that FIFO order > > > > > works > > > > > > as well. If FIFO works, we can just make that the default. > > > > > > > > > > > > > > > > Doh! So close. Just remembered why it needs to add them to the back > > > > > of > > > > > the queue. It is so that priority messages can be processed while the > > > > > others wait. > > > > > > > > > > Easy fix though. We would just have to scan the queue to see if there > > > > > are any priority messages, and if so, move them to the front and > > > > > retry > > > > > processing. > > > > I don't think having it sort the queue is worth the hit on performance. > > > > Since adding to the head of a queue will require recopying the rest of the messages, or keep track of which element is the head. > > > > > > > > > > It is a linked list. Cost of addition/deletion is constant. > > > > > > As for list traversal cost, the cost will be the same O(n) as now since > > > we append to the end of the queue and look at the next and keep doing it > > > until a priority message is found and processed. Even with locks, this > > > will stay at O(n). > > > > > > e.g. Say the list contains 4 non-priority messages (N) and 1 priority > > > message (P) for n=5. If at the start, the queue is [N, N, N, N, P], with the > > > current code the list changes as: > > > > > > [N, N, N, P, N] > > > [N, N, N, P, N] > > > [N, N, P, N, N] > > > [N, P, N, N, N] > > > [P, N, N, N, N] > > > > > > [N, N, N, N] > > > > > > For cost O(n) > > > > > > With the new code, it'd be: > > > [N, N, N, N, P] -> > > > > > > [P, N, N, N, N] > > > > > > [N, N, N, N] > > > > > > The cost is still O(n) > > > > > > Additionally, such a case where processors are full would be encountered > > > rarely since a vast majority of pages have a single applet which > > > wouldn't max out the thread pool. > > > > > > > Deepak, is this all documented somewhere? The code I looked at was very lax on comments. > > > > It is a mixture of old and new code. Unfortunately it is not documented. > The above class I am referring to (PluginMessageConsumer) is just a > customized tread pool -- I am trying to add comments as much as possible > as I re-design things (the C++ side for example is fairly well > documented for all the new parts). > Having a high-level overview would be good. Didn't you do something like that for a plugin talk? > Cheers, > Deepak > > > > Cheers, > > > Deepak > > > > > > > > > > > > > Deepak > > > > > > > > > > > This does no solve the problem of the applets 'hanging around in a > > > > > > separate window' until destroy is processed, > > > > When we set the handle using reframe at the bottom of the handle block, that's where the applet shows up in a separate window. If we do not reframe given that a destroy message is sent, we can avoid the window showing up at all. (I am still looking into doing this) > > > > > > > > > > but I don't imagine > > > > > too > > > > > > many regular users see that case. And even if they do, the applet > > > > > is > > > > > > always guaranteed to be destroyed eventually, ensuring a consistent > > > > > > state. > > > > Yes they will be eventually destroyed, but during that time do we we really want to have it using up their resources? > > > > > > > > > > > > > > > > Cheers, > > > > > > Deepak > > > > > > > > > > > > > > > > > > > > > > Sorry to be nitpicking.. I am trying to get rid of locks from > > > > > the code > > > > > > > > as much > > > > > > > > as possible by re-designing message sequencing... if a lock is > > > > > to be > > > > > > > > added, I > > > > > > > > want to make sure there is no other solution first :) > > > > > > > > > > > > > > > > Cheers, > > > > > > > > Deepak > > > > > > > > > > > > > > > > > Cheers, > > > > > > > > > Andrew > > > > > > > > > > > > -- > > Andrew :) > > > > Free Java Software Engineer > > Red Hat, Inc. (http://www.redhat.com) > > > > Support Free Java! > > Contribute to GNU Classpath and the OpenJDK > > http://www.gnu.org/software/classpath > > http://openjdk.java.net > > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From ahughes at redhat.com Fri Oct 1 09:58:45 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Fri, 1 Oct 2010 17:58:45 +0100 Subject: what is patches/icedtea-timerqueue.patch? In-Reply-To: <4CA5FEA4.1090209@redhat.com> References: <4CA4FFBE.7080106@redhat.com> <20101001144821.GB8183@rivendell.middle-earth.co.uk> <4CA5FEA4.1090209@redhat.com> Message-ID: <20101001165845.GE8183@rivendell.middle-earth.co.uk> On 11:30 Fri 01 Oct , Omair Majid wrote: > Hi, > > On 10/01/2010 10:48 AM, Dr Andrew John Hughes wrote: > > On 17:23 Thu 30 Sep , Omair Majid wrote: > >> Hi, > >> > >> I just came across patches/icedtea-timerqueue.patch. I cannot find any > >> bug number or explanation of the patch. The only thing I see is the > >> patch itself [1]. It might possibly be a fix for S6623943 [2], but if > >> so, I dont think it solves the problem. > >> > >> Does anybody know more about this patch? > >> > > > > http://icedtea.classpath.org/wiki/IcedTea_JDK6_Patches > > http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=87 > > > > Ah, thanks for the links. I had forgotten about the wiki page we set up. > So have most people it seems :-( > > There's a few patches like this. People don't always seem to bother to document > > them. > > > > Yes, a lot of patches (including some of mine) should have had much > better documentation :( > > Thanks, > Omair -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From omajid at redhat.com Fri Oct 1 09:32:29 2010 From: omajid at redhat.com (Omair Majid) Date: Fri, 01 Oct 2010 12:32:29 -0400 Subject: /hg/icedtea6: Set handle when creating panel, and remove the red... In-Reply-To: References: Message-ID: <4CA60D1D.4020905@redhat.com> Hi Andrew, On 10/01/2010 11:40 AM, asu at icedtea.classpath.org wrote: > changeset 94f30c67c2f9 in /hg/icedtea6 > details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=94f30c67c2f9 > author: Andrew Su > date: Fri Oct 01 11:39:33 2010 -0400 > > Set handle when creating panel, and remove the redundant reframe > called afterwards. > I believe this fix takes care of PR 535[1] (since it avoids the reparenting issue). In fact, with this patch applied, I can not reproduce the bug on my machine any more. Thanks a lot! Cheers, Omair [1] http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=535 From bugzilla-daemon at icedtea.classpath.org Fri Oct 1 10:54:31 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 01 Oct 2010 17:54:31 +0000 Subject: [Bug 564] NetX depends on sun.misc.BASE64Encoder Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=564 ------- Comment #1 from omajid at redhat.com 2010-10-01 17:54 ------- I cant find a way to portably encode data in base 64 format. I see quite a few classes named Base64, but none of them are public or standard (I thought the OpenJDK developers would have standardized a Base64 class given that it's used in so many places). Since Netx is a part of the JDK, it cant depend on an external library (such as apache-commons) to encode data in base 64 format. Any ideas? Should I implement Base64 encoding as part of Netx? -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From dbhole at redhat.com Fri Oct 1 11:02:14 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Fri, 1 Oct 2010 14:02:14 -0400 Subject: [RFC] [Plugin] Fixes 100% cpu load In-Reply-To: <20101001165744.GD8183@rivendell.middle-earth.co.uk> References: <1777947099.906361285889846806.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> <1603551127.906811285890374081.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> <20101001003311.GA5671@redhat.com> <20101001144028.GA8183@rivendell.middle-earth.co.uk> <20101001145631.GA13374@redhat.com> <20101001165744.GD8183@rivendell.middle-earth.co.uk> Message-ID: <20101001180213.GA15532@redhat.com> * Dr Andrew John Hughes [2010-10-01 12:57]: > > > > > > Deepak, is this all documented somewhere? The code I looked at was very lax on comments. > > > > > > > It is a mixture of old and new code. Unfortunately it is not documented. > > The above class I am referring to (PluginMessageConsumer) is just a > > customized tread pool -- I am trying to add comments as much as possible > > as I re-design things (the C++ side for example is fairly well > > documented for all the new parts). > > > > Having a high-level overview would be good. Didn't you do something like that for a plugin talk? > Yep, I have sequence and architecture diagrams. I'll update/polish it up a bit and put it online somewhere. Cheers, Deepak From bugzilla-daemon at icedtea.classpath.org Fri Oct 1 11:15:07 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 01 Oct 2010 18:15:07 +0000 Subject: [Bug 562] [METABUG] NetX code contains reference to non-standard sun.* classes Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=562 dbhole at redhat.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at icedtea.classpath|dbhole at redhat.com |.org | -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Fri Oct 1 11:15:01 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 01 Oct 2010 18:15:01 +0000 Subject: [Bug 563] NetX uses sun.security code Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=563 dbhole at redhat.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at icedtea.classpath|dbhole at redhat.com |.org | -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Fri Oct 1 11:20:43 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 01 Oct 2010 18:20:43 +0000 Subject: [Bug 564] NetX depends on sun.misc.BASE64Encoder Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=564 ------- Comment #2 from dbhole at redhat.com 2010-10-01 18:20 ------- There is no standard Java API to do it. Classpath has a Base64 encoder. It is GPL and we can copy that one into the NetX code, rather than re-implementing one from scratch. Feel tree to take this one. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Fri Oct 1 14:18:43 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 01 Oct 2010 21:18:43 +0000 Subject: [Bug 564] NetX depends on sun.misc.BASE64Encoder Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=564 ------- Comment #3 from omajid at redhat.com 2010-10-01 21:18 ------- Created an attachment (id=426) --> (http://icedtea.classpath.org/bugzilla/attachment.cgi?id=426&action=view) patch The Base64 class is copied from java.util.prefs.Base64 (which is part of OpenJDK). The changes to KeyTool are my own. Still, I am too excited about reinventing (or rather copying) the wheel. While I dont expect the Base64 encoding to change, copying code rather than using a library doesnt seem like the best thing to do. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From siemsen at ucar.edu Fri Oct 1 15:53:13 2010 From: siemsen at ucar.edu (siemsen at ucar.edu) Date: Fri, 1 Oct 2010 16:53:13 -0600 Subject: icedtea can't run applet Message-ID: <3D2D3755-9986-4728-BDB3-33396DF1F8E4@ucar.edu> I'm sorry if this is the wrong list for this question. Iceweasel/Icedtea won't execute a Java applet that other browsers/plugins can. When I use iceweasel/icedtea to visit http://ndt.atla.net.internet2.edu, the applet is a grey box. Iceweasel reports the following errors: -------------- next part -------------- A non-text attachment was scrubbed... Name: Petes.png Type: image/png Size: 10865 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101001/f168afa0/Petes.png -------------- next part -------------- Can you suggest anything? -- Pete From bugzilla-daemon at icedtea.classpath.org Sat Oct 2 01:30:16 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Sat, 02 Oct 2010 08:30:16 +0000 Subject: [Bug 564] NetX depends on sun.misc.BASE64Encoder Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=564 ------- Comment #4 from aph at redhat.com 2010-10-02 08:30 ------- sun.misc.BASE64Encoder is the de facto standard way to do it. A great many projects use this class. So, I don't believe that this is really a bug. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Sun Oct 3 13:31:40 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Sun, 03 Oct 2010 20:31:40 +0000 Subject: [Bug 565] New: UIDefaults.getUI fails with jgoodies:looks 2.3.1 Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=565 Summary: UIDefaults.getUI fails with jgoodies:looks 2.3.1 Product: IcedTea Version: 6-1.8.1 Platform: 32-bit OS/Version: Linux Status: NEW Severity: major Priority: P2 Component: IcedTea6 AssignedTo: unassigned at icedtea.classpath.org ReportedBy: mm at michaelamerz.com Using jgoodies:looks 2.3.1 results in multiple errors: UIDefaults.getUI() failed: no ComponentUI class for: javax.swing.JScrollPane$ScrollBar[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=4194304,maximumSize=,minimumSize=,preferredSize=,blockIncrement=10,orientation=VERTICAL,unitIncrement=1] UIDefaults.getUI() failed: no ComponentUI class for: javax.swing.JScrollPane$ScrollBar[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=4194304,maximumSize=,minimumSize=,preferredSize=,blockIncrement=10,orientation=HORIZONTAL,unitIncrement=1] UIDefaults.getUI() failed: no ComponentUI class for: javax.swing.JScrollPane$ScrollBar[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=4194304,maximumSize=,minimumSize=,preferredSize=,blockIncrement=10,orientation=HORIZONTAL,unitIncrement=1] and other swing widgets. This results in missing buttons and other distortions. Previous version of icedtea worked ok. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From omajid at icedtea.classpath.org Mon Oct 4 08:10:20 2010 From: omajid at icedtea.classpath.org (omajid at icedtea.classpath.org) Date: Mon, 04 Oct 2010 15:10:20 +0000 Subject: /hg/icedtea6: netx: show the filename when an untrusted program ... Message-ID: changeset 748a45decac0 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=748a45decac0 author: Omair Majid date: Mon Oct 04 11:05:17 2010 -0400 netx: show the filename when an untrusted program requests opening a file 2010-10-04 Omair Majid * netx/net/sourceforge/jnlp/resources/Messages.properties: Add AFileOnTheMachine, change SFileReadAccess and SFileWriteAccess. * netx/net/sourceforge/jnlp/security/AccessWarningPane.java: (addComponents): Add the filename to the message. * netx/net/sourceforge/jnlp/services/XExtendedService.java: (openFile): Pass along the filename to ServiceUtil.checkAccess. * netx/net/sourceforge/jnlp/util/FileUtils.java: (displayablePath): New method. (displayablePath): Likewise. diffstat: 5 files changed, 83 insertions(+), 6 deletions(-) ChangeLog | 12 ++ netx/net/sourceforge/jnlp/resources/Messages.properties | 5 - netx/net/sourceforge/jnlp/security/AccessWarningPane.java | 15 ++- netx/net/sourceforge/jnlp/services/XExtendedService.java | 4 netx/net/sourceforge/jnlp/util/FileUtils.java | 53 +++++++++++++ diffs (157 lines): diff -r 94f30c67c2f9 -r 748a45decac0 ChangeLog --- a/ChangeLog Fri Oct 01 11:39:33 2010 -0400 +++ b/ChangeLog Mon Oct 04 11:05:17 2010 -0400 @@ -1,3 +1,15 @@ 2010-10-01 Andrew Su +2010-10-04 Omair Majid + + * netx/net/sourceforge/jnlp/resources/Messages.properties: + Add AFileOnTheMachine, change SFileReadAccess and SFileWriteAccess. + * netx/net/sourceforge/jnlp/security/AccessWarningPane.java: + (addComponents): Add the filename to the message. + * netx/net/sourceforge/jnlp/services/XExtendedService.java: + (openFile): Pass along the filename to ServiceUtil.checkAccess. + * netx/net/sourceforge/jnlp/util/FileUtils.java: + (displayablePath): New method. + (displayablePath): Likewise. + 2010-10-01 Andrew Su * PluginAppletViewer.java: diff -r 94f30c67c2f9 -r 748a45decac0 netx/net/sourceforge/jnlp/resources/Messages.properties --- a/netx/net/sourceforge/jnlp/resources/Messages.properties Fri Oct 01 11:39:33 2010 -0400 +++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Mon Oct 04 11:05:17 2010 -0400 @@ -6,6 +6,7 @@ ButOk=OK ButOk=OK ButCancel=\ Cancel\ ButBrowse=Browse... +AFileOnTheMachine=a file on the machine # LS - Severity LSMinor=Minor @@ -150,8 +151,8 @@ CChooseCacheDir=Cache directory CChooseCacheDir=Cache directory # Security -SFileReadAccess=The application has requested read access to a file on the machine. Do you want to allow this action? -SFileWriteAccess=The application has requested write access to a file on the machine. Do you want to allow this action? +SFileReadAccess=The application has requested read access to {0}. Do you want to allow this action? +SFileWriteAccess=The application has requested write access to {0}. Do you want to allow this action? SDesktopShortcut=The application has requested permission to create a desktop launcher. Do you want to allow this action? SSigUnverified=The application's digital signature cannot be verified. Do you want to run the application? SSigVerified=The application's digital signature has been verified. Do you want to run the application? diff -r 94f30c67c2f9 -r 748a45decac0 netx/net/sourceforge/jnlp/security/AccessWarningPane.java --- a/netx/net/sourceforge/jnlp/security/AccessWarningPane.java Fri Oct 01 11:39:33 2010 -0400 +++ b/netx/net/sourceforge/jnlp/security/AccessWarningPane.java Mon Oct 04 11:05:17 2010 -0400 @@ -56,6 +56,7 @@ import javax.swing.SwingConstants; import javax.swing.SwingConstants; import net.sourceforge.jnlp.JNLPFile; +import net.sourceforge.jnlp.util.FileUtils; /** * Provides a panel to show inside a SecurityWarningDialog. These dialogs are @@ -114,10 +115,18 @@ public class AccessWarningPane extends S String topLabelText = ""; switch (type) { case READ_FILE: - topLabelText = R("SFileReadAccess"); + if (extras != null && extras.length > 0 && extras[0] instanceof String) { + topLabelText = R("SFileReadAccess", FileUtils.displayablePath((String)extras[0])); + } else { + topLabelText = R("SFileReadAccess", R("AFileOnTheMachine")); + } break; case WRITE_FILE: - topLabelText = R("SFileWriteAccess"); + if (extras != null && extras.length > 0 && extras[0] instanceof String) { + topLabelText = R("SFileWriteAccess", FileUtils.displayablePath((String)extras[0])); + } else { + topLabelText = R("SFileWriteAccess", R("AFileOnTheMachine")); + } break; case CREATE_DESTKOP_SHORTCUT: topLabelText = R("SDesktopShortcut"); @@ -145,7 +154,7 @@ public class AccessWarningPane extends S JPanel topPanel = new JPanel(new BorderLayout()); topPanel.setBackground(Color.WHITE); topPanel.add(topLabel, BorderLayout.CENTER); - topPanel.setPreferredSize(new Dimension(400,60)); + topPanel.setPreferredSize(new Dimension(450,100)); topPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10)); //application info diff -r 94f30c67c2f9 -r 748a45decac0 netx/net/sourceforge/jnlp/services/XExtendedService.java --- a/netx/net/sourceforge/jnlp/services/XExtendedService.java Fri Oct 01 11:39:33 2010 -0400 +++ b/netx/net/sourceforge/jnlp/services/XExtendedService.java Mon Oct 04 11:05:17 2010 -0400 @@ -34,7 +34,9 @@ public class XExtendedService implements public FileContents openFile(File file) throws IOException { - if (ServiceUtil.checkAccess(SecurityWarningDialog.AccessType.READ_FILE)) { + /* FIXME: this opens a file with read/write mode, not just read or write */ + if (ServiceUtil.checkAccess(SecurityWarningDialog.AccessType.READ_FILE, + new Object[]{ file.getAbsolutePath() })) { return (FileContents) ServiceUtil.createPrivilegedProxy(FileContents.class, new XFileContents(file)); } else { diff -r 94f30c67c2f9 -r 748a45decac0 netx/net/sourceforge/jnlp/util/FileUtils.java --- a/netx/net/sourceforge/jnlp/util/FileUtils.java Fri Oct 01 11:39:33 2010 -0400 +++ b/netx/net/sourceforge/jnlp/util/FileUtils.java Mon Oct 04 11:05:17 2010 -0400 @@ -68,4 +68,57 @@ public final class FileUtils { return filename; } + /** + * Returns a String that is suitable for using in GUI elements for + * displaying (long) paths to users. + * + * @param path a path that should be shortened + * @return a shortened path suitable for displaying to the user + */ + public static String displayablePath(String path) { + final int DEFAULT_LENGTH = 40; + return displayablePath(path, DEFAULT_LENGTH); + } + + /** + * Return a String that is suitable for using in GUI elements for displaying + * paths to users. If the path is longer than visibleChars, it is truncated + * in a display-friendly way + * + * @param path a path that should be shorted + * @param visibleChars the maximum number of characters that path should fit + * into. Also the length of the returned string + * @return a shortened path that contains limited number of chars + */ + public static String displayablePath(String path, int visibleChars) { + /* + * use a very simple method: prefix + "..." + suffix + * + * where prefix is the beginning part of path (as much as we can squeeze in) + * and suffix is the end path of path + */ + + if (path == null || path.length() <= visibleChars) { + return path; + } + + final String OMITTED = "..."; + final int OMITTED_LENGTH = OMITTED.length(); + final int MIN_PREFIX_LENGTH = 4; + final int MIN_SUFFIX_LENGTH = 4; + /* + * we want to show things other than OMITTED. if we have too few for + * suffix and prefix, then just return as much as we can of the filename + */ + if (visibleChars < (OMITTED_LENGTH + MIN_PREFIX_LENGTH + MIN_SUFFIX_LENGTH)) { + return path.substring(path.length() - visibleChars); + } + + int affixLength = (visibleChars - OMITTED_LENGTH)/2; + String prefix = path.substring(0, affixLength); + String suffix = path.substring(path.length() - affixLength); + + return prefix + OMITTED + suffix; + } + } From omajid at redhat.com Mon Oct 4 08:17:11 2010 From: omajid at redhat.com (Omair Majid) Date: Mon, 04 Oct 2010 11:17:11 -0400 Subject: [RFC] PR 535: null pointer exceptions during applet initialization In-Reply-To: <20100917201621.GB13671@redhat.com> References: <4C93C7B3.207@redhat.com> <20100917201621.GB13671@redhat.com> Message-ID: <4CA9EFF7.1010901@redhat.com> On 09/17/2010 04:16 PM, Deepak Bhole wrote: > * Omair Majid [2010-09-17 15:56]: >> Hi, >> >> The attached patch fixes icedtea bug 535 [1]. Some calls to >> showAppletStatus are throwing null pointer exceptions. The problem >> appears to be that the AppletPanel is reparented during >> initialization (see PluginAppletViewer.reFrame()). There is a small >> window of time where the AppletPanel does not have a parent, which >> causes getParent() to return null and cause this >> NullPointerException. >> >> The attached patch tries to avoid this problem by trying again if it >> detects the parent is null. >> >> Any thoughts or comments? >> >> Cheers, >> Omair >> > > Patch is fine. But as I commented on the bug, please hold off for now. > There are API changes I am working on that will add a common wait > function for this sort of stuff. There are many cases where threads need > to wait till the applet is ready, and one of the changes will add a > function that blocks till such a time. > I believe Andrew's recent patch to icedtea6 [1] which removes the reframing of the applet removes this problem completely. I am going to discard this patch. Cheers, Omair [1] http://icedtea.classpath.org/hg/icedtea6/rev/94f30c67c2f9 From omajid at icedtea.classpath.org Mon Oct 4 08:17:59 2010 From: omajid at icedtea.classpath.org (omajid at icedtea.classpath.org) Date: Mon, 04 Oct 2010 15:17:59 +0000 Subject: /hg/icedtea6: plugin: do not shadow specVersion and fileVersion Message-ID: changeset 145255946142 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=145255946142 author: Omair Majid date: Mon Oct 04 11:13:32 2010 -0400 plugin: do not shadow specVersion and fileVersion 2010-10-04 Omair Majid * /netx/net/sourceforge/jnlp/PluginBridge.java Do not shadow specVersion and fileVersion variables by redeclaring them. (PluginBridge): Initialize specVersion and fileVersion. diffstat: 2 files changed, 8 insertions(+), 2 deletions(-) ChangeLog | 6 ++++++ netx/net/sourceforge/jnlp/PluginBridge.java | 4 ++-- diffs (34 lines): diff -r 748a45decac0 -r 145255946142 ChangeLog --- a/ChangeLog Mon Oct 04 11:05:17 2010 -0400 +++ b/ChangeLog Mon Oct 04 11:13:32 2010 -0400 @@ -1,3 +1,9 @@ 2010-10-04 Omair Majid + + * /netx/net/sourceforge/jnlp/PluginBridge.java + Do not shadow specVersion and fileVersion variables by redeclaring them. + (PluginBridge): Initialize specVersion and fileVersion. + 2010-10-04 Omair Majid * netx/net/sourceforge/jnlp/resources/Messages.properties: diff -r 748a45decac0 -r 145255946142 netx/net/sourceforge/jnlp/PluginBridge.java --- a/netx/net/sourceforge/jnlp/PluginBridge.java Mon Oct 04 11:05:17 2010 -0400 +++ b/netx/net/sourceforge/jnlp/PluginBridge.java Mon Oct 04 11:13:32 2010 -0400 @@ -35,8 +35,6 @@ import net.sourceforge.jnlp.runtime.JNLP public class PluginBridge extends JNLPFile { - Version specVersion = new Version("1.0"); - Version fileVersion = new Version("1.1"); String name; String[] jars = new String[0]; @@ -48,6 +46,8 @@ public class PluginBridge extends JNLPFi int width, int height, Hashtable atts) throws Exception { + specVersion = new Version("1.0"); + fileVersion = new Version("1.1"); this.codeBase = codebase; this.sourceLocation = documentBase; From ptisnovs at icedtea.classpath.org Mon Oct 4 08:42:38 2010 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Mon, 04 Oct 2010 15:42:38 +0000 Subject: /hg/gfx-test: Refactored graphics test harness. Methods used for... Message-ID: changeset 436d07eb5e5d in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=436d07eb5e5d author: Pavel Tisnovsky date: Mon Oct 04 17:43:09 2010 +0200 Refactored graphics test harness. Methods used for run external command are now stored in separated class, so as dialogs and methods manipulating with (test) files and directories. diffstat: 5 files changed, 440 insertions(+), 160 deletions(-) src/org/gfxtest/harness/Dialogs.java | 93 +++++++++++ src/org/gfxtest/harness/ExternalCommands.java | 171 +++++++++++++++++++++ src/org/gfxtest/harness/FileSystemTools.java | 81 ++++++++++ src/org/gfxtest/harness/MainWindow.java | 202 +++++-------------------- src/org/gfxtest/harness/Paths.java | 53 ++++++ diffs (truncated from 741 to 500 lines): diff -r 967a5209d4f9 -r 436d07eb5e5d src/org/gfxtest/harness/Dialogs.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/gfxtest/harness/Dialogs.java Mon Oct 04 17:43:09 2010 +0200 @@ -0,0 +1,93 @@ +/* + Java gfx-test framework + + Copyright (C) 2010 Red Hat + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. +*/ + +package org.gfxtest.harness; + +import javax.swing.JFrame; +import javax.swing.JOptionPane; + +/** + * Various dialog boxes. + * + * @author Pavel Tisnovsky + */ +public class Dialogs +{ + private static final String ABOUT_TEXT = "Gfx test harness version 0.1\nAuthor: Pavel Tisnovsky, Red Hat"; + + private final String title; + private final JFrame window; + + public Dialogs(String title, JFrame window) + { + this.title = title; + this.window = window; + } + + private void infoMessage(String message) + { + JOptionPane.showMessageDialog(this.window, message, this.title, JOptionPane.INFORMATION_MESSAGE); + } + + private void errorMessage(String message) + { + JOptionPane.showMessageDialog(this.window, message, this.title, JOptionPane.ERROR_MESSAGE); + } + + public void showNoTestSelectedMessage() + { + this.errorMessage("No test selected in left list box!"); + } + + public void showDialogWhenCompilationFailed(Exception e) + { + this.errorMessage("Error occured during compilation: " + e.getMessage()); + } + + public void showDialogWhenRunTestFailed(Exception e) + { + this.errorMessage("Error occured during test run: " + e.getMessage()); + } + + public void showAboutDialog() + { + this.infoMessage(ABOUT_TEXT); + } +} diff -r 967a5209d4f9 -r 436d07eb5e5d src/org/gfxtest/harness/ExternalCommands.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/gfxtest/harness/ExternalCommands.java Mon Oct 04 17:43:09 2010 +0200 @@ -0,0 +1,171 @@ +/* + Java gfx-test framework + + Copyright (C) 2010 Red Hat + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. +*/ + +package org.gfxtest.harness; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; + +/** + * This class contains methods used for run external commands: compile selected + * test suite and run selected test. + * + * @author Pavel Tisnovsky + */ +public class ExternalCommands +{ + private static final String RUN_OPTIONS = "-w=640 -h=480 -t=rgb"; + + /** + * Read all lines from buffered reader and converts all lines to one string. + * @param bufferedReader + * @return all lines concatenated into one string + * @throws IOException + */ + private static String copyFromBufferedReaderToString(BufferedReader bufferedReader) throws IOException + { + String line; + StringBuffer output = new StringBuffer(); + while ((line = bufferedReader.readLine()) != null) + { + output.append(line + "\n"); + } + return output.toString(); + } + + /** + * Read standard output from the command and put it to String + * @param process + * @return + * @throws IOException + */ + private static String fetchStandardOutput(Process process) throws IOException + { + BufferedReader stdInput = new BufferedReader(new InputStreamReader(process.getInputStream())); + return copyFromBufferedReaderToString(stdInput); + } + + /** + * Read error output from the command and put it to String + * @param process + * @return + * @throws IOException + */ + private static String fetchErrorOutput(Process process) throws IOException + { + BufferedReader stdError = new BufferedReader(new InputStreamReader(process.getErrorStream())); + return copyFromBufferedReaderToString(stdError); + } + + private static String constructBuildCommand(String selectedTestSuite) + { + return "javac -d " + Paths.BUILD_DIRECTORY + " -sourcepath " + Paths.SOURCE_DIRECTORY + "/ " + + Paths.PATH_TO_TESTSUITES + "/" + selectedTestSuite + ".java"; + } + + private static String constructRunCommand(String pathToJava, String selectedTestName, String outputDirectoryForSelectedTest) + { + return pathToJava + " -cp " + Paths.BUILD_DIRECTORY + " org.gfxtest.testsuites." + selectedTestName + " " + + RUN_OPTIONS + " -o=" + outputDirectoryForSelectedTest; + } + + public static String compileSelectedTestSuite(String selectedTestSuite) throws IOException, InterruptedException, RuntimeException + { + FileSystemTools.createDirectory(Paths.BUILD_DIRECTORY); + String compilationCommand = constructBuildCommand(selectedTestSuite); + Process process = Runtime.getRuntime().exec(compilationCommand); + StringBuffer output = new StringBuffer(); + + output.append("Compilation command:\n"); + output.append(compilationCommand + "\n"); + + output.append("\n"); + output.append("Standard output for compilation: \n"); + output.append("---------------------------------\n"); + + output.append(fetchStandardOutput(process)); + + output.append("\n"); + output.append("Error output: \n"); + output.append("---------------------------------\n"); + + output.append(fetchErrorOutput(process)); + process.waitFor(); + if (process.exitValue() != 0) + { + throw new RuntimeException("Exit code = " + process.exitValue()); + } + return output.toString(); + } + + public static String runTestOnGivenJDK(String pathToJava, String selectedTestName, String outputDirectory) throws IOException, InterruptedException, RuntimeException + { + String outputDirectoryForSelectedTest = FileSystemTools.constructTestDirectoryName(outputDirectory, selectedTestName); + FileSystemTools.createDirectory(outputDirectory); + FileSystemTools.createDirectory(outputDirectoryForSelectedTest); + FileSystemTools.eraseDirectory(outputDirectoryForSelectedTest); + String runCommand = constructRunCommand(pathToJava, selectedTestName, outputDirectoryForSelectedTest); + Process process = Runtime.getRuntime().exec(runCommand); + StringBuffer output = new StringBuffer(); + + output.append("Run command:\n"); + output.append(runCommand + "\n"); + + output.append("\n"); + output.append("Standard output for test run: \n"); + output.append("---------------------------------\n"); + + output.append(fetchStandardOutput(process)); + + output.append("\n"); + output.append("Error output: \n"); + output.append("---------------------------------\n"); + + output.append(fetchErrorOutput(process)); + process.waitFor(); + if (process.exitValue() != 0) + { + throw new RuntimeException("Exit code = " + process.exitValue()); + } + return output.toString(); + } + +} diff -r 967a5209d4f9 -r 436d07eb5e5d src/org/gfxtest/harness/FileSystemTools.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/gfxtest/harness/FileSystemTools.java Mon Oct 04 17:43:09 2010 +0200 @@ -0,0 +1,81 @@ +/* + Java gfx-test framework + + Copyright (C) 2010 Red Hat + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. +*/ + +package org.gfxtest.harness; + +import java.io.File; + +/** + * Various tools for files and directories manipulation. + * + * @author Pavel Tisnovsky + */ +public class FileSystemTools +{ + public static void createDirectory(String directoryName) + { + File directory = new File(directoryName); + if (directory.isFile()) + { + System.err.println("Directory " + directoryName + + " can not be created because file with the same name already exists!"); + throw new RuntimeException("Can't create work directory (please remove file named " + directoryName + ")"); + } + if (!directory.exists()) + { + directory.mkdir(); + } + } + + public static void eraseDirectory(String directoryName) + { + File directory = new File(directoryName); + for (String fileName : directory.list()) + { + new File(directory, fileName).delete(); + } + } + + public static String constructTestDirectoryName(String baseDirectory, String selectedTestName) + { + return new File(baseDirectory, selectedTestName).getAbsolutePath(); + } + +} diff -r 967a5209d4f9 -r 436d07eb5e5d src/org/gfxtest/harness/MainWindow.java --- a/src/org/gfxtest/harness/MainWindow.java Fri Oct 01 17:29:09 2010 +0200 +++ b/src/org/gfxtest/harness/MainWindow.java Mon Oct 04 17:43:09 2010 +0200 @@ -46,16 +46,13 @@ import java.awt.Insets; import java.awt.Insets; import java.awt.event.*; import java.awt.image.BufferedImage; -import java.io.BufferedReader; import java.io.File; import java.io.IOException; -import java.io.InputStreamReader; import java.util.*; import javax.imageio.ImageIO; import javax.swing.*; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; +import javax.swing.event.*; import javax.swing.table.DefaultTableModel; /** @@ -74,16 +71,11 @@ public class MainWindow public class MainWindow { private static final String WINDOW_TITLE = "Gfx test harness"; - protected static final String ABOUT_TEXT = "Gfx test harness version 0.1\nAuthor: Pavel Tisnovsky, Red Hat"; private static final int DEFAULT_WINDOW_WIDTH = 1024; private static final int DEFAULT_WINDOW_HEIGHT = 768; - private static final String BUILD_DIRECTORY = "test-build"; - private static final String SOURCE_DIRECTORY = "src"; private static final String SAMPLES_DIRECTORY = "samples"; private static final String OUTPUT_DIRECTORY = "output"; - private static final String PATH_TO_TESTSUITES = SOURCE_DIRECTORY + "/org/gfxtest/testsuites"; - private static final String RUN_OPTIONS = "-w=640 -h=480 -t=rgb"; private String referenceJava = "/usr/lib/jvm/java/bin/java"; private String testedJava = "/usr/lib/jvm/java/bin/java"; @@ -100,10 +92,12 @@ public class MainWindow private JButton commandRun = new JButton("Run"); protected JList jTestList = null; protected JTable jResultsTable; - private boolean tableIsErasing; private JLabel topRightLabel = new JLabel("sample image"); private JLabel bottomLeftLabel = new JLabel("difference"); private JLabel bottomRightLabel = new JLabel("test image"); + private Dialogs dialogs = null; + + private boolean tableIsErasing; private JMenuBar createMainMenu() { @@ -147,9 +141,7 @@ public class MainWindow @Override public void actionPerformed(ActionEvent e) { - JOptionPane.showMessageDialog(getMainWindow(), - ABOUT_TEXT, WINDOW_TITLE, - JOptionPane.INFORMATION_MESSAGE); + onHelpAboutMenuSelected(); } }); helpMenu.add(fileHelpAbout); @@ -214,7 +206,7 @@ public class MainWindow @Override public void actionPerformed(ActionEvent e) { - compileSelectedTest(); + onCompileButtonPressed(); } }); @@ -223,7 +215,7 @@ public class MainWindow @Override public void actionPerformed(ActionEvent e) { - runSelectedTest(); + onButtonRunPressed(); } }); @@ -261,6 +253,8 @@ public class MainWindow protected void createMainWindow() { JFrame window = new JFrame(WINDOW_TITLE); + this.dialogs = new Dialogs(WINDOW_TITLE, window); + window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); window.setJMenuBar(createMainMenu()); @@ -365,8 +359,8 @@ public class MainWindow { String testName = this.selectedTestSuite + "_" + this.resultTable.getValueAt(selectedIndex, 0).toString() + ".png"; - String sampleFileName = constructTestDirectoryName(SAMPLES_DIRECTORY, this.selectedTestSuite); - String testFileName = constructTestDirectoryName(OUTPUT_DIRECTORY, this.selectedTestSuite); + String sampleFileName = FileSystemTools.constructTestDirectoryName(SAMPLES_DIRECTORY, this.selectedTestSuite); + String testFileName = FileSystemTools.constructTestDirectoryName(OUTPUT_DIRECTORY, this.selectedTestSuite); File sampleImageFile = new File(sampleFileName, testName); if (sampleImageFile.exists() && sampleImageFile.isFile()) @@ -411,7 +405,7 @@ public class MainWindow protected void refreshTestList() { this.selectedTestSuite = null; - File dir = new File(System.getProperty("user.dir"), PATH_TO_TESTSUITES); + File dir = new File(System.getProperty("user.dir"), Paths.PATH_TO_TESTSUITES); Set testNames = new TreeSet(); for (String name : dir.list()) { @@ -480,186 +474,74 @@ public class MainWindow this.tableIsErasing = false; } - private void showNoTestSelectedMessage() + protected void onHelpAboutMenuSelected() { - JOptionPane.showMessageDialog(this.getMainWindow(), - "No test selected!", WINDOW_TITLE, - JOptionPane.ERROR_MESSAGE); + this.dialogs.showAboutDialog(); } - private String copyFromBufferedReaderToString(BufferedReader stdInput) throws IOException - { - String line; - StringBuffer output = new StringBuffer(); - while ((line = stdInput.readLine()) != null) - { - output.append(line + "\n"); - } - return output.toString(); - } - - /** - * Read standard output from the command and put it to String - * @param process - * @return - * @throws IOException - */ - private String fetchStandardOutput(Process process) throws IOException - { - BufferedReader stdInput = new BufferedReader(new InputStreamReader(process.getInputStream())); From andrew at icedtea.classpath.org Mon Oct 4 08:58:42 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Mon, 04 Oct 2010 15:58:42 +0000 Subject: /hg/release/icedtea6-1.7: Support systems where the sched_getcpu... Message-ID: changeset 02e3bf7ef716 in /hg/release/icedtea6-1.7 details: http://icedtea.classpath.org/hg/release/icedtea6-1.7?cmd=changeset;node=02e3bf7ef716 author: Andrew John Hughes date: Mon Oct 04 16:58:32 2010 +0100 Support systems where the sched_getcpu libc call is not present but the syscall is. 2010-09-17 Andrew John Hughes * Makefile.am: Add new patch. * NEWS: Updated. * patches/numa_on_early_glibc.patch, Fallback to making a syscall if sched_getcpu exists but the glibc used is too old to support it. diffstat: 4 files changed, 71 insertions(+), 14 deletions(-) ChangeLog | 11 ++++++++ Makefile.am | 3 +- NEWS | 25 ++++++++++---------- patches/numa_on_early_glibc.patch | 46 +++++++++++++++++++++++++++++++++++++ diffs (120 lines): diff -r 4c9da74e0a11 -r 02e3bf7ef716 ChangeLog --- a/ChangeLog Wed Sep 29 13:37:46 2010 -0700 +++ b/ChangeLog Mon Oct 04 16:58:32 2010 +0100 @@ -1,5 +1,14 @@ 2010-09-29 Deepak Bhole + + * Makefile.am: + Add new patch. + * NEWS: Updated. + * patches/numa_on_early_glibc.patch, + Fallback to making a syscall if sched_getcpu + exists but the glibc used is too old to support it. + 2010-09-29 Deepak Bhole - + Fixed PR519 (patch from dnietoc at gmail.com). * plugin/icedteanp/IcedTeaNPPlugin.cc: Have ITNP_NewStream return NPERR_GENERIC_ERROR instead of NPERR_NO_ERROR. diff -r 4c9da74e0a11 -r 02e3bf7ef716 Makefile.am --- a/Makefile.am Wed Sep 29 13:37:46 2010 -0700 +++ b/Makefile.am Mon Oct 04 16:58:32 2010 +0100 @@ -347,7 +347,8 @@ ICEDTEA_PATCHES = \ patches/fonts-gentoo.patch \ patches/fonts-rhel.patch \ patches/openjdk/6638712-wildcard_types.patch \ - patches/openjdk/6650759-missing_inference.patch + patches/openjdk/6650759-missing_inference.patch \ + patches/numa_on_early_glibc.patch if WITH_RHINO ICEDTEA_PATCHES += \ diff -r 4c9da74e0a11 -r 02e3bf7ef716 NEWS --- a/NEWS Wed Sep 29 13:37:46 2010 -0700 +++ b/NEWS Mon Oct 04 16:58:32 2010 +0100 @@ -1,21 +1,22 @@ New in release 1.7.5 (XXXX-XX-XX): New in release 1.7.5 (XXXX-XX-XX): * Fixes - - G244901: Skip test_gamma on hardened (PaX-enabled) kernels - - G266295: Provide font configuration for Gentoo. - - Provide font configuration for RHEL 6. + - G244901: Skip test_gamma on hardened (PaX-enabled) kernels + - G266295: Provide font configuration for Gentoo. + - Provide font configuration for RHEL 6. + - RH633510: OpenJDK should use NUMA even if glibc doesn't provide it * Backports - - S6539464, RH500077: Ensure java.lang.Math functions provide consistent results. - - S6951319: enable solaris builds using Sun Studio 12 update 1 (fixes PR398). - - S6638712: Inference with wildcard types causes selection of inapplicable method - - S6650759: Inference of formal type parameter (unused in formal parameters) is not performed + - S6539464, RH500077: Ensure java.lang.Math functions provide consistent results. + - S6951319: enable solaris builds using Sun Studio 12 update 1 (fixes PR398). + - S6638712: Inference with wildcard types causes selection of inapplicable method + - S6650759: Inference of formal type parameter (unused in formal parameters) is not performed * NetX - - Fix browser command in BasicService.showDocument(URL) - - Run programs that inherit main(String[]) in their main-class - - Work with JNLP files that use spec version 1.6 - - RH601281: Possible NullPointerException in splash screen code + - Fix browser command in BasicService.showDocument(URL) + - Run programs that inherit main(String[]) in their main-class + - Work with JNLP files that use spec version 1.6 + - RH601281: Possible NullPointerException in splash screen code * Plugin - - RH560193: Fix ziperror when applet jar contained another 0-byte jar + - RH560193: Fix ziperror when applet jar contained another 0-byte jar - PR519: 100% CPU usage when displaying applets in Webkit based browsers New in release 1.7.4 (2010-07-28): diff -r 4c9da74e0a11 -r 02e3bf7ef716 patches/numa_on_early_glibc.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/numa_on_early_glibc.patch Mon Oct 04 16:58:32 2010 +0100 @@ -0,0 +1,46 @@ +--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp 2010-09-14 15:30:59.000000000 +0100 ++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp 2010-09-14 17:45:54.000000000 +0100 +@@ -54,6 +54,10 @@ + # include + # include + ++#if __x86_64__ ++#include ++#endif ++ + #define MAX_PATH (2 * K) + + // for timer info max values which include all bits +@@ -2414,6 +2418,21 @@ + return end; + } + ++static int sched_getcpu_syscall(void) { ++ unsigned int cpu; ++ int retval = -1; ++ ++#if __x86_64__ ++ typedef long (*vgetcpu_t)(unsigned int *cpu, unsigned int *node, unsigned long *tcache); ++ vgetcpu_t vgetcpu = (vgetcpu_t)VSYSCALL_ADDR(__NR_vgetcpu); ++ retval = vgetcpu(&cpu, NULL, NULL); ++#elif __i386__ ++ retval = syscall(SYS_getcpu, &cpu, NULL, NULL); ++#endif ++ ++ return (retval == -1) ? retval : cpu; ++} ++ + extern "C" void numa_warn(int number, char *where, ...) { } + extern "C" void numa_error(char *where) { } + +@@ -2422,6 +2441,10 @@ + set_sched_getcpu(CAST_TO_FN_PTR(sched_getcpu_func_t, + dlsym(RTLD_DEFAULT, "sched_getcpu"))); + ++ // If it's not, try a direct syscall. ++ if (sched_getcpu() == -1) ++ set_sched_getcpu(CAST_TO_FN_PTR(sched_getcpu_func_t, (void*)&sched_getcpu_syscall)); ++ + if (sched_getcpu() != -1) { // Does it work? + void *handle = dlopen("libnuma.so.1", RTLD_LAZY); + if (handle != NULL) { From andrew at icedtea.classpath.org Mon Oct 4 09:01:32 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Mon, 04 Oct 2010 16:01:32 +0000 Subject: /hg/release/icedtea6-1.8: Support systems where the sched_getcpu... Message-ID: changeset 43a38e678ae4 in /hg/release/icedtea6-1.8 details: http://icedtea.classpath.org/hg/release/icedtea6-1.8?cmd=changeset;node=43a38e678ae4 author: Andrew John Hughes date: Mon Oct 04 17:01:26 2010 +0100 Support systems where the sched_getcpu libc call is not present but the syscall is. 2010-09-17 Andrew John Hughes * Makefile.am: Add new patch. * NEWS: Updated. * patches/numa_on_early_glibc.patch, Fallback to making a syscall if sched_getcpu exists but the glibc used is too old to support it. diffstat: 4 files changed, 61 insertions(+), 3 deletions(-) ChangeLog | 11 ++++++++ Makefile.am | 3 +- NEWS | 4 ++- patches/numa_on_early_glibc.patch | 46 +++++++++++++++++++++++++++++++++++++ diffs (100 lines): diff -r fb2449018b34 -r 43a38e678ae4 ChangeLog --- a/ChangeLog Wed Sep 29 13:37:46 2010 -0700 +++ b/ChangeLog Mon Oct 04 17:01:26 2010 +0100 @@ -1,5 +1,14 @@ 2010-09-29 Deepak Bhole + + * Makefile.am: + Add new patch. + * NEWS: Updated. + * patches/numa_on_early_glibc.patch, + Fallback to making a syscall if sched_getcpu + exists but the glibc used is too old to support it. + 2010-09-29 Deepak Bhole - + Fixed PR519 (patch from dnietoc at gmail.com). * plugin/icedteanp/IcedTeaNPPlugin.cc: Have ITNP_NewStream return NPERR_GENERIC_ERROR instead of NPERR_NO_ERROR. diff -r fb2449018b34 -r 43a38e678ae4 Makefile.am --- a/Makefile.am Wed Sep 29 13:37:46 2010 -0700 +++ b/Makefile.am Mon Oct 04 17:01:26 2010 +0100 @@ -334,7 +334,8 @@ ICEDTEA_PATCHES = \ patches/fonts-rhel.patch \ patches/icedtea-too-many-args.patch \ patches/openjdk/6638712-wildcard_types.patch \ - patches/openjdk/6650759-missing_inference.patch + patches/openjdk/6650759-missing_inference.patch \ + patches/numa_on_early_glibc.patch if WITH_RHINO ICEDTEA_PATCHES += \ diff -r fb2449018b34 -r 43a38e678ae4 NEWS --- a/NEWS Wed Sep 29 13:37:46 2010 -0700 +++ b/NEWS Mon Oct 04 17:01:26 2010 +0100 @@ -4,11 +4,13 @@ New in release 1.8.2 (XXXX-XX-XX): - G244901: Skip test_gamma on hardened (PaX-enabled) kernels - G266295: Provide font configuration for Gentoo. - Provide font configuration for RHEL 6. + - RH633510: OpenJDK should use NUMA even if glibc doesn't provide it +* Backports: - S6951319: enable solaris builds using Sun Studio 12 update 1 (fixes PR398) - S6539464, RH500077: Ensure java.lang.Math functions provide consistent results. - S6638712: Inference with wildcard types causes selection of inapplicable method - S6650759: Inference of formal type parameter (unused in formal parameters) is not performed -- NetX: +* NetX: - Fix browser command in BasicService.showDocument(URL) - Run programs that inherit main(String[]) in their main-class - Run JNLP files that use 1.6 as the spec version diff -r fb2449018b34 -r 43a38e678ae4 patches/numa_on_early_glibc.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/numa_on_early_glibc.patch Mon Oct 04 17:01:26 2010 +0100 @@ -0,0 +1,46 @@ +--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp 2010-09-14 15:30:59.000000000 +0100 ++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp 2010-09-14 17:45:54.000000000 +0100 +@@ -54,6 +54,10 @@ + # include + # include + ++#if __x86_64__ ++#include ++#endif ++ + #define MAX_PATH (2 * K) + + // for timer info max values which include all bits +@@ -2414,6 +2418,21 @@ + return end; + } + ++static int sched_getcpu_syscall(void) { ++ unsigned int cpu; ++ int retval = -1; ++ ++#if __x86_64__ ++ typedef long (*vgetcpu_t)(unsigned int *cpu, unsigned int *node, unsigned long *tcache); ++ vgetcpu_t vgetcpu = (vgetcpu_t)VSYSCALL_ADDR(__NR_vgetcpu); ++ retval = vgetcpu(&cpu, NULL, NULL); ++#elif __i386__ ++ retval = syscall(SYS_getcpu, &cpu, NULL, NULL); ++#endif ++ ++ return (retval == -1) ? retval : cpu; ++} ++ + extern "C" void numa_warn(int number, char *where, ...) { } + extern "C" void numa_error(char *where) { } + +@@ -2422,6 +2441,10 @@ + set_sched_getcpu(CAST_TO_FN_PTR(sched_getcpu_func_t, + dlsym(RTLD_DEFAULT, "sched_getcpu"))); + ++ // If it's not, try a direct syscall. ++ if (sched_getcpu() == -1) ++ set_sched_getcpu(CAST_TO_FN_PTR(sched_getcpu_func_t, (void*)&sched_getcpu_syscall)); ++ + if (sched_getcpu() != -1) { // Does it work? + void *handle = dlopen("libnuma.so.1", RTLD_LAZY); + if (handle != NULL) { From asu at redhat.com Mon Oct 4 09:07:32 2010 From: asu at redhat.com (Andrew Su) Date: Mon, 4 Oct 2010 12:07:32 -0400 (EDT) Subject: [RFC] [Plugin] Fixes 100% cpu load In-Reply-To: <1497761661.1158781286208444904.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <1921585727.1158801286208452272.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Hi, ----- "Deepak Bhole" wrote: > From: "Deepak Bhole" > To: "Andrew Su" > Cc: distro-pkg-dev at openjdk.java.net > Sent: Thursday, September 30, 2010 7:15:55 PM GMT -05:00 US/Canada Eastern > Subject: Re: [RFC] [Plugin] Fixes 100% cpu load > > * Deepak Bhole [2010-09-30 18:55]: > > * Andrew Su [2010-09-30 17:57]: > > > > > > ----- "Deepak Bhole" wrote: > > > > > > > From: "Deepak Bhole" > > > > To: "Andrew Su" > > > > Cc: distro-pkg-dev at openjdk.java.net > > > > Sent: Thursday, September 30, 2010 5:01:44 PM GMT -05:00 > US/Canada Eastern > > > > Subject: Re: [RFC] [Plugin] Fixes 100% cpu load --SNIP-- > > Doh! So close. Just remembered why it needs to add them to the back > of > the queue. It is so that priority messages can be processed while the > others wait. > > Easy fix though. We would just have to scan the queue to see if there > are any priority messages, and if so, move them to the front and > retry > processing. Using Deepak's suggestion works out well, since now we can avoid synchronization. How the message consumer used to work: 1. READ and REMOVE first message in queue. 2. Try and get a free worker to handle message. 2a. If no free worker, place message at back of queue, then repeat from step 1. 2b. If there is free worker, proceed. 3. Handle message. 4. Repeat from step 1. After patch: 1. Scan for priority message. 1a. If no priority message, READ first message in queue. 1b. If priority message found, READ the priority message at that index of queue. 2. Try and get a free worker to process the message. 2a. If there is no free worker, repeat from step 1 2b. If there is free worker, proceed. 3. Remove the message from which index we got it from. (This is okay, because the queue is not shrinking so the index will not change) 4. Handle message. 5. Repeat from step 1. Attached is the patch for keeping the messages in order. This fixes the issues I brought up about destroy messages taking up the threads by waiting for initialization to finish. > > Deepak > > > This does no solve the problem of the applets 'hanging around in a > > separate window' until destroy is processed, but I don't imagine > too > > many regular users see that case. And even if they do, the applet > is > > always guaranteed to be destroyed eventually, ensuring a consistent > > state. I was considering, since we are going through the messages, shouldn't we sort it into the following order: Priority, Destroy, Init, Other (are there other?). That way, we can have the message handler set it to inactive then not process the init we get later. > > > > Cheers, > > Deepak Cheers, --Andrew -------------- next part -------------- A non-text attachment was scrubbed... Name: 20101004_keep_message_order.patch Type: text/x-patch Size: 1720 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101004/6b0098f8/20101004_keep_message_order.patch From siemsen at ucar.edu Mon Oct 4 10:38:07 2010 From: siemsen at ucar.edu (NETS email archives) Date: Mon, 4 Oct 2010 11:38:07 -0600 Subject: icedtea can't run applet Message-ID: <46D22E82-62C8-4200-8EE5-9F99589CDA4D@ucar.edu> The error messages didn't make it into my original post. They are: formatURLPref: Couldn't get pref: app.releaseNotesURL file://usr/lib/iceweasel/xulrunner/components/nsURLFormatter.js formatURLPref: Couldn't get pref: app.vendorURL file://usr/lib/iceweasel/xulrunner/components/nsURLFormatter.js -- Pete > I'm sorry if this is the wrong list for this question. > > Iceweasel/Icedtea won't execute a Java applet that other browsers/plugins can. When I use iceweasel/icedtea to visit http://ndt.atla.net.internet2.edu, the applet is a grey box. Iceweasel reports the following errors: > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: Petes.png > Type: image/png > Size: 10865 bytes > Desc: not available > Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101001/f168afa0/attachment.png > -------------- next part -------------- > > > Can you suggest anything? > > -- Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101004/4cf4a1b0/attachment.html From omajid at redhat.com Mon Oct 4 11:11:19 2010 From: omajid at redhat.com (Omair Majid) Date: Mon, 04 Oct 2010 14:11:19 -0400 Subject: icedtea can't run applet In-Reply-To: <3D2D3755-9986-4728-BDB3-33396DF1F8E4@ucar.edu> References: <3D2D3755-9986-4728-BDB3-33396DF1F8E4@ucar.edu> Message-ID: <4CAA18C7.1050905@redhat.com> Hi, On 10/01/2010 06:53 PM, siemsen at ucar.edu wrote: > I'm sorry if this is the wrong list for this question. > > Iceweasel/Icedtea won't execute a Java applet that other > browsers/plugins can. When I use iceweasel/icedtea to visit > http://ndt.atla.net.internet2.edu, the applet is a grey box. > Iceweasel reports the following errors: > > The link that you provided doesnt work for me (is this an internal-only link?). I did a little bit of digging about app.releaseNotesURL and app.vedorURL and I dont think these errors are related to the plugin. Take a look at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=596428. On the other hand, the grey box is probably a bug. > > Can you suggest anything? > Can you please file a bug at http://icedtea.classpath.org/bugzilla/ ? It would be great if you could post the code (or at least provide the class files/jars) for the applet. Could you please run firefox as $ ICEDTEAPLUGIN_DEBUG=true firefox [substitute iceweasel as required] and attach the contents of ~/.icedteaplugin/java.stdout and ~/.icedteaplugin/java.stderr to the bug report? Feel free to edit these files to remove any sensitive information (like passwords). Thanks, Omair From omajid at redhat.com Mon Oct 4 12:17:43 2010 From: omajid at redhat.com (Omair Majid) Date: Mon, 04 Oct 2010 15:17:43 -0400 Subject: RFC: Netx - implement -Xclearcache command line option In-Reply-To: <20100930212727.GG31194@redhat.com> References: <4A720E40.7020406@redhat.com> <4CA4EE08.6000007@redhat.com> <20100930203203.GE31194@redhat.com> <4CA4F800.5000306@redhat.com> <20100930212727.GG31194@redhat.com> Message-ID: <4CAA2857.6020105@redhat.com> On 09/30/2010 05:27 PM, Deepak Bhole wrote: > * Omair Majid [2010-09-30 16:50]: >> On 09/30/2010 04:32 PM, Deepak Bhole wrote: >>> * Omair Majid [2010-09-30 16:10]: >>>> Hi, >>>> >>>> I posted this patch way back in 2009, but it looks like it got lost/ignored. >>>> >> >> Ok, turns out it was my fault: just noticed http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2009-August/006666.html. >> Somehow it slipped off my radar. >> > > Doh. Glad it was re-visited. I doubt the issue will be encountered, but > we might as well fix it instead of waiting for a bug report. > >>>> On 07/30/2009 05:18 PM, Omair Majid wrote: >>>>> The attached patch adds the option -Xclearcache to Netx. >>>>> >>>> >>>> Which (and I neglected to explain this last time) makes javaws clean >>>> out its cache by deleting the contents of ~/.netx/cache/ >>>> >>> >>> Hmm, what happens if I have another netx app running and javaws is called >>> with -Xclearcache? AFAIK the code has no provisioning to detect if a >>> cache file has been deleted, and to re-download it... does it? >>> >> >> As far as I can tell, very bad things (not eating babies kind of >> bad, but still...). Depending on the exact timing either the VM will >> crash or a java Exception might be thrown. If the JVM has opened the >> (missing) jar earlier and and wants to open it again to load >> additional classes the VM will most probably crash. Otherwise javaws >> simply wont be able to find the needed jar and will fail to start. >> >> I suppose I could make some sort of global application lock to stop >> any other javaws instances from starting while -Xclearcache is >> running and to make sure -Xclearcache does not start if any other >> javaws applications are running. >> > > It would be hard to set up a locking system that can handle odd cases > like crashed application, multiple instances of same app., etc. > Yeah, you are right. I thought about it for a bit, and I dont see a simple way to make it work using locks. > Easiest way I think is to execute jps -l and see if there is more than > one instance of net.sourceforge.jnlp.runtime.Boot. If there is, refuse > to run with -Xclearcache. I am not as worried about the 'don't start > while -Xclearcache is running' case, as there is a far smaller window > where things can go wrong. Plus if they do, it will be right away (as > opposed to an already started app that has modified data, crashing). > That's a great idea! Unfortunately I dont think we can rely on jps. jps is part of the JDK as opposed to the JRE - we can not be sure that users have it on their machine. I tried looking into the sources for jps to find out how it works. The JVM creates /tmp/hsperfdata_$USER/$PID files which contain the information that jps can parse and display. The files are in a binary format so parsing it is not trivial (and the file format is not guaranteed to be final). I am going to dig around a bit to see if there is any other simple solution to this Thanks, Omair From bugzilla-daemon at icedtea.classpath.org Mon Oct 4 13:16:34 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 04 Oct 2010 20:16:34 +0000 Subject: [Bug 565] UIDefaults.getUI fails with jgoodies:looks 2.3.1 Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=565 ------- Comment #1 from omajid at redhat.com 2010-10-04 20:16 ------- Hi, Could you please describe (as specifically as possible) how to reproduce this error? Could you also post the version of IcedTea6 that you are using? I could not reproduce this problem. I tried the Web Start demo [1] at [2] (the third link under demos) which worked fine for me. I also tried out using the look and feel with the ProgressBarDemo [3] which also worked for me. [1] http://www.jgoodies.com/download/demos/looks/looksdemo.jnlp [2] http://www.jgoodies.com/freeware/looksdemo/index.html [3] http://download.oracle.com/javase/tutorial/uiswing/examples/components/ProgressBarDemoProject/src/components/ProgressBarDemo.java -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Mon Oct 4 13:34:28 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 04 Oct 2010 20:34:28 +0000 Subject: [Bug 565] UIDefaults.getUI fails with jgoodies:looks 2.3.1 Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=565 mm at michaelamerz.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mm at michaelamerz.com ------- Comment #2 from mm at michaelamerz.com 2010-10-04 20:34 ------- (In reply to comment #1) java version "1.6.0_18" OpenJDK Runtime Environment (IcedTea6 1.8.1) (fedora-42.b18.fc13-i386) OpenJDK Server VM (build 14.0-b16, mixed mode) We are running an applet with looks-2.3.1.jar embedded within the archive parameter of the 'applet' statement. Michaela > Hi, > > Could you please describe (as specifically as possible) how to reproduce this > error? Could you also post the version of IcedTea6 that you are using? > > I could not reproduce this problem. I tried the Web Start demo [1] at [2] (the > third link under demos) which worked fine for me. I also tried out using the > look and feel with the ProgressBarDemo [3] which also worked for me. > > [1] http://www.jgoodies.com/download/demos/looks/looksdemo.jnlp > [2] http://www.jgoodies.com/freeware/looksdemo/index.html > [3] > http://download.oracle.com/javase/tutorial/uiswing/examples/components/ProgressBarDemoProject/src/components/ProgressBarDemo.java > -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From omajid at icedtea.classpath.org Mon Oct 4 15:13:21 2010 From: omajid at icedtea.classpath.org (omajid at icedtea.classpath.org) Date: Mon, 04 Oct 2010 22:13:21 +0000 Subject: /hg/icedtea6: PR554: System.err writes content two times Message-ID: changeset f41b0a7fbd70 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=f41b0a7fbd70 author: Omair Majid date: Mon Oct 04 18:13:02 2010 -0400 PR554: System.err writes content two times 2010-10-04 Paul Ebermann Omair Majid Fixes PR554. * plugin/icedteanp/java/sun/applet/PluginMain.java (write): Remove method. diffstat: 3 files changed, 8 insertions(+), 8 deletions(-) ChangeLog | 7 +++++++ NEWS | 1 + plugin/icedteanp/java/sun/applet/PluginMain.java | 8 -------- diffs (43 lines): diff -r 145255946142 -r f41b0a7fbd70 ChangeLog --- a/ChangeLog Mon Oct 04 11:13:32 2010 -0400 +++ b/ChangeLog Mon Oct 04 18:13:02 2010 -0400 @@ -1,3 +1,10 @@ 2010-10-04 Omair Majid + Omair Majid + + Fixes PR554. + * plugin/icedteanp/java/sun/applet/PluginMain.java + (write): Remove method. + 2010-10-04 Omair Majid * /netx/net/sourceforge/jnlp/PluginBridge.java diff -r 145255946142 -r f41b0a7fbd70 NEWS --- a/NEWS Mon Oct 04 11:13:32 2010 -0400 +++ b/NEWS Mon Oct 04 18:13:02 2010 -0400 @@ -19,6 +19,7 @@ New in release 1.10 (2010-XX-XX): * Netx - A new man page for javaws. * Plugin + - PR554: System.err writes content two times - PR556: Applet initialization code is prone to race conditions - PR557: Applet opens in a separate window if tab is closed when the applet loads - PR519: 100% CPU usage when displaying applets in Webkit based browsers diff -r 145255946142 -r f41b0a7fbd70 plugin/icedteanp/java/sun/applet/PluginMain.java --- a/plugin/icedteanp/java/sun/applet/PluginMain.java Mon Oct 04 11:13:32 2010 -0400 +++ b/plugin/icedteanp/java/sun/applet/PluginMain.java Mon Oct 04 18:13:02 2010 -0400 @@ -314,14 +314,6 @@ public class PluginMain if (!redirectStreams) super.write(b); } - - @Override - public void write(byte[] b) throws IOException { - logFile.write(b); - - if (!redirectStreams) - super.write(b); - } } } From andrew at icedtea.classpath.org Mon Oct 4 15:47:59 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Mon, 04 Oct 2010 22:47:59 +0000 Subject: /hg/release/icedtea6-1.9: Support systems where the sched_getcpu... Message-ID: changeset f1c14c74edd7 in /hg/release/icedtea6-1.9 details: http://icedtea.classpath.org/hg/release/icedtea6-1.9?cmd=changeset;node=f1c14c74edd7 author: Andrew John Hughes date: Mon Oct 04 23:47:52 2010 +0100 Support systems where the sched_getcpu libc call is not present but the syscall is. 2010-09-17 Andrew John Hughes * Makefile.am: Add new patch. * NEWS: Updated. * patches/numa_on_early_glibc.patch, Fallback to making a syscall if sched_getcpu exists but the glibc used is too old to support it. diffstat: 4 files changed, 63 insertions(+), 6 deletions(-) ChangeLog | 11 ++++++++ Makefile.am | 3 +- NEWS | 9 ++++--- patches/numa_on_early_glibc.patch | 46 +++++++++++++++++++++++++++++++++++++ diffs (102 lines): diff -r 4b6985a218f7 -r f1c14c74edd7 ChangeLog --- a/ChangeLog Wed Sep 29 13:37:46 2010 -0700 +++ b/ChangeLog Mon Oct 04 23:47:52 2010 +0100 @@ -1,5 +1,14 @@ 2010-09-29 Deepak Bhole + + * Makefile.am: + Add new patch. + * NEWS: Updated. + * patches/numa_on_early_glibc.patch, + Fallback to making a syscall if sched_getcpu + exists but the glibc used is too old to support it. + 2010-09-29 Deepak Bhole - + Fixed PR519 (patch from dnietoc at gmail.com). * plugin/icedteanp/IcedTeaNPPlugin.cc: Have ITNP_NewStream return NPERR_GENERIC_ERROR instead of NPERR_NO_ERROR. diff -r 4b6985a218f7 -r f1c14c74edd7 Makefile.am --- a/Makefile.am Wed Sep 29 13:37:46 2010 -0700 +++ b/Makefile.am Mon Oct 04 23:47:52 2010 +0100 @@ -289,7 +289,8 @@ ICEDTEA_PATCHES = \ patches/openjdk/6510892-httpserver_test.patch \ patches/icedtea-shark-build.patch \ patches/openjdk/6638712-wildcard_types.patch \ - patches/openjdk/6650759-missing_inference.patch + patches/openjdk/6650759-missing_inference.patch \ + patches/numa_on_early_glibc.patch if !WITH_ALT_HSBUILD diff -r 4b6985a218f7 -r f1c14c74edd7 NEWS --- a/NEWS Wed Sep 29 13:37:46 2010 -0700 +++ b/NEWS Mon Oct 04 23:47:52 2010 +0100 @@ -13,11 +13,12 @@ New in release 1.9.1 (2010-XX-XX): * Backports - S6638712: Inference with wildcard types causes selection of inapplicable method - S6650759: Inference of formal type parameter (unused in formal parameters) is not performed +* Fixes + - Fix build failure on S390 + - RH633510: OpenJDK should use NUMA even if glibc doesn't provide it * NetX - - New man page for javaws -* Fixes - - Fix build failure on S390 - * Plugin + - New man page for javaws +* Plugin - PR519: 100% CPU usage when displaying applets in Webkit based browsers New in release 1.9 (2010-09-07): diff -r 4b6985a218f7 -r f1c14c74edd7 patches/numa_on_early_glibc.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/numa_on_early_glibc.patch Mon Oct 04 23:47:52 2010 +0100 @@ -0,0 +1,46 @@ +--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp 2010-09-14 15:30:59.000000000 +0100 ++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp 2010-09-14 17:45:54.000000000 +0100 +@@ -54,6 +54,10 @@ + # include + # include + ++#if __x86_64__ ++#include ++#endif ++ + #define MAX_PATH (2 * K) + + // for timer info max values which include all bits +@@ -2414,6 +2418,21 @@ + return end; + } + ++static int sched_getcpu_syscall(void) { ++ unsigned int cpu; ++ int retval = -1; ++ ++#if __x86_64__ ++ typedef long (*vgetcpu_t)(unsigned int *cpu, unsigned int *node, unsigned long *tcache); ++ vgetcpu_t vgetcpu = (vgetcpu_t)VSYSCALL_ADDR(__NR_vgetcpu); ++ retval = vgetcpu(&cpu, NULL, NULL); ++#elif __i386__ ++ retval = syscall(SYS_getcpu, &cpu, NULL, NULL); ++#endif ++ ++ return (retval == -1) ? retval : cpu; ++} ++ + extern "C" void numa_warn(int number, char *where, ...) { } + extern "C" void numa_error(char *where) { } + +@@ -2422,6 +2441,10 @@ + set_sched_getcpu(CAST_TO_FN_PTR(sched_getcpu_func_t, + dlsym(RTLD_DEFAULT, "sched_getcpu"))); + ++ // If it's not, try a direct syscall. ++ if (sched_getcpu() == -1) ++ set_sched_getcpu(CAST_TO_FN_PTR(sched_getcpu_func_t, (void*)&sched_getcpu_syscall)); ++ + if (sched_getcpu() != -1) { // Does it work? + void *handle = dlopen("libnuma.so.1", RTLD_LAZY); + if (handle != NULL) { From bugzilla-daemon at icedtea.classpath.org Tue Oct 5 07:58:54 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 05 Oct 2010 14:58:54 +0000 Subject: [Bug 87] Icedtea 1.7.0 and SwingWorker problem Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=87 ------- Comment #11 from omajid at redhat.com 2010-10-05 14:58 ------- I tried replacing our custom patch with the upstream one: ProgressBarDemo still works without any errors. I have backported the patch to openjdk6. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From omajid at redhat.com Tue Oct 5 11:45:30 2010 From: omajid at redhat.com (Omair Majid) Date: Tue, 05 Oct 2010 14:45:30 -0400 Subject: RFC: Netx - implement -Xclearcache command line option In-Reply-To: <4CAA2857.6020105@redhat.com> References: <4A720E40.7020406@redhat.com> <4CA4EE08.6000007@redhat.com> <20100930203203.GE31194@redhat.com> <4CA4F800.5000306@redhat.com> <20100930212727.GG31194@redhat.com> <4CAA2857.6020105@redhat.com> Message-ID: <4CAB724A.7010202@redhat.com> On 10/04/2010 03:17 PM, Omair Majid wrote: > On 09/30/2010 05:27 PM, Deepak Bhole wrote: >> * Omair Majid [2010-09-30 16:50]: >>> On 09/30/2010 04:32 PM, Deepak Bhole wrote: >>>> * Omair Majid [2010-09-30 16:10]: >>>>> Hi, >>>>> >>>>> I posted this patch way back in 2009, but it looks like it got >>>>> lost/ignored. >>>>> >>> >>> Ok, turns out it was my fault: just noticed >>> http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2009-August/006666.html. >>> >>> Somehow it slipped off my radar. >>> >> >> Doh. Glad it was re-visited. I doubt the issue will be encountered, but >> we might as well fix it instead of waiting for a bug report. >> >>>>> On 07/30/2009 05:18 PM, Omair Majid wrote: >>>>>> The attached patch adds the option -Xclearcache to Netx. >>>>>> >>>>> >>>>> Which (and I neglected to explain this last time) makes javaws clean >>>>> out its cache by deleting the contents of ~/.netx/cache/ >>>>> >>>> >>>> Hmm, what happens if I have another netx app running and javaws is >>>> called >>>> with -Xclearcache? AFAIK the code has no provisioning to detect if a >>>> cache file has been deleted, and to re-download it... does it? >>>> >>> >>> As far as I can tell, very bad things (not eating babies kind of >>> bad, but still...). Depending on the exact timing either the VM will >>> crash or a java Exception might be thrown. If the JVM has opened the >>> (missing) jar earlier and and wants to open it again to load >>> additional classes the VM will most probably crash. Otherwise javaws >>> simply wont be able to find the needed jar and will fail to start. >>> >>> I suppose I could make some sort of global application lock to stop >>> any other javaws instances from starting while -Xclearcache is >>> running and to make sure -Xclearcache does not start if any other >>> javaws applications are running. >>> >> >> It would be hard to set up a locking system that can handle odd cases >> like crashed application, multiple instances of same app., etc. >> > > Yeah, you are right. I thought about it for a bit, and I dont see a > simple way to make it work using locks. > >> Easiest way I think is to execute jps -l and see if there is more than >> one instance of net.sourceforge.jnlp.runtime.Boot. If there is, refuse >> to run with -Xclearcache. I am not as worried about the 'don't start >> while -Xclearcache is running' case, as there is a far smaller window >> where things can go wrong. Plus if they do, it will be right away (as >> opposed to an already started app that has modified data, crashing). >> > > That's a great idea! Unfortunately I dont think we can rely on jps. jps > is part of the JDK as opposed to the JRE - we can not be sure that users > have it on their machine. I tried looking into the sources for jps to > find out how it works. The JVM creates /tmp/hsperfdata_$USER/$PID files > which contain the information that jps can parse and display. The files > are in a binary format so parsing it is not trivial (and the file format > is not guaranteed to be final). I am going to dig around a bit to see if > there is any other simple solution to this > I am attaching the updated patch. This one uses an alternate implementation based on file locks (exclusive and shared). A normal javaws process acquires a shared lock on /tmp/$USER/netx/instance during startup (when an instance of Launcher is created), and releases the lock when the JVM shutsdown. Multiple javaws processes can share the lock and run simultaneously. The javaws process that is trying to clear the cache checks for the file and tries to acquire an exclusive lock. If it succeeds, it goes ahead and clears the cache; otherwise it prints out an error to the user and exits. Thoughts? Cheers, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea6-jnlp-clearcache-02.patch Type: text/x-patch Size: 12386 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101005/87a88122/icedtea6-jnlp-clearcache-02.patch From dbhole at redhat.com Tue Oct 5 12:32:27 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Tue, 5 Oct 2010 15:32:27 -0400 Subject: RFC: Netx - implement -Xclearcache command line option In-Reply-To: <4CAB724A.7010202@redhat.com> References: <4A720E40.7020406@redhat.com> <4CA4EE08.6000007@redhat.com> <20100930203203.GE31194@redhat.com> <4CA4F800.5000306@redhat.com> <20100930212727.GG31194@redhat.com> <4CAA2857.6020105@redhat.com> <4CAB724A.7010202@redhat.com> Message-ID: <20101005193226.GA6063@redhat.com> * Omair Majid [2010-10-05 14:45]: > On 10/04/2010 03:17 PM, Omair Majid wrote: > >On 09/30/2010 05:27 PM, Deepak Bhole wrote: > >>* Omair Majid [2010-09-30 16:50]: > >>>On 09/30/2010 04:32 PM, Deepak Bhole wrote: > >>>>* Omair Majid [2010-09-30 16:10]: > >>>>>Hi, > >>>>> > >>>>>I posted this patch way back in 2009, but it looks like it got > >>>>>lost/ignored. > >>>>> > >>> > >>>Ok, turns out it was my fault: just noticed > >>>http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2009-August/006666.html. > >>> > >>>Somehow it slipped off my radar. > >>> > >> > >>Doh. Glad it was re-visited. I doubt the issue will be encountered, but > >>we might as well fix it instead of waiting for a bug report. > >> > >>>>>On 07/30/2009 05:18 PM, Omair Majid wrote: > >>>>>>The attached patch adds the option -Xclearcache to Netx. > >>>>>> > >>>>> > >>>>>Which (and I neglected to explain this last time) makes javaws clean > >>>>>out its cache by deleting the contents of ~/.netx/cache/ > >>>>> > >>>> > >>>>Hmm, what happens if I have another netx app running and javaws is > >>>>called > >>>>with -Xclearcache? AFAIK the code has no provisioning to detect if a > >>>>cache file has been deleted, and to re-download it... does it? > >>>> > >>> > >>>As far as I can tell, very bad things (not eating babies kind of > >>>bad, but still...). Depending on the exact timing either the VM will > >>>crash or a java Exception might be thrown. If the JVM has opened the > >>>(missing) jar earlier and and wants to open it again to load > >>>additional classes the VM will most probably crash. Otherwise javaws > >>>simply wont be able to find the needed jar and will fail to start. > >>> > >>>I suppose I could make some sort of global application lock to stop > >>>any other javaws instances from starting while -Xclearcache is > >>>running and to make sure -Xclearcache does not start if any other > >>>javaws applications are running. > >>> > >> > >>It would be hard to set up a locking system that can handle odd cases > >>like crashed application, multiple instances of same app., etc. > >> > > > >Yeah, you are right. I thought about it for a bit, and I dont see a > >simple way to make it work using locks. > > > >>Easiest way I think is to execute jps -l and see if there is more than > >>one instance of net.sourceforge.jnlp.runtime.Boot. If there is, refuse > >>to run with -Xclearcache. I am not as worried about the 'don't start > >>while -Xclearcache is running' case, as there is a far smaller window > >>where things can go wrong. Plus if they do, it will be right away (as > >>opposed to an already started app that has modified data, crashing). > >> > > > >That's a great idea! Unfortunately I dont think we can rely on jps. jps > >is part of the JDK as opposed to the JRE - we can not be sure that users > >have it on their machine. I tried looking into the sources for jps to > >find out how it works. The JVM creates /tmp/hsperfdata_$USER/$PID files > >which contain the information that jps can parse and display. The files > >are in a binary format so parsing it is not trivial (and the file format > >is not guaranteed to be final). I am going to dig around a bit to see if > >there is any other simple solution to this > > > > I am attaching the updated patch. This one uses an alternate > implementation based on file locks (exclusive and shared). A normal > javaws process acquires a shared lock on /tmp/$USER/netx/instance > during startup (when an instance of Launcher is created), and > releases the lock when the JVM shutsdown. Multiple javaws processes > can share the lock and run simultaneously. > > The javaws process that is trying to clear the cache checks for the > file and tries to acquire an exclusive lock. If it succeeds, it goes > ahead and clears the cache; otherwise it prints out an error to the > user and exits. > > Thoughts? > Just one minor thing... for the plugin, we use /tmp/icedteaplugin-$user for data storage. For the above, can you please change it to /tmp/netx-$user for consistency? Rest looks good! Assuming you have tested this, please go ahead and apply to HEAD and all active branches. Cheers, Deepak > Cheers, > Omair > diff -r f41b0a7fbd70 netx/net/sourceforge/jnlp/Launcher.java > --- a/netx/net/sourceforge/jnlp/Launcher.java Mon Oct 04 18:13:02 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/Launcher.java Tue Oct 05 14:30:05 2010 -0400 > @@ -20,12 +20,17 @@ > import java.applet.Applet; > import java.awt.Container; > import java.io.File; > +import java.io.FileInputStream; > +import java.io.FileOutputStream; > +import java.io.IOException; > import java.lang.management.ManagementFactory; > import java.lang.management.ThreadMXBean; > import java.lang.reflect.Method; > import java.net.InetAddress; > import java.net.URL; > import java.net.UnknownHostException; > +import java.nio.channels.FileChannel; > +import java.nio.channels.FileLock; > import java.util.LinkedList; > import java.util.List; > import java.util.jar.JarFile; > @@ -78,6 +83,8 @@ > /** If the application should call System.exit on fatal errors */ > private boolean exitOnFailure = true; > > + private FileLock fileLock; > + > /** > * Create a launcher with the runtime's default update policy > * and launch handler. > @@ -127,6 +134,11 @@ > > this.handler = handler; > this.updatePolicy = policy; > + > + markJavawsRunning(); > + Runtime.getRuntime().addShutdownHook(new Thread() { > + public void run() { markJavawsStopped(); } > + }); > } > > /** > @@ -686,6 +698,70 @@ > return null; // chose to continue, or no handler > } > > + /** > + * Indicate that netx is running by creating the {@link JNLPRuntime#INSTANCE_FILE} and > + * acquiring a shared lock on it > + */ > + private void markJavawsRunning() { > + try { > + String message = "This file is used to check if netx is running"; > + > + File javawsRunningFile = new File(JNLPRuntime.INSTANCE_FILE); > + javawsRunningFile.getParentFile().mkdirs(); > + if (javawsRunningFile.createNewFile()) { > + FileOutputStream fos = new FileOutputStream(javawsRunningFile); > + try { > + fos.write(message.getBytes()); > + } finally { > + fos.close(); > + } > + } > + > + if (!javawsRunningFile.isFile()) { > + if (JNLPRuntime.isDebug()) { > + System.err.println("Unable to create instance file"); > + } > + fileLock = null; > + return; > + } > + > + FileInputStream is = new FileInputStream(javawsRunningFile); > + FileChannel channel = is.getChannel(); > + fileLock = channel.tryLock(0, Long.MAX_VALUE, true); > + if (fileLock != null && fileLock.isShared()) { > + if (JNLPRuntime.isDebug()) { > + System.out.println("Acquired shared lock on " + > + JNLPRuntime.INSTANCE_FILE + " to indicate javaws is running"); > + } > + } else { > + fileLock = null; > + } > + } catch (IOException e) { > + e.printStackTrace(); > + } > + > + } > + > + /** > + * Indicate that javaws is stopped by releasing the shared lock on > + * {@link JNLPRuntime#INSTANCE_FILE}. > + */ > + private void markJavawsStopped() { > + if (fileLock == null) { > + return; > + } > + try { > + FileChannel channel = fileLock.channel(); > + fileLock.release(); > + channel.close(); > + fileLock = null; > + if (JNLPRuntime.isDebug()) { > + System.out.println("Release shared lock on " + JNLPRuntime.INSTANCE_FILE); > + } > + } catch (IOException e) { > + e.printStackTrace(); > + } > + } > > > /** > diff -r f41b0a7fbd70 netx/net/sourceforge/jnlp/cache/CacheUtil.java > --- a/netx/net/sourceforge/jnlp/cache/CacheUtil.java Mon Oct 04 18:13:02 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/cache/CacheUtil.java Tue Oct 05 14:30:05 2010 -0400 > @@ -19,6 +19,7 @@ > > import java.io.*; > import java.net.*; > +import java.nio.channels.FileChannel; > import java.util.*; > import java.lang.reflect.*; > import java.security.*; > @@ -37,6 +38,10 @@ > */ > public class CacheUtil { > > + private static String R(String key) { > + return JNLPRuntime.getMessage(key); > + } > + > private static String R(String key, Object param) { > return JNLPRuntime.getMessage(key, new Object[] {param}); > } > @@ -129,6 +134,72 @@ > } > > /** > + * Clears the cache by deleting all the Netx cache files > + * > + * Note: Because of how our caching system works, deleting jars of another javaws > + * process is using them can be quite disasterous. Hence why Launcher creates lock files > + * and we check for those by calling {@link #okToClearCache()} > + */ > + public static void clearCache() { > + > + if (!okToClearCache()) { > + System.err.println(R("CCannotClearCache")); > + return; > + } > + > + File cacheDir = new File(JNLPRuntime.getBaseDir() + File.separator + "cache"); > + if (!(cacheDir.isDirectory())) { > + return; > + } > + > + if (JNLPRuntime.isDebug()) { > + System.err.println("Clearing cache directory: " + cacheDir); > + } > + try { > + FileUtils.recursiveDelete(cacheDir, JNLPRuntime.getBaseDir()); > + } catch (IOException e) { > + throw new RuntimeException(e); > + } > + } > + > + /** > + * Returns a boolean indicating if it ok to clear the netx application cache at this point > + * @return true if the cache can be cleared at this time without problems > + */ > + private static boolean okToClearCache() { > + File otherJavawsRunning = new File(JNLPRuntime.INSTANCE_FILE); > + try { > + if (otherJavawsRunning.isFile()) { > + FileOutputStream fis = new FileOutputStream(otherJavawsRunning); > + try { > + FileChannel channel = fis.getChannel(); > + if (channel.tryLock() == null) { > + if (JNLPRuntime.isDebug()) { > + System.out.println("Other instances; can not clear cache"); > + } > + return false; > + } > + > + if (JNLPRuntime.isDebug()) { > + System.out.println("No other instances; proceeding to clear cache"); > + } > + return true; > + > + } finally { > + fis.close(); > + } > + } else { > + if (JNLPRuntime.isDebug()) { > + System.out.println("No instance file; proceeding to clear cache"); > + } > + return true; > + } > + } catch (IOException e) { > + return false; > + } > + } > + > + /** > * Returns whether there is a version of the URL contents in the > * cache and it is up to date. This method may not return > * immediately. > diff -r f41b0a7fbd70 netx/net/sourceforge/jnlp/resources/Messages.properties > --- a/netx/net/sourceforge/jnlp/resources/Messages.properties Mon Oct 04 18:13:02 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Tue Oct 05 14:30:05 2010 -0400 > @@ -139,6 +139,7 @@ > BOViewer = Shows the trusted certificate viewer. > BOUmask = Sets the umask for files created by an application. > BXnofork = Do not create another JVM. > +BXclearcache= Clean the JNLP application cache. > BOHelp = Print this message and exit. > > # Cache > @@ -149,6 +150,8 @@ > CChooseCache=Choose a cache directory... > CChooseCacheInfo=Netx needs a location for storing cache files. > CChooseCacheDir=Cache directory > +CConfirmClearCache=Are you sure you want to clear the cache? This may running javaws applications to misbehave. > +CCannotClearCache=Can not clear cache at this time > > # Security > SFileReadAccess=The application has requested read access to {0}. Do you want to allow this action? > diff -r f41b0a7fbd70 netx/net/sourceforge/jnlp/runtime/Boot.java > --- a/netx/net/sourceforge/jnlp/runtime/Boot.java Mon Oct 04 18:13:02 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/Boot.java Tue Oct 05 14:30:05 2010 -0400 > @@ -40,6 +40,7 @@ > import net.sourceforge.jnlp.ParseException; > import net.sourceforge.jnlp.PropertyDesc; > import net.sourceforge.jnlp.ResourcesDesc; > +import net.sourceforge.jnlp.cache.CacheUtil; > import net.sourceforge.jnlp.cache.UpdatePolicy; > import net.sourceforge.jnlp.security.VariableX509TrustManager; > import net.sourceforge.jnlp.security.viewer.CertificateViewer; > @@ -114,6 +115,7 @@ > + " -strict "+R("BOStrict")+"\n" > + " -umask=value "+R("BOUmask")+"\n" > + " -Xnofork "+R("BXnofork")+"\n" > + + " -Xclearcache "+R("BXclearcache")+"\n" > + " -help "+R("BOHelp")+"\n"; > > private static final String doubleArgs = "-basedir -jnlp -arg -param -property -update"; > @@ -202,6 +204,17 @@ > JNLPRuntime.setSecurityEnabled(null == getOption("-nosecurity")); > JNLPRuntime.initialize(true); > > + /* > + * FIXME > + * This should have been done with the rest of the argument parsing > + * code. But we need to know what the cache and base directories are, > + * and baseDir is initialized here > + */ > + if (null != getOption("-Xclearcache")) { > + CacheUtil.clearCache(); > + return null; > + } > + > try { > new Launcher().launch(getFile()); > } > diff -r f41b0a7fbd70 netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Mon Oct 04 18:13:02 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Tue Oct 05 14:30:05 2010 -0400 > @@ -18,6 +18,7 @@ > package net.sourceforge.jnlp.runtime; > > import java.io.*; > +import java.nio.channels.FileLock; > import java.awt.*; > import java.text.*; > import java.util.*; > @@ -132,6 +133,12 @@ > public static final String LOCKS_DIR = TMP_DIR + File.separator + USER + File.separator > + "netx" + File.separator + "locks"; > > + /** this file is used to indicate if any other instances of netx are running > + * if this file can be locked (using a {@link FileLock} in exclusive mode, then other > + * netx instances are not running */ > + public static final String INSTANCE_FILE = TMP_DIR + File.separator + USER + File.separator > + + "netx" + File.separator + "instances"; > + > /** the java.home directory */ > public static final String JAVA_HOME_DIR = System.getProperty("java.home"); > > diff -r f41b0a7fbd70 netx/net/sourceforge/jnlp/util/FileUtils.java > --- a/netx/net/sourceforge/jnlp/util/FileUtils.java Mon Oct 04 18:13:02 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/util/FileUtils.java Tue Oct 05 14:30:05 2010 -0400 > @@ -17,6 +17,9 @@ > package net.sourceforge.jnlp.util; > > import java.io.File; > +import java.io.IOException; > + > +import net.sourceforge.jnlp.runtime.JNLPRuntime; > > /** > * This class contains a few file-related utility functions. > @@ -121,4 +124,36 @@ > return prefix + OMITTED + suffix; > } > > + /** > + * Recursively delete everything under a directory. Works on either files or > + * directories > + * > + * @param file the file object representing what to delete. Can be either a > + * file or a directory. > + * @param base the directory under which the file and its subdirectories must be located > + * @throws IOException on an io exception or if trying to delete something > + * outside the base > + */ > + public static void recursiveDelete(File file, File base) throws IOException { > + if (JNLPRuntime.isDebug()) { > + System.err.println("Deleting: " + file); > + } > + > + if (!(file.getCanonicalPath().startsWith(base.getCanonicalPath()))) { > + throw new IOException("Trying to delete a file outside Netx's basedir: " > + + file.getCanonicalPath()); > + } > + > + if (file.isDirectory()) { > + File[] children = file.listFiles(); > + for (int i = 0; i < children.length; i++) { > + recursiveDelete(children[i], base); > + } > + } > + if (!file.delete()) { > + throw new IOException("Unable to delete file: " + file); > + } > + > + } > + > } From omajid at redhat.com Tue Oct 5 12:42:23 2010 From: omajid at redhat.com (Omair Majid) Date: Tue, 05 Oct 2010 15:42:23 -0400 Subject: RFC: Netx - implement -Xclearcache command line option In-Reply-To: <20101005193226.GA6063@redhat.com> References: <4A720E40.7020406@redhat.com> <4CA4EE08.6000007@redhat.com> <20100930203203.GE31194@redhat.com> <4CA4F800.5000306@redhat.com> <20100930212727.GG31194@redhat.com> <4CAA2857.6020105@redhat.com> <4CAB724A.7010202@redhat.com> <20101005193226.GA6063@redhat.com> Message-ID: <4CAB7F9F.4020900@redhat.com> On 10/05/2010 03:32 PM, Deepak Bhole wrote: > * Omair Majid [2010-10-05 14:45]: >> On 10/04/2010 03:17 PM, Omair Majid wrote: >>> On 09/30/2010 05:27 PM, Deepak Bhole wrote: >>>> * Omair Majid [2010-09-30 16:50]: >>>>> On 09/30/2010 04:32 PM, Deepak Bhole wrote: >>>>>> * Omair Majid [2010-09-30 16:10]: >>>>>>> Hi, >>>>>>> >>>>>>> I posted this patch way back in 2009, but it looks like it got >>>>>>> lost/ignored. >>>>>>> >>>>> >>>>> Ok, turns out it was my fault: just noticed >>>>> http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2009-August/006666.html. >>>>> >>>>> Somehow it slipped off my radar. >>>>> >>>> >>>> Doh. Glad it was re-visited. I doubt the issue will be encountered, but >>>> we might as well fix it instead of waiting for a bug report. >>>> >>>>>>> On 07/30/2009 05:18 PM, Omair Majid wrote: >>>>>>>> The attached patch adds the option -Xclearcache to Netx. >>>>>>>> >>>>>>> >>>>>>> Which (and I neglected to explain this last time) makes javaws clean >>>>>>> out its cache by deleting the contents of ~/.netx/cache/ >>>>>>> >>>>>> >>>>>> Hmm, what happens if I have another netx app running and javaws is >>>>>> called >>>>>> with -Xclearcache? AFAIK the code has no provisioning to detect if a >>>>>> cache file has been deleted, and to re-download it... does it? >>>>>> >>>>> >>>>> As far as I can tell, very bad things (not eating babies kind of >>>>> bad, but still...). Depending on the exact timing either the VM will >>>>> crash or a java Exception might be thrown. If the JVM has opened the >>>>> (missing) jar earlier and and wants to open it again to load >>>>> additional classes the VM will most probably crash. Otherwise javaws >>>>> simply wont be able to find the needed jar and will fail to start. >>>>> >>>>> I suppose I could make some sort of global application lock to stop >>>>> any other javaws instances from starting while -Xclearcache is >>>>> running and to make sure -Xclearcache does not start if any other >>>>> javaws applications are running. >>>>> >>>> >>>> It would be hard to set up a locking system that can handle odd cases >>>> like crashed application, multiple instances of same app., etc. >>>> >>> >>> Yeah, you are right. I thought about it for a bit, and I dont see a >>> simple way to make it work using locks. >>> >>>> Easiest way I think is to execute jps -l and see if there is more than >>>> one instance of net.sourceforge.jnlp.runtime.Boot. If there is, refuse >>>> to run with -Xclearcache. I am not as worried about the 'don't start >>>> while -Xclearcache is running' case, as there is a far smaller window >>>> where things can go wrong. Plus if they do, it will be right away (as >>>> opposed to an already started app that has modified data, crashing). >>>> >>> >>> That's a great idea! Unfortunately I dont think we can rely on jps. jps >>> is part of the JDK as opposed to the JRE - we can not be sure that users >>> have it on their machine. I tried looking into the sources for jps to >>> find out how it works. The JVM creates /tmp/hsperfdata_$USER/$PID files >>> which contain the information that jps can parse and display. The files >>> are in a binary format so parsing it is not trivial (and the file format >>> is not guaranteed to be final). I am going to dig around a bit to see if >>> there is any other simple solution to this >>> >> >> I am attaching the updated patch. This one uses an alternate >> implementation based on file locks (exclusive and shared). A normal >> javaws process acquires a shared lock on /tmp/$USER/netx/instance >> during startup (when an instance of Launcher is created), and >> releases the lock when the JVM shutsdown. Multiple javaws processes >> can share the lock and run simultaneously. >> >> The javaws process that is trying to clear the cache checks for the >> file and tries to acquire an exclusive lock. If it succeeds, it goes >> ahead and clears the cache; otherwise it prints out an error to the >> user and exits. >> >> Thoughts? >> > > Just one minor thing... for the plugin, we use > /tmp/icedteaplugin-$user for data storage. For the above, can you please > change it to /tmp/netx-$user for consistency? > Sure. But netx is already using /tmp/$USER/netx/locks/ for creating single instance locks (most of the paths netx uses are be defined in JNLPRuntime - though there are a few entries missing [like ~/.netx/pcache and ~/.netx/cache]). Do you want me to fix that as well? > Rest looks good! Assuming you have tested this, please go ahead and > apply to HEAD and all active branches. > Thanks for the review! Cheers, Omair From dbhole at redhat.com Tue Oct 5 12:44:47 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Tue, 5 Oct 2010 15:44:47 -0400 Subject: RFC: Netx - implement -Xclearcache command line option In-Reply-To: <4CAB7F9F.4020900@redhat.com> References: <4A720E40.7020406@redhat.com> <4CA4EE08.6000007@redhat.com> <20100930203203.GE31194@redhat.com> <4CA4F800.5000306@redhat.com> <20100930212727.GG31194@redhat.com> <4CAA2857.6020105@redhat.com> <4CAB724A.7010202@redhat.com> <20101005193226.GA6063@redhat.com> <4CAB7F9F.4020900@redhat.com> Message-ID: <20101005194447.GB6063@redhat.com> * Omair Majid [2010-10-05 15:42]: > On 10/05/2010 03:32 PM, Deepak Bhole wrote: > >* Omair Majid [2010-10-05 14:45]: > >>On 10/04/2010 03:17 PM, Omair Majid wrote: > >>>On 09/30/2010 05:27 PM, Deepak Bhole wrote: > >>>>* Omair Majid [2010-09-30 16:50]: > >>>>>On 09/30/2010 04:32 PM, Deepak Bhole wrote: > >>>>>>* Omair Majid [2010-09-30 16:10]: > >>>>>>>Hi, > >>>>>>> > >>>>>>>I posted this patch way back in 2009, but it looks like it got > >>>>>>>lost/ignored. > >>>>>>> > >>>>> > >>>>>Ok, turns out it was my fault: just noticed > >>>>>http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2009-August/006666.html. > >>>>> > >>>>>Somehow it slipped off my radar. > >>>>> > >>>> > >>>>Doh. Glad it was re-visited. I doubt the issue will be encountered, but > >>>>we might as well fix it instead of waiting for a bug report. > >>>> > >>>>>>>On 07/30/2009 05:18 PM, Omair Majid wrote: > >>>>>>>>The attached patch adds the option -Xclearcache to Netx. > >>>>>>>> > >>>>>>> > >>>>>>>Which (and I neglected to explain this last time) makes javaws clean > >>>>>>>out its cache by deleting the contents of ~/.netx/cache/ > >>>>>>> > >>>>>> > >>>>>>Hmm, what happens if I have another netx app running and javaws is > >>>>>>called > >>>>>>with -Xclearcache? AFAIK the code has no provisioning to detect if a > >>>>>>cache file has been deleted, and to re-download it... does it? > >>>>>> > >>>>> > >>>>>As far as I can tell, very bad things (not eating babies kind of > >>>>>bad, but still...). Depending on the exact timing either the VM will > >>>>>crash or a java Exception might be thrown. If the JVM has opened the > >>>>>(missing) jar earlier and and wants to open it again to load > >>>>>additional classes the VM will most probably crash. Otherwise javaws > >>>>>simply wont be able to find the needed jar and will fail to start. > >>>>> > >>>>>I suppose I could make some sort of global application lock to stop > >>>>>any other javaws instances from starting while -Xclearcache is > >>>>>running and to make sure -Xclearcache does not start if any other > >>>>>javaws applications are running. > >>>>> > >>>> > >>>>It would be hard to set up a locking system that can handle odd cases > >>>>like crashed application, multiple instances of same app., etc. > >>>> > >>> > >>>Yeah, you are right. I thought about it for a bit, and I dont see a > >>>simple way to make it work using locks. > >>> > >>>>Easiest way I think is to execute jps -l and see if there is more than > >>>>one instance of net.sourceforge.jnlp.runtime.Boot. If there is, refuse > >>>>to run with -Xclearcache. I am not as worried about the 'don't start > >>>>while -Xclearcache is running' case, as there is a far smaller window > >>>>where things can go wrong. Plus if they do, it will be right away (as > >>>>opposed to an already started app that has modified data, crashing). > >>>> > >>> > >>>That's a great idea! Unfortunately I dont think we can rely on jps. jps > >>>is part of the JDK as opposed to the JRE - we can not be sure that users > >>>have it on their machine. I tried looking into the sources for jps to > >>>find out how it works. The JVM creates /tmp/hsperfdata_$USER/$PID files > >>>which contain the information that jps can parse and display. The files > >>>are in a binary format so parsing it is not trivial (and the file format > >>>is not guaranteed to be final). I am going to dig around a bit to see if > >>>there is any other simple solution to this > >>> > >> > >>I am attaching the updated patch. This one uses an alternate > >>implementation based on file locks (exclusive and shared). A normal > >>javaws process acquires a shared lock on /tmp/$USER/netx/instance > >>during startup (when an instance of Launcher is created), and > >>releases the lock when the JVM shutsdown. Multiple javaws processes > >>can share the lock and run simultaneously. > >> > >>The javaws process that is trying to clear the cache checks for the > >>file and tries to acquire an exclusive lock. If it succeeds, it goes > >>ahead and clears the cache; otherwise it prints out an error to the > >>user and exits. > >> > >>Thoughts? > >> > > > >Just one minor thing... for the plugin, we use > >/tmp/icedteaplugin-$user for data storage. For the above, can you please > >change it to /tmp/netx-$user for consistency? > > > > Sure. But netx is already using /tmp/$USER/netx/locks/ for creating > single instance locks (most of the paths netx uses are be defined in > JNLPRuntime - though there are a few entries missing [like > ~/.netx/pcache and ~/.netx/cache]). Do you want me to fix that as > well? > Ah okay nevermind then. I wasn't aware that the dir was already being used for something else. Keep it as it is then I'd say. At some point in the future we should consolidate both plugin and netx to use a single dir. But that is for another time. Cheers, Deepak > >Rest looks good! Assuming you have tested this, please go ahead and > >apply to HEAD and all active branches. > > > > Thanks for the review! > > Cheers, > Omair From ahughes at redhat.com Tue Oct 5 16:19:41 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Wed, 6 Oct 2010 00:19:41 +0100 Subject: RFC: Netx - implement -Xclearcache command line option In-Reply-To: <4CAB724A.7010202@redhat.com> References: <4A720E40.7020406@redhat.com> <4CA4EE08.6000007@redhat.com> <20100930203203.GE31194@redhat.com> <4CA4F800.5000306@redhat.com> <20100930212727.GG31194@redhat.com> <4CAA2857.6020105@redhat.com> <4CAB724A.7010202@redhat.com> Message-ID: <20101005231941.GF30285@rivendell.middle-earth.co.uk> On 14:45 Tue 05 Oct , Omair Majid wrote: > On 10/04/2010 03:17 PM, Omair Majid wrote: > > On 09/30/2010 05:27 PM, Deepak Bhole wrote: > >> * Omair Majid [2010-09-30 16:50]: > >>> On 09/30/2010 04:32 PM, Deepak Bhole wrote: > >>>> * Omair Majid [2010-09-30 16:10]: > >>>>> Hi, > >>>>> > >>>>> I posted this patch way back in 2009, but it looks like it got > >>>>> lost/ignored. > >>>>> > >>> > >>> Ok, turns out it was my fault: just noticed > >>> http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2009-August/006666.html. > >>> > >>> Somehow it slipped off my radar. > >>> > >> > >> Doh. Glad it was re-visited. I doubt the issue will be encountered, but > >> we might as well fix it instead of waiting for a bug report. > >> > >>>>> On 07/30/2009 05:18 PM, Omair Majid wrote: > >>>>>> The attached patch adds the option -Xclearcache to Netx. > >>>>>> > >>>>> > >>>>> Which (and I neglected to explain this last time) makes javaws clean > >>>>> out its cache by deleting the contents of ~/.netx/cache/ > >>>>> > >>>> > >>>> Hmm, what happens if I have another netx app running and javaws is > >>>> called > >>>> with -Xclearcache? AFAIK the code has no provisioning to detect if a > >>>> cache file has been deleted, and to re-download it... does it? > >>>> > >>> > >>> As far as I can tell, very bad things (not eating babies kind of > >>> bad, but still...). Depending on the exact timing either the VM will > >>> crash or a java Exception might be thrown. If the JVM has opened the > >>> (missing) jar earlier and and wants to open it again to load > >>> additional classes the VM will most probably crash. Otherwise javaws > >>> simply wont be able to find the needed jar and will fail to start. > >>> > >>> I suppose I could make some sort of global application lock to stop > >>> any other javaws instances from starting while -Xclearcache is > >>> running and to make sure -Xclearcache does not start if any other > >>> javaws applications are running. > >>> > >> > >> It would be hard to set up a locking system that can handle odd cases > >> like crashed application, multiple instances of same app., etc. > >> > > > > Yeah, you are right. I thought about it for a bit, and I dont see a > > simple way to make it work using locks. > > > >> Easiest way I think is to execute jps -l and see if there is more than > >> one instance of net.sourceforge.jnlp.runtime.Boot. If there is, refuse > >> to run with -Xclearcache. I am not as worried about the 'don't start > >> while -Xclearcache is running' case, as there is a far smaller window > >> where things can go wrong. Plus if they do, it will be right away (as > >> opposed to an already started app that has modified data, crashing). > >> > > > > That's a great idea! Unfortunately I dont think we can rely on jps. jps > > is part of the JDK as opposed to the JRE - we can not be sure that users > > have it on their machine. I tried looking into the sources for jps to > > find out how it works. The JVM creates /tmp/hsperfdata_$USER/$PID files > > which contain the information that jps can parse and display. The files > > are in a binary format so parsing it is not trivial (and the file format > > is not guaranteed to be final). I am going to dig around a bit to see if > > there is any other simple solution to this > > > > I am attaching the updated patch. This one uses an alternate > implementation based on file locks (exclusive and shared). A normal > javaws process acquires a shared lock on /tmp/$USER/netx/instance during > startup (when an instance of Launcher is created), and releases the lock > when the JVM shutsdown. Multiple javaws processes can share the lock and > run simultaneously. > > The javaws process that is trying to clear the cache checks for the file > and tries to acquire an exclusive lock. If it succeeds, it goes ahead > and clears the cache; otherwise it prints out an error to the user and > exits. > > Thoughts? > Sounds good to me. I was actually going to suggest this before Deepak weighed in with the jps option. Not knowing what jps was, I didn't no any pros or cons as to using it. Could you not just reuse LOCKS_DIR for this rather than introducing something new? Also your mail says 'instance' but the code says 'instances' :-) > + FileChannel channel = fileLock.channel(); > + fileLock.release(); > + channel.close(); could be just: fileLock.release(); fileLock.channel().close(); Why do we have a method called just 'R' in CacheUtil? Should we really be catching IOExceptions rather than allowing them to propogate? > Cheers, > Omair > diff -r f41b0a7fbd70 netx/net/sourceforge/jnlp/Launcher.java > --- a/netx/net/sourceforge/jnlp/Launcher.java Mon Oct 04 18:13:02 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/Launcher.java Tue Oct 05 14:30:05 2010 -0400 > @@ -20,12 +20,17 @@ > import java.applet.Applet; > import java.awt.Container; > import java.io.File; > +import java.io.FileInputStream; > +import java.io.FileOutputStream; > +import java.io.IOException; > import java.lang.management.ManagementFactory; > import java.lang.management.ThreadMXBean; > import java.lang.reflect.Method; > import java.net.InetAddress; > import java.net.URL; > import java.net.UnknownHostException; > +import java.nio.channels.FileChannel; > +import java.nio.channels.FileLock; > import java.util.LinkedList; > import java.util.List; > import java.util.jar.JarFile; > @@ -78,6 +83,8 @@ > /** If the application should call System.exit on fatal errors */ > private boolean exitOnFailure = true; > > + private FileLock fileLock; > + > /** > * Create a launcher with the runtime's default update policy > * and launch handler. > @@ -127,6 +134,11 @@ > > this.handler = handler; > this.updatePolicy = policy; > + > + markJavawsRunning(); > + Runtime.getRuntime().addShutdownHook(new Thread() { > + public void run() { markJavawsStopped(); } > + }); > } > > /** > @@ -686,6 +698,70 @@ > return null; // chose to continue, or no handler > } > > + /** > + * Indicate that netx is running by creating the {@link JNLPRuntime#INSTANCE_FILE} and > + * acquiring a shared lock on it > + */ > + private void markJavawsRunning() { > + try { > + String message = "This file is used to check if netx is running"; > + > + File javawsRunningFile = new File(JNLPRuntime.INSTANCE_FILE); > + javawsRunningFile.getParentFile().mkdirs(); > + if (javawsRunningFile.createNewFile()) { > + FileOutputStream fos = new FileOutputStream(javawsRunningFile); > + try { > + fos.write(message.getBytes()); > + } finally { > + fos.close(); > + } > + } > + > + if (!javawsRunningFile.isFile()) { > + if (JNLPRuntime.isDebug()) { > + System.err.println("Unable to create instance file"); > + } > + fileLock = null; > + return; > + } > + > + FileInputStream is = new FileInputStream(javawsRunningFile); > + FileChannel channel = is.getChannel(); > + fileLock = channel.tryLock(0, Long.MAX_VALUE, true); > + if (fileLock != null && fileLock.isShared()) { > + if (JNLPRuntime.isDebug()) { > + System.out.println("Acquired shared lock on " + > + JNLPRuntime.INSTANCE_FILE + " to indicate javaws is running"); > + } > + } else { > + fileLock = null; > + } > + } catch (IOException e) { > + e.printStackTrace(); > + } > + > + } > + > + /** > + * Indicate that javaws is stopped by releasing the shared lock on > + * {@link JNLPRuntime#INSTANCE_FILE}. > + */ > + private void markJavawsStopped() { > + if (fileLock == null) { > + return; > + } > + try { > + FileChannel channel = fileLock.channel(); > + fileLock.release(); > + channel.close(); > + fileLock = null; > + if (JNLPRuntime.isDebug()) { > + System.out.println("Release shared lock on " + JNLPRuntime.INSTANCE_FILE); > + } > + } catch (IOException e) { > + e.printStackTrace(); > + } > + } > > > /** > diff -r f41b0a7fbd70 netx/net/sourceforge/jnlp/cache/CacheUtil.java > --- a/netx/net/sourceforge/jnlp/cache/CacheUtil.java Mon Oct 04 18:13:02 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/cache/CacheUtil.java Tue Oct 05 14:30:05 2010 -0400 > @@ -19,6 +19,7 @@ > > import java.io.*; > import java.net.*; > +import java.nio.channels.FileChannel; > import java.util.*; > import java.lang.reflect.*; > import java.security.*; > @@ -37,6 +38,10 @@ > */ > public class CacheUtil { > > + private static String R(String key) { > + return JNLPRuntime.getMessage(key); > + } > + > private static String R(String key, Object param) { > return JNLPRuntime.getMessage(key, new Object[] {param}); > } > @@ -129,6 +134,72 @@ > } > > /** > + * Clears the cache by deleting all the Netx cache files > + * > + * Note: Because of how our caching system works, deleting jars of another javaws > + * process is using them can be quite disasterous. Hence why Launcher creates lock files > + * and we check for those by calling {@link #okToClearCache()} > + */ > + public static void clearCache() { > + > + if (!okToClearCache()) { > + System.err.println(R("CCannotClearCache")); > + return; > + } > + > + File cacheDir = new File(JNLPRuntime.getBaseDir() + File.separator + "cache"); > + if (!(cacheDir.isDirectory())) { > + return; > + } > + > + if (JNLPRuntime.isDebug()) { > + System.err.println("Clearing cache directory: " + cacheDir); > + } > + try { > + FileUtils.recursiveDelete(cacheDir, JNLPRuntime.getBaseDir()); > + } catch (IOException e) { > + throw new RuntimeException(e); > + } > + } > + > + /** > + * Returns a boolean indicating if it ok to clear the netx application cache at this point > + * @return true if the cache can be cleared at this time without problems > + */ > + private static boolean okToClearCache() { > + File otherJavawsRunning = new File(JNLPRuntime.INSTANCE_FILE); > + try { > + if (otherJavawsRunning.isFile()) { > + FileOutputStream fis = new FileOutputStream(otherJavawsRunning); > + try { > + FileChannel channel = fis.getChannel(); > + if (channel.tryLock() == null) { > + if (JNLPRuntime.isDebug()) { > + System.out.println("Other instances; can not clear cache"); > + } > + return false; > + } > + > + if (JNLPRuntime.isDebug()) { > + System.out.println("No other instances; proceeding to clear cache"); > + } > + return true; > + > + } finally { > + fis.close(); > + } > + } else { > + if (JNLPRuntime.isDebug()) { > + System.out.println("No instance file; proceeding to clear cache"); > + } > + return true; > + } > + } catch (IOException e) { > + return false; > + } > + } > + > + /** > * Returns whether there is a version of the URL contents in the > * cache and it is up to date. This method may not return > * immediately. > diff -r f41b0a7fbd70 netx/net/sourceforge/jnlp/resources/Messages.properties > --- a/netx/net/sourceforge/jnlp/resources/Messages.properties Mon Oct 04 18:13:02 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Tue Oct 05 14:30:05 2010 -0400 > @@ -139,6 +139,7 @@ > BOViewer = Shows the trusted certificate viewer. > BOUmask = Sets the umask for files created by an application. > BXnofork = Do not create another JVM. > +BXclearcache= Clean the JNLP application cache. > BOHelp = Print this message and exit. > > # Cache > @@ -149,6 +150,8 @@ > CChooseCache=Choose a cache directory... > CChooseCacheInfo=Netx needs a location for storing cache files. > CChooseCacheDir=Cache directory > +CConfirmClearCache=Are you sure you want to clear the cache? This may running javaws applications to misbehave. > +CCannotClearCache=Can not clear cache at this time > > # Security > SFileReadAccess=The application has requested read access to {0}. Do you want to allow this action? > diff -r f41b0a7fbd70 netx/net/sourceforge/jnlp/runtime/Boot.java > --- a/netx/net/sourceforge/jnlp/runtime/Boot.java Mon Oct 04 18:13:02 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/Boot.java Tue Oct 05 14:30:05 2010 -0400 > @@ -40,6 +40,7 @@ > import net.sourceforge.jnlp.ParseException; > import net.sourceforge.jnlp.PropertyDesc; > import net.sourceforge.jnlp.ResourcesDesc; > +import net.sourceforge.jnlp.cache.CacheUtil; > import net.sourceforge.jnlp.cache.UpdatePolicy; > import net.sourceforge.jnlp.security.VariableX509TrustManager; > import net.sourceforge.jnlp.security.viewer.CertificateViewer; > @@ -114,6 +115,7 @@ > + " -strict "+R("BOStrict")+"\n" > + " -umask=value "+R("BOUmask")+"\n" > + " -Xnofork "+R("BXnofork")+"\n" > + + " -Xclearcache "+R("BXclearcache")+"\n" > + " -help "+R("BOHelp")+"\n"; > > private static final String doubleArgs = "-basedir -jnlp -arg -param -property -update"; > @@ -202,6 +204,17 @@ > JNLPRuntime.setSecurityEnabled(null == getOption("-nosecurity")); > JNLPRuntime.initialize(true); > > + /* > + * FIXME > + * This should have been done with the rest of the argument parsing > + * code. But we need to know what the cache and base directories are, > + * and baseDir is initialized here > + */ > + if (null != getOption("-Xclearcache")) { > + CacheUtil.clearCache(); > + return null; > + } > + > try { > new Launcher().launch(getFile()); > } > diff -r f41b0a7fbd70 netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Mon Oct 04 18:13:02 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Tue Oct 05 14:30:05 2010 -0400 > @@ -18,6 +18,7 @@ > package net.sourceforge.jnlp.runtime; > > import java.io.*; > +import java.nio.channels.FileLock; > import java.awt.*; > import java.text.*; > import java.util.*; > @@ -132,6 +133,12 @@ > public static final String LOCKS_DIR = TMP_DIR + File.separator + USER + File.separator > + "netx" + File.separator + "locks"; > > + /** this file is used to indicate if any other instances of netx are running > + * if this file can be locked (using a {@link FileLock} in exclusive mode, then other > + * netx instances are not running */ > + public static final String INSTANCE_FILE = TMP_DIR + File.separator + USER + File.separator > + + "netx" + File.separator + "instances"; > + > /** the java.home directory */ > public static final String JAVA_HOME_DIR = System.getProperty("java.home"); > > diff -r f41b0a7fbd70 netx/net/sourceforge/jnlp/util/FileUtils.java > --- a/netx/net/sourceforge/jnlp/util/FileUtils.java Mon Oct 04 18:13:02 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/util/FileUtils.java Tue Oct 05 14:30:05 2010 -0400 > @@ -17,6 +17,9 @@ > package net.sourceforge.jnlp.util; > > import java.io.File; > +import java.io.IOException; > + > +import net.sourceforge.jnlp.runtime.JNLPRuntime; > > /** > * This class contains a few file-related utility functions. > @@ -121,4 +124,36 @@ > return prefix + OMITTED + suffix; > } > > + /** > + * Recursively delete everything under a directory. Works on either files or > + * directories > + * > + * @param file the file object representing what to delete. Can be either a > + * file or a directory. > + * @param base the directory under which the file and its subdirectories must be located > + * @throws IOException on an io exception or if trying to delete something > + * outside the base > + */ > + public static void recursiveDelete(File file, File base) throws IOException { > + if (JNLPRuntime.isDebug()) { > + System.err.println("Deleting: " + file); > + } > + > + if (!(file.getCanonicalPath().startsWith(base.getCanonicalPath()))) { > + throw new IOException("Trying to delete a file outside Netx's basedir: " > + + file.getCanonicalPath()); > + } > + > + if (file.isDirectory()) { > + File[] children = file.listFiles(); > + for (int i = 0; i < children.length; i++) { > + recursiveDelete(children[i], base); > + } > + } > + if (!file.delete()) { > + throw new IOException("Unable to delete file: " + file); > + } > + > + } > + > } -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From ahughes at redhat.com Tue Oct 5 16:23:02 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Wed, 6 Oct 2010 00:23:02 +0100 Subject: RFC: Netx - implement -Xclearcache command line option In-Reply-To: <20101005194447.GB6063@redhat.com> References: <4A720E40.7020406@redhat.com> <4CA4EE08.6000007@redhat.com> <20100930203203.GE31194@redhat.com> <4CA4F800.5000306@redhat.com> <20100930212727.GG31194@redhat.com> <4CAA2857.6020105@redhat.com> <4CAB724A.7010202@redhat.com> <20101005193226.GA6063@redhat.com> <4CAB7F9F.4020900@redhat.com> <20101005194447.GB6063@redhat.com> Message-ID: <20101005232302.GG30285@rivendell.middle-earth.co.uk> On 15:44 Tue 05 Oct , Deepak Bhole wrote: > * Omair Majid [2010-10-05 15:42]: > > On 10/05/2010 03:32 PM, Deepak Bhole wrote: > > >* Omair Majid [2010-10-05 14:45]: > > >>On 10/04/2010 03:17 PM, Omair Majid wrote: > > >>>On 09/30/2010 05:27 PM, Deepak Bhole wrote: > > >>>>* Omair Majid [2010-09-30 16:50]: > > >>>>>On 09/30/2010 04:32 PM, Deepak Bhole wrote: > > >>>>>>* Omair Majid [2010-09-30 16:10]: > > >>>>>>>Hi, > > >>>>>>> > > >>>>>>>I posted this patch way back in 2009, but it looks like it got > > >>>>>>>lost/ignored. > > >>>>>>> > > >>>>> > > >>>>>Ok, turns out it was my fault: just noticed > > >>>>>http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2009-August/006666.html. > > >>>>> > > >>>>>Somehow it slipped off my radar. > > >>>>> > > >>>> > > >>>>Doh. Glad it was re-visited. I doubt the issue will be encountered, but > > >>>>we might as well fix it instead of waiting for a bug report. > > >>>> > > >>>>>>>On 07/30/2009 05:18 PM, Omair Majid wrote: > > >>>>>>>>The attached patch adds the option -Xclearcache to Netx. > > >>>>>>>> > > >>>>>>> > > >>>>>>>Which (and I neglected to explain this last time) makes javaws clean > > >>>>>>>out its cache by deleting the contents of ~/.netx/cache/ > > >>>>>>> > > >>>>>> > > >>>>>>Hmm, what happens if I have another netx app running and javaws is > > >>>>>>called > > >>>>>>with -Xclearcache? AFAIK the code has no provisioning to detect if a > > >>>>>>cache file has been deleted, and to re-download it... does it? > > >>>>>> > > >>>>> > > >>>>>As far as I can tell, very bad things (not eating babies kind of > > >>>>>bad, but still...). Depending on the exact timing either the VM will > > >>>>>crash or a java Exception might be thrown. If the JVM has opened the > > >>>>>(missing) jar earlier and and wants to open it again to load > > >>>>>additional classes the VM will most probably crash. Otherwise javaws > > >>>>>simply wont be able to find the needed jar and will fail to start. > > >>>>> > > >>>>>I suppose I could make some sort of global application lock to stop > > >>>>>any other javaws instances from starting while -Xclearcache is > > >>>>>running and to make sure -Xclearcache does not start if any other > > >>>>>javaws applications are running. > > >>>>> > > >>>> > > >>>>It would be hard to set up a locking system that can handle odd cases > > >>>>like crashed application, multiple instances of same app., etc. > > >>>> > > >>> > > >>>Yeah, you are right. I thought about it for a bit, and I dont see a > > >>>simple way to make it work using locks. > > >>> > > >>>>Easiest way I think is to execute jps -l and see if there is more than > > >>>>one instance of net.sourceforge.jnlp.runtime.Boot. If there is, refuse > > >>>>to run with -Xclearcache. I am not as worried about the 'don't start > > >>>>while -Xclearcache is running' case, as there is a far smaller window > > >>>>where things can go wrong. Plus if they do, it will be right away (as > > >>>>opposed to an already started app that has modified data, crashing). > > >>>> > > >>> > > >>>That's a great idea! Unfortunately I dont think we can rely on jps. jps > > >>>is part of the JDK as opposed to the JRE - we can not be sure that users > > >>>have it on their machine. I tried looking into the sources for jps to > > >>>find out how it works. The JVM creates /tmp/hsperfdata_$USER/$PID files > > >>>which contain the information that jps can parse and display. The files > > >>>are in a binary format so parsing it is not trivial (and the file format > > >>>is not guaranteed to be final). I am going to dig around a bit to see if > > >>>there is any other simple solution to this > > >>> > > >> > > >>I am attaching the updated patch. This one uses an alternate > > >>implementation based on file locks (exclusive and shared). A normal > > >>javaws process acquires a shared lock on /tmp/$USER/netx/instance > > >>during startup (when an instance of Launcher is created), and > > >>releases the lock when the JVM shutsdown. Multiple javaws processes > > >>can share the lock and run simultaneously. > > >> > > >>The javaws process that is trying to clear the cache checks for the > > >>file and tries to acquire an exclusive lock. If it succeeds, it goes > > >>ahead and clears the cache; otherwise it prints out an error to the > > >>user and exits. > > >> > > >>Thoughts? > > >> > > > > > >Just one minor thing... for the plugin, we use > > >/tmp/icedteaplugin-$user for data storage. For the above, can you please > > >change it to /tmp/netx-$user for consistency? > > > > > > > Sure. But netx is already using /tmp/$USER/netx/locks/ for creating > > single instance locks (most of the paths netx uses are be defined in > > JNLPRuntime - though there are a few entries missing [like > > ~/.netx/pcache and ~/.netx/cache]). Do you want me to fix that as > > well? > > > > Ah okay nevermind then. I wasn't aware that the dir was already being > used for something else. Keep it as it is then I'd say. At some point in > the future we should consolidate both plugin and netx to use a single > dir. But that is for another time. > In which case, the plugin should be altered to use netx's system, as NetX can be built without the plugin but the opposite is not true. I also think /tmp/$USER/netx is much cleaner. > Cheers, > Deepak > > > >Rest looks good! Assuming you have tested this, please go ahead and > > >apply to HEAD and all active branches. > > > > > > > Thanks for the review! Please see my comments in the previous e-mail before pushing. > > > > Cheers, > > Omair -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From omajid at redhat.com Wed Oct 6 09:04:07 2010 From: omajid at redhat.com (Omair Majid) Date: Wed, 06 Oct 2010 12:04:07 -0400 Subject: RFC: Netx - implement -Xclearcache command line option In-Reply-To: <20101005231941.GF30285@rivendell.middle-earth.co.uk> References: <4A720E40.7020406@redhat.com> <4CA4EE08.6000007@redhat.com> <20100930203203.GE31194@redhat.com> <4CA4F800.5000306@redhat.com> <20100930212727.GG31194@redhat.com> <4CAA2857.6020105@redhat.com> <4CAB724A.7010202@redhat.com> <20101005231941.GF30285@rivendell.middle-earth.co.uk> Message-ID: <4CAC9DF7.4060801@redhat.com> On 10/05/2010 07:19 PM, Dr Andrew John Hughes wrote: > On 14:45 Tue 05 Oct , Omair Majid wrote: >> On 10/04/2010 03:17 PM, Omair Majid wrote: >>> On 09/30/2010 05:27 PM, Deepak Bhole wrote: >>>> * Omair Majid [2010-09-30 16:50]: >>>>> On 09/30/2010 04:32 PM, Deepak Bhole wrote: >>>>>> * Omair Majid [2010-09-30 16:10]: >>>>>>> Hi, >>>>>>> >>>>>>> I posted this patch way back in 2009, but it looks like it got >>>>>>> lost/ignored. >>>>>>> >>>>> >>>>> Ok, turns out it was my fault: just noticed >>>>> http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2009-August/006666.html. >>>>> >>>>> Somehow it slipped off my radar. >>>>> >>>> >>>> Doh. Glad it was re-visited. I doubt the issue will be encountered, but >>>> we might as well fix it instead of waiting for a bug report. >>>> >>>>>>> On 07/30/2009 05:18 PM, Omair Majid wrote: >>>>>>>> The attached patch adds the option -Xclearcache to Netx. >>>>>>>> >>>>>>> >>>>>>> Which (and I neglected to explain this last time) makes javaws clean >>>>>>> out its cache by deleting the contents of ~/.netx/cache/ >>>>>>> >>>>>> >>>>>> Hmm, what happens if I have another netx app running and javaws is >>>>>> called >>>>>> with -Xclearcache? AFAIK the code has no provisioning to detect if a >>>>>> cache file has been deleted, and to re-download it... does it? >>>>>> >>>>> >>>>> As far as I can tell, very bad things (not eating babies kind of >>>>> bad, but still...). Depending on the exact timing either the VM will >>>>> crash or a java Exception might be thrown. If the JVM has opened the >>>>> (missing) jar earlier and and wants to open it again to load >>>>> additional classes the VM will most probably crash. Otherwise javaws >>>>> simply wont be able to find the needed jar and will fail to start. >>>>> >>>>> I suppose I could make some sort of global application lock to stop >>>>> any other javaws instances from starting while -Xclearcache is >>>>> running and to make sure -Xclearcache does not start if any other >>>>> javaws applications are running. >>>>> >>>> >>>> It would be hard to set up a locking system that can handle odd cases >>>> like crashed application, multiple instances of same app., etc. >>>> >>> >>> Yeah, you are right. I thought about it for a bit, and I dont see a >>> simple way to make it work using locks. >>> >>>> Easiest way I think is to execute jps -l and see if there is more than >>>> one instance of net.sourceforge.jnlp.runtime.Boot. If there is, refuse >>>> to run with -Xclearcache. I am not as worried about the 'don't start >>>> while -Xclearcache is running' case, as there is a far smaller window >>>> where things can go wrong. Plus if they do, it will be right away (as >>>> opposed to an already started app that has modified data, crashing). >>>> >>> >>> That's a great idea! Unfortunately I dont think we can rely on jps. jps >>> is part of the JDK as opposed to the JRE - we can not be sure that users >>> have it on their machine. I tried looking into the sources for jps to >>> find out how it works. The JVM creates /tmp/hsperfdata_$USER/$PID files >>> which contain the information that jps can parse and display. The files >>> are in a binary format so parsing it is not trivial (and the file format >>> is not guaranteed to be final). I am going to dig around a bit to see if >>> there is any other simple solution to this >>> >> >> I am attaching the updated patch. This one uses an alternate >> implementation based on file locks (exclusive and shared). A normal >> javaws process acquires a shared lock on /tmp/$USER/netx/instance during >> startup (when an instance of Launcher is created), and releases the lock >> when the JVM shutsdown. Multiple javaws processes can share the lock and >> run simultaneously. >> >> The javaws process that is trying to clear the cache checks for the file >> and tries to acquire an exclusive lock. If it succeeds, it goes ahead >> and clears the cache; otherwise it prints out an error to the user and >> exits. >> >> Thoughts? >> > > Sounds good to me. I was actually going to suggest this before Deepak weighed > in with the jps option. Not knowing what jps was, I didn't no any pros or cons > as to using it. > Updated patch attached. Also fixes another problem - the previous patch was creating lock files for applets too :/. > Could you not just reuse LOCKS_DIR for this rather than introducing something > new? Ah, good point. Switched to $LOCKS_DIR/netx_running. > Also your mail says 'instance' but the code says 'instances' :-) I cant come up with a name I am happy with... something that indicates the purpose of those files clearly. NETX_RUNNING_FILE and $/LOCKS/netx_running is what I am using now. > >> + FileChannel channel = fileLock.channel(); >> + fileLock.release(); >> + channel.close(); > > could be just: > > fileLock.release(); > fileLock.channel().close(); > Nice catch. Fixed. > Why do we have a method called just 'R' in CacheUtil? > R is the translation function. It is supposed to localize strings. A number of classes in netx declare R, which is a shortcut to JNLPRuntime.getMessage(). > Should we really be catching IOExceptions rather than allowing them to propogate? > Catching IOExceptions is just ignoring the errors. So the question is do we want to ignore the errors and continue on or should we stop if we hit any errors. Since the lock file is meant to stop a race condition (between deleting jars and using them) which is not likely to happen, I think an error in lock file creation should be ignored. If for some reason a lock file can not be created, Netx should not abort running the application. If you dont think this makes sense, please let me know and I will change it. Thanks for the feedback! Cheers, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea6-jnlp-clearcache-04.patch Type: text/x-patch Size: 12747 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101006/541ba48e/icedtea6-jnlp-clearcache-04.patch From dbhole at redhat.com Wed Oct 6 09:34:01 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Wed, 6 Oct 2010 12:34:01 -0400 Subject: RFC: Netx - implement -Xclearcache command line option In-Reply-To: <20101005232302.GG30285@rivendell.middle-earth.co.uk> References: <4CA4EE08.6000007@redhat.com> <20100930203203.GE31194@redhat.com> <4CA4F800.5000306@redhat.com> <20100930212727.GG31194@redhat.com> <4CAA2857.6020105@redhat.com> <4CAB724A.7010202@redhat.com> <20101005193226.GA6063@redhat.com> <4CAB7F9F.4020900@redhat.com> <20101005194447.GB6063@redhat.com> <20101005232302.GG30285@rivendell.middle-earth.co.uk> Message-ID: <20101006163401.GH13200@redhat.com> * Dr Andrew John Hughes [2010-10-05 19:23]: > On 15:44 Tue 05 Oct , Deepak Bhole wrote: > > * Omair Majid [2010-10-05 15:42]: > > > On 10/05/2010 03:32 PM, Deepak Bhole wrote: > > > >* Omair Majid [2010-10-05 14:45]: > > > >>On 10/04/2010 03:17 PM, Omair Majid wrote: > > > >>>On 09/30/2010 05:27 PM, Deepak Bhole wrote: > > > >>>>* Omair Majid [2010-09-30 16:50]: > > > >>>>>On 09/30/2010 04:32 PM, Deepak Bhole wrote: > > > >>>>>>* Omair Majid [2010-09-30 16:10]: > > > >Just one minor thing... for the plugin, we use > > > >/tmp/icedteaplugin-$user for data storage. For the above, can you please > > > >change it to /tmp/netx-$user for consistency? > > > > > > > > > > Sure. But netx is already using /tmp/$USER/netx/locks/ for creating > > > single instance locks (most of the paths netx uses are be defined in > > > JNLPRuntime - though there are a few entries missing [like > > > ~/.netx/pcache and ~/.netx/cache]). Do you want me to fix that as > > > well? > > > > > > > Ah okay nevermind then. I wasn't aware that the dir was already being > > used for something else. Keep it as it is then I'd say. At some point in > > the future we should consolidate both plugin and netx to use a single > > dir. But that is for another time. > > > > In which case, the plugin should be altered to use netx's system, as NetX > can be built without the plugin but the opposite is not true. > > I also think /tmp/$USER/netx is much cleaner. > I prefer /tmp/-$USER because it appears to be a (certainly undocumented but) standard format. Orbit names it orbit-$USER, pulse names it pulse-$RANDOM, ssh names it ssh-$RANDOM, etc. Deepak > > Cheers, > > Deepak > > > > > >Rest looks good! Assuming you have tested this, please go ahead and > > > >apply to HEAD and all active branches. > > > > > > > > > > Thanks for the review! > > Please see my comments in the previous e-mail before pushing. > > > > > > > Cheers, > > > Omair > > -- > Andrew :) > > Free Java Software Engineer > Red Hat, Inc. (http://www.redhat.com) > > Support Free Java! > Contribute to GNU Classpath and the OpenJDK > http://www.gnu.org/software/classpath > http://openjdk.java.net > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From ahughes at redhat.com Wed Oct 6 11:40:22 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Wed, 6 Oct 2010 19:40:22 +0100 Subject: RFC: Netx - implement -Xclearcache command line option In-Reply-To: <4CAC9DF7.4060801@redhat.com> References: <4A720E40.7020406@redhat.com> <4CA4EE08.6000007@redhat.com> <20100930203203.GE31194@redhat.com> <4CA4F800.5000306@redhat.com> <20100930212727.GG31194@redhat.com> <4CAA2857.6020105@redhat.com> <4CAB724A.7010202@redhat.com> <20101005231941.GF30285@rivendell.middle-earth.co.uk> <4CAC9DF7.4060801@redhat.com> Message-ID: <20101006184022.GM21949@rivendell.middle-earth.co.uk> On 12:04 Wed 06 Oct , Omair Majid wrote: > On 10/05/2010 07:19 PM, Dr Andrew John Hughes wrote: > > On 14:45 Tue 05 Oct , Omair Majid wrote: > >> On 10/04/2010 03:17 PM, Omair Majid wrote: > >>> On 09/30/2010 05:27 PM, Deepak Bhole wrote: > >>>> * Omair Majid [2010-09-30 16:50]: > >>>>> On 09/30/2010 04:32 PM, Deepak Bhole wrote: > >>>>>> * Omair Majid [2010-09-30 16:10]: > >>>>>>> Hi, > >>>>>>> > >>>>>>> I posted this patch way back in 2009, but it looks like it got > >>>>>>> lost/ignored. > >>>>>>> > >>>>> > >>>>> Ok, turns out it was my fault: just noticed > >>>>> http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2009-August/006666.html. > >>>>> > >>>>> Somehow it slipped off my radar. > >>>>> > >>>> > >>>> Doh. Glad it was re-visited. I doubt the issue will be encountered, but > >>>> we might as well fix it instead of waiting for a bug report. > >>>> > >>>>>>> On 07/30/2009 05:18 PM, Omair Majid wrote: > >>>>>>>> The attached patch adds the option -Xclearcache to Netx. > >>>>>>>> > >>>>>>> > >>>>>>> Which (and I neglected to explain this last time) makes javaws clean > >>>>>>> out its cache by deleting the contents of ~/.netx/cache/ > >>>>>>> > >>>>>> > >>>>>> Hmm, what happens if I have another netx app running and javaws is > >>>>>> called > >>>>>> with -Xclearcache? AFAIK the code has no provisioning to detect if a > >>>>>> cache file has been deleted, and to re-download it... does it? > >>>>>> > >>>>> > >>>>> As far as I can tell, very bad things (not eating babies kind of > >>>>> bad, but still...). Depending on the exact timing either the VM will > >>>>> crash or a java Exception might be thrown. If the JVM has opened the > >>>>> (missing) jar earlier and and wants to open it again to load > >>>>> additional classes the VM will most probably crash. Otherwise javaws > >>>>> simply wont be able to find the needed jar and will fail to start. > >>>>> > >>>>> I suppose I could make some sort of global application lock to stop > >>>>> any other javaws instances from starting while -Xclearcache is > >>>>> running and to make sure -Xclearcache does not start if any other > >>>>> javaws applications are running. > >>>>> > >>>> > >>>> It would be hard to set up a locking system that can handle odd cases > >>>> like crashed application, multiple instances of same app., etc. > >>>> > >>> > >>> Yeah, you are right. I thought about it for a bit, and I dont see a > >>> simple way to make it work using locks. > >>> > >>>> Easiest way I think is to execute jps -l and see if there is more than > >>>> one instance of net.sourceforge.jnlp.runtime.Boot. If there is, refuse > >>>> to run with -Xclearcache. I am not as worried about the 'don't start > >>>> while -Xclearcache is running' case, as there is a far smaller window > >>>> where things can go wrong. Plus if they do, it will be right away (as > >>>> opposed to an already started app that has modified data, crashing). > >>>> > >>> > >>> That's a great idea! Unfortunately I dont think we can rely on jps. jps > >>> is part of the JDK as opposed to the JRE - we can not be sure that users > >>> have it on their machine. I tried looking into the sources for jps to > >>> find out how it works. The JVM creates /tmp/hsperfdata_$USER/$PID files > >>> which contain the information that jps can parse and display. The files > >>> are in a binary format so parsing it is not trivial (and the file format > >>> is not guaranteed to be final). I am going to dig around a bit to see if > >>> there is any other simple solution to this > >>> > >> > >> I am attaching the updated patch. This one uses an alternate > >> implementation based on file locks (exclusive and shared). A normal > >> javaws process acquires a shared lock on /tmp/$USER/netx/instance during > >> startup (when an instance of Launcher is created), and releases the lock > >> when the JVM shutsdown. Multiple javaws processes can share the lock and > >> run simultaneously. > >> > >> The javaws process that is trying to clear the cache checks for the file > >> and tries to acquire an exclusive lock. If it succeeds, it goes ahead > >> and clears the cache; otherwise it prints out an error to the user and > >> exits. > >> > >> Thoughts? > >> > > > > Sounds good to me. I was actually going to suggest this before Deepak weighed > > in with the jps option. Not knowing what jps was, I didn't no any pros or cons > > as to using it. > > > > Updated patch attached. Also fixes another problem - the previous patch > was creating lock files for applets too :/. > > > Could you not just reuse LOCKS_DIR for this rather than introducing something > > new? > > Ah, good point. Switched to $LOCKS_DIR/netx_running. > > > Also your mail says 'instance' but the code says 'instances' :-) > > I cant come up with a name I am happy with... something that indicates > the purpose of those files clearly. NETX_RUNNING_FILE and > $/LOCKS/netx_running is what I am using now. > I like netx_running best. It's clear and obvious :-) > > > >> + FileChannel channel = fileLock.channel(); > >> + fileLock.release(); > >> + channel.close(); > > > > could be just: > > > > fileLock.release(); > > fileLock.channel().close(); > > > > Nice catch. Fixed. > > > Why do we have a method called just 'R' in CacheUtil? > > > > R is the translation function. It is supposed to localize strings. A > number of classes in netx declare R, which is a shortcut to > JNLPRuntime.getMessage(). > Does it have to be called R and not 'translate' or something more readable? > > Should we really be catching IOExceptions rather than allowing them to propogate? > > > > Catching IOExceptions is just ignoring the errors. So the question is do > we want to ignore the errors and continue on or should we stop if we hit > any errors. Since the lock file is meant to stop a race condition > (between deleting jars and using them) which is not likely to happen, I > think an error in lock file creation should be ignored. If for some > reason a lock file can not be created, Netx should not abort running the > application. If you dont think this makes sense, please let me know and > I will change it. > That sounds sensible. I'm just always wary of catch blocks. I've seen them used all too often to mask exceptions instead of handling them (including in example code used by lecturers!) > Thanks for the feedback! > > Cheers, > Omair > diff -r f41b0a7fbd70 netx/net/sourceforge/jnlp/Launcher.java > --- a/netx/net/sourceforge/jnlp/Launcher.java Mon Oct 04 18:13:02 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/Launcher.java Wed Oct 06 11:58:46 2010 -0400 > @@ -20,12 +20,17 @@ > import java.applet.Applet; > import java.awt.Container; > import java.io.File; > +import java.io.FileInputStream; > +import java.io.FileOutputStream; > +import java.io.IOException; > import java.lang.management.ManagementFactory; > import java.lang.management.ThreadMXBean; > import java.lang.reflect.Method; > import java.net.InetAddress; > import java.net.URL; > import java.net.UnknownHostException; > +import java.nio.channels.FileChannel; > +import java.nio.channels.FileLock; > import java.util.LinkedList; > import java.util.List; > import java.util.jar.JarFile; > @@ -78,6 +83,9 @@ > /** If the application should call System.exit on fatal errors */ > private boolean exitOnFailure = true; > > + /** a lock which is held to indicate that an isntance of netx is running */ > + private FileLock fileLock; > + > /** > * Create a launcher with the runtime's default update policy > * and launch handler. > @@ -127,6 +135,7 @@ > > this.handler = handler; > this.updatePolicy = policy; > + > } > > /** > @@ -385,6 +394,11 @@ > if (!file.isApplication()) > throw launchError(new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LNotApplication"), R("LNotApplicationInfo"))); > > + markJavawsRunning(); > + Runtime.getRuntime().addShutdownHook(new Thread() { > + public void run() { markJavawsStopped(); } > + }); > + > try { > > try { > @@ -686,6 +700,69 @@ > return null; // chose to continue, or no handler > } > > + /** > + * Indicate that netx is running by creating the {@link JNLPRuntime#INSTANCE_FILE} and > + * acquiring a shared lock on it > + */ > + private void markJavawsRunning() { > + try { > + String message = "This file is used to check if netx is running"; > + > + File javawsRunningFile = new File(JNLPRuntime.NETX_RUNNING_FILE); > + javawsRunningFile.getParentFile().mkdirs(); > + if (javawsRunningFile.createNewFile()) { > + FileOutputStream fos = new FileOutputStream(javawsRunningFile); > + try { > + fos.write(message.getBytes()); > + } finally { > + fos.close(); > + } > + } > + > + if (!javawsRunningFile.isFile()) { > + if (JNLPRuntime.isDebug()) { > + System.err.println("Unable to create instance file"); > + } > + fileLock = null; > + return; > + } > + > + FileInputStream is = new FileInputStream(javawsRunningFile); > + FileChannel channel = is.getChannel(); > + fileLock = channel.tryLock(0, Long.MAX_VALUE, true); > + if (fileLock != null && fileLock.isShared()) { > + if (JNLPRuntime.isDebug()) { > + System.out.println("Acquired shared lock on " + > + JNLPRuntime.NETX_RUNNING_FILE + " to indicate javaws is running"); > + } > + } else { > + fileLock = null; > + } > + } catch (IOException e) { > + e.printStackTrace(); > + } > + > + } > + > + /** > + * Indicate that javaws is stopped by releasing the shared lock on > + * {@link JNLPRuntime#INSTANCE_FILE}. > + */ > + private void markJavawsStopped() { > + if (fileLock == null) { > + return; > + } > + try { > + fileLock.release(); > + fileLock.channel().close(); > + fileLock = null; > + if (JNLPRuntime.isDebug()) { > + System.out.println("Release shared lock on " + JNLPRuntime.NETX_RUNNING_FILE); > + } > + } catch (IOException e) { > + e.printStackTrace(); > + } > + } > > > /** > diff -r f41b0a7fbd70 netx/net/sourceforge/jnlp/cache/CacheUtil.java > --- a/netx/net/sourceforge/jnlp/cache/CacheUtil.java Mon Oct 04 18:13:02 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/cache/CacheUtil.java Wed Oct 06 11:58:46 2010 -0400 > @@ -19,6 +19,7 @@ > > import java.io.*; > import java.net.*; > +import java.nio.channels.FileChannel; > import java.util.*; > import java.lang.reflect.*; > import java.security.*; > @@ -37,6 +38,10 @@ > */ > public class CacheUtil { > > + private static String R(String key) { > + return JNLPRuntime.getMessage(key); > + } > + > private static String R(String key, Object param) { > return JNLPRuntime.getMessage(key, new Object[] {param}); > } > @@ -129,6 +134,72 @@ > } > > /** > + * Clears the cache by deleting all the Netx cache files > + * > + * Note: Because of how our caching system works, deleting jars of another javaws > + * process is using them can be quite disasterous. Hence why Launcher creates lock files > + * and we check for those by calling {@link #okToClearCache()} > + */ > + public static void clearCache() { > + > + if (!okToClearCache()) { > + System.err.println(R("CCannotClearCache")); > + return; > + } > + > + File cacheDir = new File(JNLPRuntime.getBaseDir() + File.separator + "cache"); > + if (!(cacheDir.isDirectory())) { > + return; > + } > + > + if (JNLPRuntime.isDebug()) { > + System.err.println("Clearing cache directory: " + cacheDir); > + } > + try { > + FileUtils.recursiveDelete(cacheDir, JNLPRuntime.getBaseDir()); > + } catch (IOException e) { > + throw new RuntimeException(e); > + } > + } > + > + /** > + * Returns a boolean indicating if it ok to clear the netx application cache at this point > + * @return true if the cache can be cleared at this time without problems > + */ > + private static boolean okToClearCache() { > + File otherJavawsRunning = new File(JNLPRuntime.NETX_RUNNING_FILE); > + try { > + if (otherJavawsRunning.isFile()) { > + FileOutputStream fis = new FileOutputStream(otherJavawsRunning); > + try { > + FileChannel channel = fis.getChannel(); > + if (channel.tryLock() == null) { > + if (JNLPRuntime.isDebug()) { > + System.out.println("Other instances of netx are running"); > + } > + return false; > + } > + > + if (JNLPRuntime.isDebug()) { > + System.out.println("No other instances of netx are running"); > + } > + return true; > + > + } finally { > + fis.close(); > + } > + } else { > + if (JNLPRuntime.isDebug()) { > + System.out.println("No instance file found"); > + } > + return true; > + } > + } catch (IOException e) { > + return false; > + } > + } > + > + /** > * Returns whether there is a version of the URL contents in the > * cache and it is up to date. This method may not return > * immediately. > diff -r f41b0a7fbd70 netx/net/sourceforge/jnlp/resources/Messages.properties > --- a/netx/net/sourceforge/jnlp/resources/Messages.properties Mon Oct 04 18:13:02 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Wed Oct 06 11:58:46 2010 -0400 > @@ -139,6 +139,7 @@ > BOViewer = Shows the trusted certificate viewer. > BOUmask = Sets the umask for files created by an application. > BXnofork = Do not create another JVM. > +BXclearcache= Clean the JNLP application cache. > BOHelp = Print this message and exit. > > # Cache > @@ -149,6 +150,8 @@ > CChooseCache=Choose a cache directory... > CChooseCacheInfo=Netx needs a location for storing cache files. > CChooseCacheDir=Cache directory > +CConfirmClearCache=Are you sure you want to clear the cache? This may running javaws applications to misbehave. > +CCannotClearCache=Can not clear cache at this time > > # Security > SFileReadAccess=The application has requested read access to {0}. Do you want to allow this action? > diff -r f41b0a7fbd70 netx/net/sourceforge/jnlp/runtime/Boot.java > --- a/netx/net/sourceforge/jnlp/runtime/Boot.java Mon Oct 04 18:13:02 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/Boot.java Wed Oct 06 11:58:46 2010 -0400 > @@ -40,6 +40,7 @@ > import net.sourceforge.jnlp.ParseException; > import net.sourceforge.jnlp.PropertyDesc; > import net.sourceforge.jnlp.ResourcesDesc; > +import net.sourceforge.jnlp.cache.CacheUtil; > import net.sourceforge.jnlp.cache.UpdatePolicy; > import net.sourceforge.jnlp.security.VariableX509TrustManager; > import net.sourceforge.jnlp.security.viewer.CertificateViewer; > @@ -114,6 +115,7 @@ > + " -strict "+R("BOStrict")+"\n" > + " -umask=value "+R("BOUmask")+"\n" > + " -Xnofork "+R("BXnofork")+"\n" > + + " -Xclearcache "+R("BXclearcache")+"\n" > + " -help "+R("BOHelp")+"\n"; > > private static final String doubleArgs = "-basedir -jnlp -arg -param -property -update"; > @@ -202,6 +204,17 @@ > JNLPRuntime.setSecurityEnabled(null == getOption("-nosecurity")); > JNLPRuntime.initialize(true); > > + /* > + * FIXME > + * This should have been done with the rest of the argument parsing > + * code. But we need to know what the cache and base directories are, > + * and baseDir is initialized here > + */ > + if (null != getOption("-Xclearcache")) { > + CacheUtil.clearCache(); > + return null; > + } > + > try { > new Launcher().launch(getFile()); > } > diff -r f41b0a7fbd70 netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Mon Oct 04 18:13:02 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Wed Oct 06 11:58:46 2010 -0400 > @@ -18,6 +18,7 @@ > package net.sourceforge.jnlp.runtime; > > import java.io.*; > +import java.nio.channels.FileLock; > import java.awt.*; > import java.text.*; > import java.util.*; > @@ -132,6 +133,15 @@ > public static final String LOCKS_DIR = TMP_DIR + File.separator + USER + File.separator > + "netx" + File.separator + "locks"; > > + /** > + * The /tmp/$USER/netx/locks/netx_running file is used to indicate if any > + * instances of netx are running (this file may exist even if no instances > + * are running). All netx instances acquire a shared lock on this file. If > + * this file can be locked (using a {@link FileLock}) in exclusive mode, then > + * other netx instances are not running > + */ > + public static final String NETX_RUNNING_FILE = LOCKS_DIR + "netx_running"; > + > /** the java.home directory */ > public static final String JAVA_HOME_DIR = System.getProperty("java.home"); > > diff -r f41b0a7fbd70 netx/net/sourceforge/jnlp/util/FileUtils.java > --- a/netx/net/sourceforge/jnlp/util/FileUtils.java Mon Oct 04 18:13:02 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/util/FileUtils.java Wed Oct 06 11:58:46 2010 -0400 > @@ -17,6 +17,9 @@ > package net.sourceforge.jnlp.util; > > import java.io.File; > +import java.io.IOException; > + > +import net.sourceforge.jnlp.runtime.JNLPRuntime; > > /** > * This class contains a few file-related utility functions. > @@ -121,4 +124,36 @@ > return prefix + OMITTED + suffix; > } > > + /** > + * Recursively delete everything under a directory. Works on either files or > + * directories > + * > + * @param file the file object representing what to delete. Can be either a > + * file or a directory. > + * @param base the directory under which the file and its subdirectories must be located > + * @throws IOException on an io exception or if trying to delete something > + * outside the base > + */ > + public static void recursiveDelete(File file, File base) throws IOException { > + if (JNLPRuntime.isDebug()) { > + System.err.println("Deleting: " + file); > + } > + > + if (!(file.getCanonicalPath().startsWith(base.getCanonicalPath()))) { > + throw new IOException("Trying to delete a file outside Netx's basedir: " > + + file.getCanonicalPath()); > + } > + > + if (file.isDirectory()) { > + File[] children = file.listFiles(); > + for (int i = 0; i < children.length; i++) { > + recursiveDelete(children[i], base); > + } > + } > + if (!file.delete()) { > + throw new IOException("Unable to delete file: " + file); > + } > + > + } > + > } -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From bugzilla-daemon at icedtea.classpath.org Wed Oct 6 13:55:36 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 06 Oct 2010 20:55:36 +0000 Subject: [Bug 566] New: gerrit crash - problem points to jdk Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=566 Summary: gerrit crash - problem points to jdk Product: IcedTea Version: unspecified Platform: all OS/Version: Mac OS Status: NEW Severity: normal Priority: P2 Component: AddVM AssignedTo: unassigned at icedtea.classpath.org ReportedBy: prem18 at gmail.com # # An unexpected error has been detected by Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002b26dd8e8821, pid=8123, tid=1102473536 # # Java VM: OpenJDK 64-Bit Server VM (1.6.0-b09 mixed mode linux-amd64) # Problematic frame: # V [libjvm.so+0x20a821] # # If you would like to submit a bug report, please visit: # http://icedtea.classpath.org/bugzilla # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x000000001c36e400): JavaThread "CompilerThread1" daemon [_thread_in_native, id=8132, stack(0x0000000041a66000,0x0000000041b67000)] siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x0000000000000000 Registers: RAX=0x0000000000000000, RBX=0x000000001c51dc60, RCX=0x000000001e422d08, RDX=0x0000000041b644f8 RSP=0x0000000041b62d00, RBP=0x0000000041b62d70, RSI=0x000000001c50d8a0, RDI=0x000000001e422d08 R8 =0x0000000000000001, R9 =0x0000000000000000, R10=0x0000000000000000, R11=0x00002b26dd810f90 R12=0x0000000000000000, R13=0x000000001c51dc28, R14=0x0000000000000001, R15=0x000000001c2e5020 RIP=0x00002b26dd8e8821, EFL=0x0000000000010246, CSGSFS=0x0000000000000033, ERR=0x0000000000000004 TRAPNO=0x000000000000000e Top of Stack: (sp=0x0000000041b62d00) 0x0000000041b62d00: 0000000041b62ef0 000000001ca22358 0x0000000041b62d10: 0100000041b62f90 0000000041b64470 0x0000000041b62d20: 0000001100025a98 000000001ca22350 0x0000000041b62d30: 0000000241b62d70 ffffffff0000000e 0x0000000041b62d40: 000000001e422d08 0000000041b64470 0x0000000041b62d50: 0000000041b62f90 00002b26de099220 0x0000000041b62d60: 000000001cbcc030 0000000041b62dd0 0x0000000041b62d70: 0000000041b62f80 00002b26dd8ea4d3 0x0000000041b62d80: 0000000000000000 0000000200000000 0x0000000041b62d90: 0000000041b62da0 0000000041b62f30 0x0000000041b62da0: 0000000041b62e90 0000000041b62ef0 0x0000000041b62db0: 0000000041b64538 000000001c9b8210 0x0000000041b62dc0: 000000001cbcc418 000000001cbcc040 0x0000000041b62dd0: 00002b26de060710 000000000000000e 0x0000000041b62de0: 0000000041b65290 0000000041b64470 0x0000000041b62df0: 0000000000000a55 0000000041b62e30 0x0000000041b62e00: 0000000041b62ea0 00002b26ddcb8a06 0x0000000041b62e10: 0000000041b62f90 00002b26ddcb8957 0x0000000041b62e20: 0000000041b62e60 00002b26ddcb8a06 0x0000000041b62e30: 0000000041b645d8 00002b26ddcb8957 0x0000000041b62e40: 0000000041b62e80 00002b26ddcb8a06 0x0000000041b62e50: 000000001c871cd0 00002b26ddcb8957 0x0000000041b62e60: 0000000041b62ea0 00002b26dd89105b 0x0000000041b62e70: 000000001c36e920 0000000000007fd8 0x0000000041b62e80: 0000000041b62ec0 0000000000000002 0x0000000041b62e90: 000000000000000c 0000000041b65290 0x0000000041b62ea0: 000000001c83c3c0 000000001e51a7c0 0x0000000041b62eb0: 000000001dcd0840 000000001dcd1570 0x0000000041b62ec0: 000000001d6b1f00 0000000041b64590 0x0000000041b62ed0: 0000000041b64538 00000000000002f3 0x0000000041b62ee0: 0000000041b62f30 00002b26dd8e782f 0x0000000041b62ef0: 000000000000000d 0000000041b65290 Instructions: (pc=0x00002b26dd8e8821) 0x00002b26dd8e8811: d0 48 8b 01 48 89 cf ff 90 80 00 00 00 49 89 c4 0x00002b26dd8e8821: 8b 00 21 03 41 8b 44 24 04 21 43 04 48 89 df 41 Stack: [0x0000000041a66000,0x0000000041b67000], sp=0x0000000041b62d00, free space=1011k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x20a821] V [libjvm.so+0x20c4d3] V [libjvm.so+0x25c31d] V [libjvm.so+0x25d878] V [libjvm.so+0x1f9028] V [libjvm.so+0x261681] V [libjvm.so+0x2623bb] V [libjvm.so+0x5d83ad] V [libjvm.so+0x4e1924] Current CompileTask: C2:684 org.eclipse.jdt.internal.compiler.lookup.ParameterizedMethodBinding.(Lorg/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding;Lorg/eclipse/jdt/internal/compiler/lookup/MethodBinding;)V (596 bytes) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x000000001c667c00 JavaThread "Timer-0" daemon [_thread_blocked, id=8136, stack(0x00000000420aa000,0x00000000421ab000)] 0x000000001c370000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=8133, stack(0x0000000041b67000,0x0000000041c68000)] =>0x000000001c36e400 JavaThread "CompilerThread1" daemon [_thread_in_native, id=8132, stack(0x0000000041a66000,0x0000000041b67000)] 0x000000001c36ac00 JavaThread "CompilerThread0" daemon [_thread_blocked, id=8131, stack(0x0000000041102000,0x0000000041203000)] 0x000000001c369400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=8130, stack(0x0000000041001000,0x0000000041102000)] 0x000000001c343400 JavaThread "Finalizer" daemon [_thread_blocked, id=8129, stack(0x0000000041ea8000,0x0000000041fa9000)] 0x000000001c342000 JavaThread "Reference Handler" daemon [_thread_blocked, id=8128, stack(0x0000000041da7000,0x0000000041ea8000)] 0x000000001c2d5000 JavaThread "main" [_thread_in_vm, id=8126, stack(0x0000000040c3a000,0x0000000040d3b000)] Other Threads: 0x000000001c33cc00 VMThread [stack: 0x0000000041ca6000,0x0000000041da7000] [id=8127] 0x000000001c372000 WatcherThread [stack: 0x0000000041fa9000,0x00000000420aa000] [id=8134] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 29056K, used 27567K [0x00002aaaae3e0000, 0x00002aaab0360000, 0x00002aaab8e80000) eden space 25856K, 94% used [0x00002aaaae3e0000, 0x00002aaaafbabc48, 0x00002aaaafd20000) from space 3200K, 99% used [0x00002aaaafd20000, 0x00002aaab003fff0, 0x00002aaab0040000) to space 3200K, 0% used [0x00002aaab0040000, 0x00002aaab0040000, 0x00002aaab0360000) tenured generation total 64460K, used 47821K [0x00002aaab8e80000, 0x00002aaabcd73000, 0x00002aaace3e0000) the space 64460K, 74% used [0x00002aaab8e80000, 0x00002aaabbd334d0, 0x00002aaabbd33600, 0x00002aaabcd73000) compacting perm gen total 21248K, used 15744K [0x00002aaace3e0000, 0x00002aaacf8a0000, 0x00002aaad37e0000) the space 21248K, 74% used [0x00002aaace3e0000, 0x00002aaacf340360, 0x00002aaacf340400, 0x00002aaacf8a0000) No shared spaces configured. Dynamic libraries: 00400000-00409000 r-xp 00000000 fd:04 986600 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin/java 00608000-0060a000 rw-p 00008000 fd:04 986600 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin/java 1c2cb000-1f29d000 rw-p 1c2cb000 00:00 0 [heap] 40c3a000-40c3d000 ---p 40c3a000 00:00 0 40c3d000-40d3b000 rw-p 40c3d000 00:00 0 41001000-41004000 ---p 41001000 00:00 0 41004000-41102000 rw-p 41004000 00:00 0 41102000-41105000 ---p 41102000 00:00 0 41105000-41203000 rw-p 41105000 00:00 0 41587000-4158a000 rwxp 41587000 00:00 0 4158a000-41688000 rw-p 4158a000 00:00 0 41a66000-41a69000 ---p 41a66000 00:00 0 41a69000-41b67000 rw-p 41a69000 00:00 0 41b67000-41b6a000 ---p 41b67000 00:00 0 41b6a000-41c68000 rw-p 41b6a000 00:00 0 41ca6000-41ca7000 ---p 41ca6000 00:00 0 41ca7000-41da7000 rw-p 41ca7000 00:00 0 41da7000-41daa000 ---p 41da7000 00:00 0 41daa000-41ea8000 rw-p 41daa000 00:00 0 41ea8000-41eab000 ---p 41ea8000 00:00 0 41eab000-41fa9000 rw-p 41eab000 00:00 0 41fa9000-41faa000 ---p 41fa9000 00:00 0 41faa000-420aa000 rw-p 41faa000 00:00 0 420aa000-420ad000 ---p 420aa000 00:00 0 420ad000-421ab000 rw-p 420ad000 00:00 0 421ab000-421ae000 rwxp 421ab000 00:00 0 421ae000-422ac000 rw-p 421ae000 00:00 0 37ed400000-37ed41c000 r-xp 00000000 fd:00 229386 /lib64/ld-2.5.so 37ed61b000-37ed61c000 r--p 0001b000 fd:00 229386 /lib64/ld-2.5.so 37ed61c000-37ed61d000 rw-p 0001c000 fd:00 229386 /lib64/ld-2.5.so 37ed800000-37ed94d000 r-xp 00000000 fd:00 229387 /lib64/libc-2.5.so 37ed94d000-37edb4d000 ---p 0014d000 fd:00 229387 /lib64/libc-2.5.so 37edb4d000-37edb51000 r--p 0014d000 fd:00 229387 /lib64/libc-2.5.so 37edb51000-37edb52000 rw-p 00151000 fd:00 229387 /lib64/libc-2.5.so 37edb52000-37edb57000 rw-p 37edb52000 00:00 0 37edc00000-37edc02000 r-xp 00000000 fd:00 229392 /lib64/libdl-2.5.so 37edc02000-37ede02000 ---p 00002000 fd:00 229392 /lib64/libdl-2.5.so 37ede02000-37ede03000 r--p 00002000 fd:00 229392 /lib64/libdl-2.5.so 37ede03000-37ede04000 rw-p 00003000 fd:00 229392 /lib64/libdl-2.5.so 37ee000000-37ee082000 r-xp 00000000 fd:00 229390 /lib64/libm-2.5.so 37ee082000-37ee281000 ---p 00082000 fd:00 229390 /lib64/libm-2.5.so 37ee281000-37ee282000 r--p 00081000 fd:00 229390 /lib64/libm-2.5.so 37ee282000-37ee283000 rw-p 00082000 fd:00 229390 /lib64/libm-2.5.so 37ee400000-37ee416000 r-xp 00000000 fd:00 229393 /lib64/libpthread-2.5.so 37ee416000-37ee615000 ---p 00016000 fd:00 229393 /lib64/libpthread-2.5.so 37ee615000-37ee616000 r--p 00015000 fd:00 229393 /lib64/libpthread-2.5.so 37ee616000-37ee617000 rw-p 00016000 fd:00 229393 /lib64/libpthread-2.5.so 37ee617000-37ee61b000 rw-p 37ee617000 00:00 0 37ee800000-37ee814000 r-xp 00000000 fd:04 590116 /usr/lib64/libz.so.1.2.3 37ee814000-37eea13000 ---p 00014000 fd:04 590116 /usr/lib64/libz.so.1.2.3 37eea13000-37eea14000 rw-p 00013000 fd:04 590116 /usr/lib64/libz.so.1.2.3 37eec00000-37eec07000 r-xp 00000000 fd:00 229394 /lib64/librt-2.5.so 37eec07000-37eee07000 ---p 00007000 fd:00 229394 /lib64/librt-2.5.so 37eee07000-37eee08000 r--p 00007000 fd:00 229394 /lib64/librt-2.5.so 37eee08000-37eee09000 rw-p 00008000 fd:00 229394 /lib64/librt-2.5.so 37ef000000-37ef00a000 r-xp 00000000 fd:00 229556 /lib64/libnss_files-2.5.so 37ef00a000-37ef209000 ---p 0000a000 fd:00 229556 /lib64/libnss_files-2.5.so 37ef209000-37ef20a000 r--p 00009000 fd:00 229556 /lib64/libnss_files-2.5.so 37ef20a000-37ef20b000 rw-p 0000a000 fd:00 229556 /lib64/libnss_files-2.5.so 37efc00000-37efc15000 r-xp 00000000 fd:00 229413 /lib64/libnsl-2.5.so 37efc15000-37efe14000 ---p 00015000 fd:00 229413 /lib64/libnsl-2.5.so 37efe14000-37efe15000 r--p 00014000 fd:00 229413 /lib64/libnsl-2.5.so 37efe15000-37efe16000 rw-p 00015000 fd:00 229413 /lib64/libnsl-2.5.so 37efe16000-37efe18000 rw-p 37efe16000 00:00 0 37f1800000-37f1811000 r-xp 00000000 fd:00 229442 /lib64/libresolv-2.5.so 37f1811000-37f1a11000 ---p 00011000 fd:00 229442 /lib64/libresolv-2.5.so 37f1a11000-37f1a12000 r--p 00011000 fd:00 229442 /lib64/libresolv-2.5.so 37f1a12000-37f1a13000 rw-p 00012000 fd:00 229442 /lib64/libresolv-2.5.so 37f1a13000-37f1a15000 rw-p 37f1a13000 00:00 0 3a13a00000-3a13a04000 r-xp 00000000 fd:04 986641 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/jli/libjli.so 3a13a04000-3a13c03000 ---p 00004000 fd:04 986641 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/jli/libjli.so 3a13c03000-3a13c04000 rw-p 00003000 fd:04 986641 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/jli/libjli.so 2aaaaaaab000-2aaaaaab3000 r--s 00061000 fd:04 986063 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/ext/gnome-java-bridge.jar 2aaaaaab3000-2aaaaaab7000 r--s 00079000 fd:04 986092 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/jsse.jar 2aaaaaab7000-2aaaaaab9000 r--s 00001000 fd:04 986062 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/ext/dnsns.jar 2aaaaaab9000-2aaaaaaba000 r--p 2aaaaaab9000 00:00 0 2aaaaaaba000-2aaaaaabb000 rwxp 2aaaaaaba000 00:00 0 2aaaaaabb000-2aaaaaac3000 r-xp 00000000 fd:04 986040 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/native_threads/libhpi.so 2aaaaaac3000-2aaaaacc2000 ---p 00008000 fd:04 986040 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/native_threads/libhpi.so 2aaaaacc2000-2aaaaacc3000 rw-p 00007000 fd:04 986040 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/native_threads/libhpi.so 2aaaaacc3000-2aaaaacc4000 rw-p 2aaaaacc3000 00:00 0 2aaaaacc4000-2aaaaaccc000 rw-s 00000000 fd:02 1015811 /tmp/hsperfdata_prem/8123 2aaaaaccc000-2aaaaacda000 r-xp 00000000 fd:04 986037 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/libverify.so 2aaaaacda000-2aaaaaed9000 ---p 0000e000 fd:04 986037 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/libverify.so 2aaaaaed9000-2aaaaaedb000 rw-p 0000d000 fd:04 986037 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/libverify.so 2aaaaaedb000-2aaaaaf07000 r-xp 00000000 fd:04 986018 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/libjava.so 2aaaaaf07000-2aaaab106000 ---p 0002c000 fd:04 986018 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/libjava.so 2aaaab106000-2aaaab10a000 rw-p 0002b000 fd:04 986018 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/libjava.so 2aaaab10a000-2aaaab111000 r-xp 00000000 fd:04 986038 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/libzip.so 2aaaab111000-2aaaab310000 ---p 00007000 fd:04 986038 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/libzip.so 2aaaab310000-2aaaab311000 rw-p 00006000 fd:04 986038 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/libzip.so 2aaaab311000-2aaaab741000 rwxp 2aaaab311000 00:00 0 2aaaab741000-2aaaae311000 rwxp 2aaaab741000 00:00 0 2aaaae311000-2aaaae322000 rwxp 2aaaae311000 00:00 0 2aaaae322000-2aaaae3d1000 rwxp 2aaaae322000 00:00 0 2aaaae3d1000-2aaaae3d5000 r--s 00076000 fd:04 986064 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/ext/localedata.jar 2aaaae3d5000-2aaaae3d8000 r--s 00031000 fd:04 986066 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/ext/sunjce_provider.jar 2aaaae3d8000-2aaaae3dc000 r--s 00037000 fd:04 986067 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/ext/sunpkcs11.jar 2aaaae3e0000-2aaab0360000 rwxp 2aaaae3e0000 00:00 0 2aaab0360000-2aaab8e80000 rwxp 2aaab0360000 00:00 0 2aaab8e80000-2aaabcd73000 rwxp 2aaab8e80000 00:00 0 2aaabcd73000-2aaace3e0000 rwxp 2aaabcd73000 00:00 0 2aaace3e0000-2aaacf8a0000 rwxp 2aaace3e0000 00:00 0 2aaacf8a0000-2aaad37e0000 rwxp 2aaacf8a0000 00:00 0 2aaad37e0000-2aaad37f0000 rwxp 2aaad37e0000 00:00 0 2aaad37f0000-2aaad3835000 rwxp 2aaad37f0000 00:00 0 2aaad3835000-2aaad3855000 rwxp 2aaad3835000 00:00 0 2aaad3855000-2aaad38e0000 rwxp 2aaad3855000 00:00 0 2aaad38e0000-2aaad38eb000 rwxp 2aaad38e0000 00:00 0 2aaad38eb000-2aaad390a000 rwxp 2aaad38eb000 00:00 0 2aaad390a000-2aaad392b000 rwxp 2aaad390a000 00:00 0 2aaad392b000-2aaad39b6000 rwxp 2aaad392b000 00:00 0 2aaad39b6000-2aaad39c1000 rwxp 2aaad39b6000 00:00 0 2aaad39c1000-2aaad39e1000 rwxp 2aaad39c1000 00:00 0 2aaad39e1000-2aaad3a09000 rw-p 2aaad39e1000 00:00 0 2aaad3a09000-2aaad3b96000 r--s 03385000 fd:04 986106 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/rt.jar 2aaad3b96000-2aaad3bc8000 rw-p 2aaad3b96000 00:00 0 2aaad3bc8000-2aaad71a2000 r--p 00000000 fd:04 985944 /usr/lib/locale/locale-archive 2aaad71a2000-2aaad720f000 r--s 0048c000 fd:01 66601 /home/prem/.m2/repository/com/google/gwt/gwt-user/2.0.4/gwt-user-2.0.4.jar 2aaad720f000-2aaad7212000 r--s 00013000 fd:01 66681 /home/prem/.m2/repository/gwtexpui/gwtexpui/1.2.2/gwtexpui-1.2.2.jar 2aaad7212000-2aaad7215000 r--s 0000f000 fd:01 67262 /home/prem/.m2/repository/gwtexpui/gwtexpui/1.2.2/gwtexpui-1.2.2-sources.jar 2aaad7215000-2aaad7218000 r--s 0001b000 fd:01 66602 /home/prem/.m2/repository/gwtjsonrpc/gwtjsonrpc/1.2.2/gwtjsonrpc-1.2.2.jar 2aaad7218000-2aaad721a000 r--s 0000d000 fd:01 66508 /home/prem/.m2/repository/commons-codec/commons-codec/1.4/commons-codec-1.4.jar 2aaad721a000-2aaad721e000 r--s 00025000 fd:01 66603 /home/prem/.m2/repository/com/google/code/gson/gson/1.4/gson-1.4.jar 2aaad721e000-2aaad7220000 r--s 00013000 fd:01 67260 /home/prem/.m2/repository/gwtjsonrpc/gwtjsonrpc/1.2.2/gwtjsonrpc-1.2.2-sources.jar 2aaad7220000-2aaad7223000 r--s 00026000 fd:01 66668 /home/prem/.m2/repository/gwtorm/gwtorm/1.1.4/gwtorm-1.1.4.jar 2aaad7223000-2aaad7224000 r--s 0000a000 fd:01 66670 /home/prem/.m2/repository/asm/asm/3.2/asm-3.2.jar 2aaad7224000-2aaad7234000 r--s 00162000 fd:01 66671 /home/prem/.m2/repository/org/antlr/antlr/3.1.1/antlr-3.1.1.jar 2aaad7234000-2aaad7237000 r--s 00018000 fd:01 67263 /home/prem/.m2/repository/gwtorm/gwtorm/1.1.4/gwtorm-1.1.4-sources.jar 2aaad7237000-2aaad723b000 r--s 00018000 fd:01 853634 /home/prem/gerrit/gerrit-reviewdb/target/gerrit-reviewdb-2.1-SNAPSHOT.jar 2aaad723b000-2aaad723d000 r--s 00012000 fd:01 853635 /home/prem/gerrit/gerrit-reviewdb/target/gerrit-reviewdb-2.1-SNAPSHOT-sources.jar 2aaad723d000-2aaad7240000 r--s 00010000 fd:01 853787 /home/prem/gerrit/gerrit-common/target/gerrit-common-2.1-SNAPSHOT.jar 2aaad7240000-2aaad7242000 r--s 00009000 fd:01 853681 /home/prem/gerrit/gerrit-prettify/target/gerrit-prettify-2.1-SNAPSHOT.jar 2aaad7242000-2aaad7244000 r--s 00001000 fd:01 853491 /home/prem/gerrit/gerrit-patch-jgit/target/gerrit-patch-jgit-2.1-SNAPSHOT.jar 2aaad7244000-2aaad7256000 r--s 000f5000 fd:01 66599 /home/prem/.m2/repository/org/eclipse/jgit/org.eclipse.jgit/0.8.4.403-ga424b7a/org.eclipse.jgit-0.8.4.403-ga424b7a.jar 2aaad7256000-2aaad7259000 r--s 00030000 fd:01 66607 /home/prem/.m2/repository/com/jcraft/jsch/0.1.41/jsch-0.1.41.jar 2aaad7259000-2aaad725c000 r--s 0000d000 fd:01 853788 /home/prem/gerrit/gerrit-common/target/gerrit-common-2.1-SNAPSHOT-sources.jar 2aaad725c000-2aaad725d000 r--s 00001000 fd:01 853492 /home/prem/gerrit/gerrit-patch-jgit/target/gerrit-patch-jgit-2.1-SNAPSHOT-sources.jar 2aaad725d000-2aaad7268000 r--s 0010a000 fd:01 67264 /home/prem/.m2/repository/org/eclipse/jgit/org.eclipse.jgit/0.8.4.403-ga424b7a/org.eclipse.jgit-0.8.4.403-ga424b7a-sources.jar 2aaad7268000-2aaad7269000 r--s 00007000 fd:01 853682 /home/prem/gerrit/gerrit-prettify/target/gerrit-prettify-2.1-SNAPSHOT-sources.jar 2aaad7269000-2aaad7368000 r--s 0110c000 fd:01 67579 /home/prem/.m2/repository/com/google/gwt/gwt-dev/2.0.4/gwt-dev-2.0.4.jar 2aaad7368000-2aaad737c000 r-xp 00000000 fd:04 986030 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/libnet.so 2aaad737c000-2aaad757b000 ---p 00014000 fd:04 986030 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/libnet.so 2aaad757b000-2aaad757c000 rw-p 00013000 fd:04 986030 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/libnet.so 2aaad757c000-2aaad76fd000 rw-p 2aaad757c000 00:00 0 2aaad770a000-2aaad770e000 r-xp 00000000 fd:00 229399 /lib64/libnss_dns-2.5.so 2aaad770e000-2aaad790d000 ---p 00004000 fd:00 229399 /lib64/libnss_dns-2.5.so 2aaad790d000-2aaad790e000 r--p 00003000 fd:00 229399 /lib64/libnss_dns-2.5.so 2aaad790e000-2aaad790f000 rw-p 00004000 fd:00 229399 /lib64/libnss_dns-2.5.so 2b26dd6cc000-2b26dd6cd000 rw-p 2b26dd6cc000 00:00 0 2b26dd6da000-2b26dd6de000 rw-p 2b26dd6da000 00:00 0 2b26dd6de000-2b26dde1a000 r-xp 00000000 fd:04 986044 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server/libjvm.so 2b26dde1a000-2b26de01a000 ---p 0073c000 fd:04 986044 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server/libjvm.so 2b26de01a000-2b26de092000 rw-p 0073c000 fd:04 986044 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server/libjvm.so 2b26de092000-2b26de0cb000 rw-p 2b26de092000 00:00 0 7fff9b055000-7fff9b06a000 rw-p 7ffffffea000 00:00 0 [stack] ffffffffff600000-ffffffffffe00000 ---p 00000000 00:00 0 [vdso] VM Arguments: jvm_args: -Xmx512m java_command: com.google.gwt.dev.Compiler -gen /home/prem/gerrit/gerrit-gwtui/target/.generated -logLevel INFO -style OBF -war /home/prem/gerrit/gerrit-gwtui/target/gerrit-gwtui-2.1-SNAPSHOT -localWorkers 1 -XdisableClassMetadata -XdisableCastChecking com.google.gerrit.GerritGwtUI Launcher Type: SUN_STANDARD Environment Variables: JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk.x86_64/ PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/prem/bin::/usr/local/maven/bin::/usr/local/maven/bin::/usr/local/maven/bin LD_LIBRARY_PATH=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/../lib/amd64 SHELL=/bin/bash Signal Handlers: SIGSEGV: [libjvm.so+0x618c80], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 SIGBUS: [libjvm.so+0x618c80], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 SIGFPE: [libjvm.so+0x4dcd80], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 SIGPIPE: [libjvm.so+0x4dcd80], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 SIGXFSZ: [libjvm.so+0x4dcd80], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 SIGILL: [libjvm.so+0x4dcd80], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000 SIGUSR2: [libjvm.so+0x4e02a0], sa_mask[0]=0x00000004, sa_flags=0x10000004 SIGHUP: [libjvm.so+0x4de1b0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 SIGINT: [libjvm.so+0x4de1b0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 SIGTERM: [libjvm.so+0x4de1b0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 SIGQUIT: [libjvm.so+0x4de1b0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 --------------- S Y S T E M --------------- OS:Red Hat Enterprise Linux Server release 5.4 (Tikanga) uname:Linux 2.6.18-164.6.1.el5 #1 SMP Tue Oct 27 11:28:30 EDT 2009 x86_64 libc:glibc 2.5 NPTL 2.5 rlimit: STACK 10240k, CORE 0k, NPROC 8192, NOFILE 32768, AS infinity load average:0.82 0.37 0.16 CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 7 stepping 8, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3 Memory: 4k page, physical 3866468k(343972k free), swap 8388600k(8388536k free) vm_info: OpenJDK 64-Bit Server VM (1.6.0-b09) for linux-amd64 JRE (1.6.0-b09), built on Nov 12 2009 07:42:50 by "mockbuild" with gcc 4.1.2 20080704 (Red Hat 4.1.2-46) time: Wed Oct 6 16:37:39 2010 elapsed time: 14 seconds -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From omajid at redhat.com Wed Oct 6 14:39:32 2010 From: omajid at redhat.com (Omair Majid) Date: Wed, 06 Oct 2010 17:39:32 -0400 Subject: RFC: Netx - implement -Xclearcache command line option In-Reply-To: <20101006184022.GM21949@rivendell.middle-earth.co.uk> References: <4A720E40.7020406@redhat.com> <4CA4EE08.6000007@redhat.com> <20100930203203.GE31194@redhat.com> <4CA4F800.5000306@redhat.com> <20100930212727.GG31194@redhat.com> <4CAA2857.6020105@redhat.com> <4CAB724A.7010202@redhat.com> <20101005231941.GF30285@rivendell.middle-earth.co.uk> <4CAC9DF7.4060801@redhat.com> <20101006184022.GM21949@rivendell.middle-earth.co.uk> Message-ID: <4CACEC94.3000701@redhat.com> On 10/06/2010 02:40 PM, Dr Andrew John Hughes wrote: > On 12:04 Wed 06 Oct , Omair Majid wrote: >> On 10/05/2010 07:19 PM, Dr Andrew John Hughes wrote: >>> On 14:45 Tue 05 Oct , Omair Majid wrote: >>>> On 10/04/2010 03:17 PM, Omair Majid wrote: >>>>> On 09/30/2010 05:27 PM, Deepak Bhole wrote: >>>>>> * Omair Majid [2010-09-30 16:50]: >>>>>>> On 09/30/2010 04:32 PM, Deepak Bhole wrote: >>>>>>>> * Omair Majid [2010-09-30 16:10]: >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I posted this patch way back in 2009, but it looks like it got >>>>>>>>> lost/ignored. >>>>>>>>> >>>>>>> >>>>>>> Ok, turns out it was my fault: just noticed >>>>>>> http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2009-August/006666.html. >>>>>>> >>>>>>> Somehow it slipped off my radar. >>>>>>> >>>>>> >>>>>> Doh. Glad it was re-visited. I doubt the issue will be encountered, but >>>>>> we might as well fix it instead of waiting for a bug report. >>>>>> >>>>>>>>> On 07/30/2009 05:18 PM, Omair Majid wrote: >>>>>>>>>> The attached patch adds the option -Xclearcache to Netx. >>>>>>>>>> >>>>>>>>> >>>>>>>>> Which (and I neglected to explain this last time) makes javaws clean >>>>>>>>> out its cache by deleting the contents of ~/.netx/cache/ >>>>>>>>> >>>>>>>> >>>>>>>> Hmm, what happens if I have another netx app running and javaws is >>>>>>>> called >>>>>>>> with -Xclearcache? AFAIK the code has no provisioning to detect if a >>>>>>>> cache file has been deleted, and to re-download it... does it? >>>>>>>> >>>>>>> >>>>>>> As far as I can tell, very bad things (not eating babies kind of >>>>>>> bad, but still...). Depending on the exact timing either the VM will >>>>>>> crash or a java Exception might be thrown. If the JVM has opened the >>>>>>> (missing) jar earlier and and wants to open it again to load >>>>>>> additional classes the VM will most probably crash. Otherwise javaws >>>>>>> simply wont be able to find the needed jar and will fail to start. >>>>>>> >>>>>>> I suppose I could make some sort of global application lock to stop >>>>>>> any other javaws instances from starting while -Xclearcache is >>>>>>> running and to make sure -Xclearcache does not start if any other >>>>>>> javaws applications are running. >>>>>>> >>>>>> >>>>>> It would be hard to set up a locking system that can handle odd cases >>>>>> like crashed application, multiple instances of same app., etc. >>>>>> >>>>> >>>>> Yeah, you are right. I thought about it for a bit, and I dont see a >>>>> simple way to make it work using locks. >>>>> >>>>>> Easiest way I think is to execute jps -l and see if there is more than >>>>>> one instance of net.sourceforge.jnlp.runtime.Boot. If there is, refuse >>>>>> to run with -Xclearcache. I am not as worried about the 'don't start >>>>>> while -Xclearcache is running' case, as there is a far smaller window >>>>>> where things can go wrong. Plus if they do, it will be right away (as >>>>>> opposed to an already started app that has modified data, crashing). >>>>>> >>>>> >>>>> That's a great idea! Unfortunately I dont think we can rely on jps. jps >>>>> is part of the JDK as opposed to the JRE - we can not be sure that users >>>>> have it on their machine. I tried looking into the sources for jps to >>>>> find out how it works. The JVM creates /tmp/hsperfdata_$USER/$PID files >>>>> which contain the information that jps can parse and display. The files >>>>> are in a binary format so parsing it is not trivial (and the file format >>>>> is not guaranteed to be final). I am going to dig around a bit to see if >>>>> there is any other simple solution to this >>>>> >>>> >>>> I am attaching the updated patch. This one uses an alternate >>>> implementation based on file locks (exclusive and shared). A normal >>>> javaws process acquires a shared lock on /tmp/$USER/netx/instance during >>>> startup (when an instance of Launcher is created), and releases the lock >>>> when the JVM shutsdown. Multiple javaws processes can share the lock and >>>> run simultaneously. >>>> >>>> The javaws process that is trying to clear the cache checks for the file >>>> and tries to acquire an exclusive lock. If it succeeds, it goes ahead >>>> and clears the cache; otherwise it prints out an error to the user and >>>> exits. >>>> >>>> Thoughts? >>>> >>> >>> Sounds good to me. I was actually going to suggest this before Deepak weighed >>> in with the jps option. Not knowing what jps was, I didn't no any pros or cons >>> as to using it. >>> >> >> Updated patch attached. Also fixes another problem - the previous patch >> was creating lock files for applets too :/. >> >>> Could you not just reuse LOCKS_DIR for this rather than introducing something >>> new? >> >> Ah, good point. Switched to $LOCKS_DIR/netx_running. >> >>> Also your mail says 'instance' but the code says 'instances' :-) >> >> I cant come up with a name I am happy with... something that indicates >> the purpose of those files clearly. NETX_RUNNING_FILE and >> $/LOCKS/netx_running is what I am using now. >> > > I like netx_running best. It's clear and obvious :-) > >>> >>>> + FileChannel channel = fileLock.channel(); >>>> + fileLock.release(); >>>> + channel.close(); >>> >>> could be just: >>> >>> fileLock.release(); >>> fileLock.channel().close(); >>> >> >> Nice catch. Fixed. >> >>> Why do we have a method called just 'R' in CacheUtil? >>> >> >> R is the translation function. It is supposed to localize strings. A >> number of classes in netx declare R, which is a shortcut to >> JNLPRuntime.getMessage(). >> > > Does it have to be called R and not 'translate' or something more readable? > I am sure we can change it to something more sensible. I was just sticking with what the rest of Netx uses (there is already a R function in the same class). Still, I would like to handle that in a separate patch if it is ok. BTW, I am sure you know that a lot of programs use _ as the translate function. Is _ a valid java identifier? ;) >>> Should we really be catching IOExceptions rather than allowing them to propogate? >>> >> >> Catching IOExceptions is just ignoring the errors. So the question is do >> we want to ignore the errors and continue on or should we stop if we hit >> any errors. Since the lock file is meant to stop a race condition >> (between deleting jars and using them) which is not likely to happen, I >> think an error in lock file creation should be ignored. If for some >> reason a lock file can not be created, Netx should not abort running the >> application. If you dont think this makes sense, please let me know and >> I will change it. >> > > That sounds sensible. I'm just always wary of catch blocks. I've seen them > used all too often to mask exceptions instead of handling them (including in > example code used by lecturers!) > Heh. That's true. I think checked exceptions even (sort of) encourage this. I am afraid of swallowing exceptions too (or worse, handling them at the wrong level), but in this particular instance it makes sense to do just that. Thanks for looking over the changes. Cheers, Omair From ptisnovs at icedtea.classpath.org Thu Oct 7 07:34:32 2010 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Thu, 07 Oct 2010 14:34:32 +0000 Subject: /hg/gfx-test: Harness configuration can now be stored and restor... Message-ID: changeset 0e7637965815 in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=0e7637965815 author: Pavel Tisnovsky date: Thu Oct 07 16:34:58 2010 +0200 Harness configuration can now be stored and restored from property file 'gfx_harness.properties'. diffstat: 4 files changed, 283 insertions(+), 35 deletions(-) gfx_harness.properties | 9 + src/org/gfxtest/harness/Configuration.java | 222 +++++++++++++++++++++++++ src/org/gfxtest/harness/ExternalCommands.java | 21 +- src/org/gfxtest/harness/MainWindow.java | 66 ++++--- diffs (456 lines): diff -r 436d07eb5e5d -r 0e7637965815 gfx_harness.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gfx_harness.properties Thu Oct 07 16:34:58 2010 +0200 @@ -0,0 +1,9 @@ +#Thu Oct 07 15:15:51 CEST 2010 +paths.samplesDirectory=samples +paths.outputDirectory=output +compile.verbose=false +jre.tested=/usr/lib/jvm/java/bin/java +jre.reference=/usr/lib/jvm/java/bin/java +run.verbose=false +mainWindow.height=768 +mainWindow.width=1024 diff -r 436d07eb5e5d -r 0e7637965815 src/org/gfxtest/harness/Configuration.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/gfxtest/harness/Configuration.java Thu Oct 07 16:34:58 2010 +0200 @@ -0,0 +1,222 @@ +/* + Java gfx-test framework + + Copyright (C) 2010 Red Hat + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +IcedTea is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. +*/ + +package org.gfxtest.harness; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.Properties; + +public class Configuration +{ + private static final String PROPERTIES_FILE_NAME = "gfx_harness.properties"; + + private static final int DEFAULT_WINDOW_WIDTH = 1024; + private static final int DEFAULT_WINDOW_HEIGHT = 768; + private static final String DEFAULT_REFERENCE_JAVA = "/usr/lib/jvm/java/bin/java"; + private static final String DEFAULT_TESTED_JAVA = "/usr/lib/jvm/java/bin/java"; + private static final String DEFAULT_SAMPLES_DIRECTORY = "samples"; + private static final String DEFAULT_OUTPUT_DIRECTORY = "output"; + + private String referenceJava; + private String testedJava; + private boolean verboseCompile; + private boolean verboseRun; + private int mainWindowWidth; + private int mainWindowHeight; + private String samplesDirectory; + private String outputDirectory; + + public Configuration() + { + this.setDefaultValues(); + } + + private void setDefaultValues() + { + this.referenceJava = DEFAULT_REFERENCE_JAVA; + this.testedJava = DEFAULT_TESTED_JAVA; + this.verboseCompile = false; + this.verboseRun = false; + this.mainWindowWidth = DEFAULT_WINDOW_WIDTH; + this.mainWindowHeight = DEFAULT_WINDOW_HEIGHT; + this.samplesDirectory = DEFAULT_SAMPLES_DIRECTORY; + this.outputDirectory = DEFAULT_OUTPUT_DIRECTORY; + } + + private void printErrorMessage(Exception e) + { + System.err.println("Cannot access configuration file " + e.getMessage()); + e.printStackTrace(); + } + + public void readConfiguration() + { + // Read properties file. + Properties properties = new Properties(); + try + { + properties.load(new FileInputStream(PROPERTIES_FILE_NAME)); + } + catch (FileNotFoundException e) + { + this.printErrorMessage(e); + this.setDefaultValues(); + } + catch (IOException e) + { + this.printErrorMessage(e); + this.setDefaultValues(); + } + this.setReferenceJava(properties.getProperty("jre.reference")); + this.setTestedJava(properties.getProperty("jre.tested")); + this.setVerboseCompile("true".equals(properties.getProperty("compile.verbose"))); + this.setVerboseRun("true".equals(properties.getProperty("run.verbose"))); + this.setMainWindowWidth(Integer.parseInt(properties.getProperty("mainWindow.width"))); + this.setMainWindowHeight(Integer.parseInt(properties.getProperty("mainWindow.height"))); + this.setSamplesDirectory(properties.getProperty("paths.samplesDirectory")); + this.setOutputDirectory(properties.getProperty("paths.outputDirectory")); + } + + public void writeConfiguration() + { + // Write properties file. + Properties properties = new Properties(); + properties.setProperty("jre.reference", this.getReferenceJava()); + properties.setProperty("jre.tested", this.getTestedJava()); + properties.setProperty("compile.verbose", this.isVerboseCompile() ? "true" : "false"); + properties.setProperty("run.verbose", this.isVerboseRun() ? "true" : "false"); + properties.setProperty("mainWindow.width", "" + this.getMainWindowWidth()); + properties.setProperty("mainWindow.height", "" + this.getMainWindowHeight()); + properties.setProperty("paths.samplesDirectory", this.getSamplesDirectory()); + properties.setProperty("paths.outputDirectory", this.getOutputDirectory()); + + try + { + properties.store(new FileOutputStream(PROPERTIES_FILE_NAME), null); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + + public String getReferenceJava() + { + return this.referenceJava; + } + + public void setReferenceJava(String referenceJava) + { + this.referenceJava = referenceJava; + } + + public String getTestedJava() + { + return this.testedJava; + } + + public void setTestedJava(String testedJava) + { + this.testedJava = testedJava; + } + + public boolean isVerboseCompile() + { + return this.verboseCompile; + } + + public void setVerboseCompile(boolean verboseCompile) + { + this.verboseCompile = verboseCompile; + } + + public boolean isVerboseRun() + { + return this.verboseRun; + } + + public void setVerboseRun(boolean verboseRun) + { + this.verboseRun = verboseRun; + } + + public int getMainWindowWidth() + { + return this.mainWindowWidth; + } + + public void setMainWindowWidth(int mainWindowWidth) + { + this.mainWindowWidth = mainWindowWidth; + } + + public int getMainWindowHeight() + { + return this.mainWindowHeight; + } + + public void setMainWindowHeight(int mainWindowHeight) + { + this.mainWindowHeight = mainWindowHeight; + } + + public String getSamplesDirectory() + { + return this.samplesDirectory; + } + + public void setSamplesDirectory(String samplesDirectory) + { + this.samplesDirectory = samplesDirectory; + } + + public String getOutputDirectory() + { + return this.outputDirectory; + } + + public void setOutputDirectory(String outputDirectory) + { + this.outputDirectory = outputDirectory; + } +} diff -r 436d07eb5e5d -r 0e7637965815 src/org/gfxtest/harness/ExternalCommands.java --- a/src/org/gfxtest/harness/ExternalCommands.java Mon Oct 04 17:43:09 2010 +0200 +++ b/src/org/gfxtest/harness/ExternalCommands.java Thu Oct 07 16:34:58 2010 +0200 @@ -95,22 +95,23 @@ public class ExternalCommands return copyFromBufferedReaderToString(stdError); } - private static String constructBuildCommand(String selectedTestSuite) + private static String constructBuildCommand(String selectedTestSuite, boolean verboseOperation) { - return "javac -d " + Paths.BUILD_DIRECTORY + " -sourcepath " + Paths.SOURCE_DIRECTORY + "/ " - + Paths.PATH_TO_TESTSUITES + "/" + selectedTestSuite + ".java"; + return "javac -d " + Paths.BUILD_DIRECTORY + (verboseOperation ? " -verbose " : "") + " -sourcepath " + + Paths.SOURCE_DIRECTORY + "/ " + Paths.PATH_TO_TESTSUITES + "/" + selectedTestSuite + ".java"; } - private static String constructRunCommand(String pathToJava, String selectedTestName, String outputDirectoryForSelectedTest) + private static String constructRunCommand(String pathToJava, String selectedTestName, String outputDirectoryForSelectedTest, boolean verboseOperation) { - return pathToJava + " -cp " + Paths.BUILD_DIRECTORY + " org.gfxtest.testsuites." + selectedTestName + " " - + RUN_OPTIONS + " -o=" + outputDirectoryForSelectedTest; + return pathToJava + (verboseOperation ? " -verbose " : "") + " -cp " + Paths.BUILD_DIRECTORY + + " org.gfxtest.testsuites." + selectedTestName + " " + RUN_OPTIONS + + " -o=" + outputDirectoryForSelectedTest; } - public static String compileSelectedTestSuite(String selectedTestSuite) throws IOException, InterruptedException, RuntimeException + public static String compileSelectedTestSuite(String selectedTestSuite, boolean verboseOperation) throws IOException, InterruptedException, RuntimeException { FileSystemTools.createDirectory(Paths.BUILD_DIRECTORY); - String compilationCommand = constructBuildCommand(selectedTestSuite); + String compilationCommand = constructBuildCommand(selectedTestSuite, verboseOperation); Process process = Runtime.getRuntime().exec(compilationCommand); StringBuffer output = new StringBuffer(); @@ -136,13 +137,13 @@ public class ExternalCommands return output.toString(); } - public static String runTestOnGivenJDK(String pathToJava, String selectedTestName, String outputDirectory) throws IOException, InterruptedException, RuntimeException + public static String runTestOnGivenJDK(String pathToJava, String selectedTestName, String outputDirectory, boolean verboseOperation) throws IOException, InterruptedException, RuntimeException { String outputDirectoryForSelectedTest = FileSystemTools.constructTestDirectoryName(outputDirectory, selectedTestName); FileSystemTools.createDirectory(outputDirectory); FileSystemTools.createDirectory(outputDirectoryForSelectedTest); FileSystemTools.eraseDirectory(outputDirectoryForSelectedTest); - String runCommand = constructRunCommand(pathToJava, selectedTestName, outputDirectoryForSelectedTest); + String runCommand = constructRunCommand(pathToJava, selectedTestName, outputDirectoryForSelectedTest, verboseOperation); Process process = Runtime.getRuntime().exec(runCommand); StringBuffer output = new StringBuffer(); diff -r 436d07eb5e5d -r 0e7637965815 src/org/gfxtest/harness/MainWindow.java --- a/src/org/gfxtest/harness/MainWindow.java Mon Oct 04 17:43:09 2010 +0200 +++ b/src/org/gfxtest/harness/MainWindow.java Thu Oct 07 16:34:58 2010 +0200 @@ -71,14 +71,7 @@ public class MainWindow public class MainWindow { private static final String WINDOW_TITLE = "Gfx test harness"; - private static final int DEFAULT_WINDOW_WIDTH = 1024; - private static final int DEFAULT_WINDOW_HEIGHT = 768; - private static final String SAMPLES_DIRECTORY = "samples"; - private static final String OUTPUT_DIRECTORY = "output"; - - private String referenceJava = "/usr/lib/jvm/java/bin/java"; - private String testedJava = "/usr/lib/jvm/java/bin/java"; DefaultListModel testList = new DefaultListModel(); DefaultTableModel resultTable = new DefaultTableModel(new String[] @@ -96,13 +89,23 @@ public class MainWindow private JLabel bottomLeftLabel = new JLabel("difference"); private JLabel bottomRightLabel = new JLabel("test image"); private Dialogs dialogs = null; + private Configuration configuration = null; private boolean tableIsErasing; - private JMenuBar createMainMenu() + private JMenuBar createMainMenuBar() { JMenuBar mainMenu = new JMenuBar(); + mainMenu.add(createMenuFile()); + mainMenu.add(createMenuConfigure()); + mainMenu.add(createMenuView()); + mainMenu.add(createMenuZoom()); + mainMenu.add(createMenuHelp()); + return mainMenu; + } + private JMenu createMenuFile() + { JMenu fileMenu = new JMenu("File"); fileMenu.setMnemonic(KeyEvent.VK_F); @@ -117,23 +120,35 @@ public class MainWindow } }); fileMenu.add(fileMenuQuit); + return fileMenu; + } - mainMenu.add(fileMenu); - + private JMenu createMenuConfigure() + { JMenu configureMenu = new JMenu("Configure"); configureMenu.setMnemonic(KeyEvent.VK_C); - mainMenu.add(configureMenu); + return configureMenu; + } + private JMenu createMenuView() + { JMenu viewMenu = new JMenu("View"); viewMenu.setMnemonic(KeyEvent.VK_V); - mainMenu.add(viewMenu); + return viewMenu; + } + private JMenu createMenuZoom() + { JMenu zoomMenu = new JMenu("Zoom"); zoomMenu.setMnemonic(KeyEvent.VK_Z); - mainMenu.add(zoomMenu); + return zoomMenu; + } + private JMenu createMenuHelp() + { JMenu helpMenu = new JMenu("Help"); helpMenu.setMnemonic(KeyEvent.VK_H); + JMenuItem fileHelpAbout = new JMenuItem("About", KeyEvent.VK_A); fileHelpAbout.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, ActionEvent.CTRL_MASK)); fileHelpAbout.addActionListener(new ActionListener() @@ -146,9 +161,7 @@ public class MainWindow }); helpMenu.add(fileHelpAbout); - mainMenu.add(helpMenu); - - return mainMenu; + return helpMenu; } private GridBagConstraints constraints(int gridx, int gridy, int gridWidth, int gridHeight, double weightx, double weighty, int fill) @@ -257,7 +270,7 @@ public class MainWindow window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - window.setJMenuBar(createMainMenu()); + window.setJMenuBar(createMainMenuBar()); JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); horizontalSplitPane.setOneTouchExpandable(true); @@ -301,7 +314,7 @@ public class MainWindow window.getContentPane().add(horizontalSplitPane); // Display the window. - window.setSize(DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT); + window.setSize(this.configuration.getMainWindowWidth(), this.configuration.getMainWindowHeight()); window.setVisible(true); this.setMainWindow(window); } @@ -359,8 +372,8 @@ public class MainWindow { String testName = this.selectedTestSuite + "_" + this.resultTable.getValueAt(selectedIndex, 0).toString() + ".png"; - String sampleFileName = FileSystemTools.constructTestDirectoryName(SAMPLES_DIRECTORY, this.selectedTestSuite); - String testFileName = FileSystemTools.constructTestDirectoryName(OUTPUT_DIRECTORY, this.selectedTestSuite); + String sampleFileName = FileSystemTools.constructTestDirectoryName(this.configuration.getOutputDirectory(), this.selectedTestSuite); + String testFileName = FileSystemTools.constructTestDirectoryName(this.configuration.getOutputDirectory(), this.selectedTestSuite); File sampleImageFile = new File(sampleFileName, testName); if (sampleImageFile.exists() && sampleImageFile.isFile()) @@ -450,8 +463,8 @@ public class MainWindow private void refreshTestResults(String selectedTestName) { eraseResultTable(); - Set samples = getResultList(SAMPLES_DIRECTORY, selectedTestName); - Set output = getResultList(OUTPUT_DIRECTORY, selectedTestName); + Set samples = getResultList(this.configuration.getSamplesDirectory(), selectedTestName); + Set output = getResultList(this.configuration.getOutputDirectory(), selectedTestName); Set allResults = new TreeSet(); allResults.addAll(samples); allResults.addAll(output); @@ -488,7 +501,7 @@ public class MainWindow } try { - String output = ExternalCommands.compileSelectedTestSuite(this.selectedTestSuite); + String output = ExternalCommands.compileSelectedTestSuite(this.selectedTestSuite, this.configuration.isVerboseCompile()); this.resultTextArea.setText(output); } catch (IOException e) @@ -514,9 +527,9 @@ public class MainWindow } try { - String output = ExternalCommands.runTestOnGivenJDK(this.referenceJava, this.selectedTestSuite, SAMPLES_DIRECTORY); + String output = ExternalCommands.runTestOnGivenJDK(this.configuration.getReferenceJava(), this.selectedTestSuite, this.configuration.getSamplesDirectory(), this.configuration.isVerboseRun()); this.resultTextArea.setText(output); - output = ExternalCommands.runTestOnGivenJDK(this.testedJava, this.selectedTestSuite, OUTPUT_DIRECTORY); + output = ExternalCommands.runTestOnGivenJDK(this.configuration.getTestedJava(), this.selectedTestSuite, this.configuration.getOutputDirectory(), this.configuration.isVerboseRun()); this.resultTextArea.append(output); } catch (IllegalThreadStateException e) @@ -540,6 +553,9 @@ public class MainWindow private void runTestHarness() { + this.configuration = new Configuration(); + this.configuration.readConfiguration(); + refreshTestList(); // Schedule a job for the event-dispatching thread: From bugzilla-daemon at icedtea.classpath.org Thu Oct 7 07:43:34 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 07 Oct 2010 14:43:34 +0000 Subject: [Bug 565] UIDefaults.getUI fails with jgoodies:looks 2.3.1 Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=565 omajid at redhat.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at icedtea.classpath|omajid at redhat.com |.org | Status|NEW |ASSIGNED ------- Comment #3 from omajid at redhat.com 2010-10-07 14:43 ------- Created an attachment (id=427) --> (http://icedtea.classpath.org/bugzilla/attachment.cgi?id=427&action=view) create the applet threadgroup eralier -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. You are the assignee for the bug, or are watching the assignee. From ptisnovs at icedtea.classpath.org Thu Oct 7 08:24:53 2010 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Thu, 07 Oct 2010 15:24:53 +0000 Subject: /hg/gfx-test: Added new functionality to gfx. test harness: user... Message-ID: changeset faa962e7e25b in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=faa962e7e25b author: Pavel Tisnovsky date: Thu Oct 07 17:25:10 2010 +0200 Added new functionality to gfx. test harness: users can now change paths to reference JRE and tested JRE from GUI, setup basic compile and run options and also load/store configuration from/to property file. diffstat: 5 files changed, 175 insertions(+), 6 deletions(-) Makefile | 4 gfx_harness.properties | 2 src/org/gfxtest/harness/Configuration.java | 24 ++++- src/org/gfxtest/harness/Dialogs.java | 24 +++++ src/org/gfxtest/harness/MainWindow.java | 127 ++++++++++++++++++++++++++++ diffs (274 lines): diff -r 0e7637965815 -r faa962e7e25b Makefile --- a/Makefile Thu Oct 07 16:34:58 2010 +0200 +++ b/Makefile Thu Oct 07 17:25:10 2010 +0200 @@ -231,7 +231,7 @@ harness: gfxtest.jar harness: gfxtest.jar java -cp gfxtest.jar org.gfxtest.harness.MainWindow -cleanall: clean clean-output clean-results clean-samples +cleanall: clean clean-output clean-results clean-samples clean-test-build clean-all: cleanall @@ -244,6 +244,8 @@ clean-output: clean-output: rm -rf $(OUTPUT) +clean-test-build: + clean-results: rm -rf $(RESULTS) diff -r 0e7637965815 -r faa962e7e25b gfx_harness.properties --- a/gfx_harness.properties Thu Oct 07 16:34:58 2010 +0200 +++ b/gfx_harness.properties Thu Oct 07 17:25:10 2010 +0200 @@ -1,4 +1,4 @@ -#Thu Oct 07 15:15:51 CEST 2010 +#Thu Oct 07 17:05:19 CEST 2010 paths.samplesDirectory=samples paths.outputDirectory=output compile.verbose=false diff -r 0e7637965815 -r faa962e7e25b src/org/gfxtest/harness/Configuration.java --- a/src/org/gfxtest/harness/Configuration.java Thu Oct 07 16:34:58 2010 +0200 +++ b/src/org/gfxtest/harness/Configuration.java Thu Oct 07 17:25:10 2010 +0200 @@ -89,8 +89,10 @@ public class Configuration e.printStackTrace(); } - public void readConfiguration() + public boolean readConfiguration() { + boolean result = true; + // Read properties file. Properties properties = new Properties(); try @@ -99,11 +101,13 @@ public class Configuration } catch (FileNotFoundException e) { + result = false; this.printErrorMessage(e); this.setDefaultValues(); } catch (IOException e) { + result = false; this.printErrorMessage(e); this.setDefaultValues(); } @@ -111,14 +115,24 @@ public class Configuration this.setTestedJava(properties.getProperty("jre.tested")); this.setVerboseCompile("true".equals(properties.getProperty("compile.verbose"))); this.setVerboseRun("true".equals(properties.getProperty("run.verbose"))); - this.setMainWindowWidth(Integer.parseInt(properties.getProperty("mainWindow.width"))); - this.setMainWindowHeight(Integer.parseInt(properties.getProperty("mainWindow.height"))); + try + { + this.setMainWindowWidth(Integer.parseInt(properties.getProperty("mainWindow.width"))); + this.setMainWindowHeight(Integer.parseInt(properties.getProperty("mainWindow.height"))); + } + catch (NumberFormatException e) + { + System.err.println("warning: can't read integer value from property file"); + } this.setSamplesDirectory(properties.getProperty("paths.samplesDirectory")); this.setOutputDirectory(properties.getProperty("paths.outputDirectory")); + return result; } - public void writeConfiguration() + public boolean writeConfiguration() { + boolean result = true; + // Write properties file. Properties properties = new Properties(); properties.setProperty("jre.reference", this.getReferenceJava()); @@ -136,8 +150,10 @@ public class Configuration } catch (IOException e) { + result = false; e.printStackTrace(); } + return result; } public String getReferenceJava() diff -r 0e7637965815 -r faa962e7e25b src/org/gfxtest/harness/Dialogs.java --- a/src/org/gfxtest/harness/Dialogs.java Thu Oct 07 16:34:58 2010 +0200 +++ b/src/org/gfxtest/harness/Dialogs.java Thu Oct 07 17:25:10 2010 +0200 @@ -90,4 +90,28 @@ public class Dialogs { this.infoMessage(ABOUT_TEXT); } + + public void showDialogAfterLoadConfiguration(boolean result) + { + if (result) + { + this.infoMessage("Configuration successfully loaded"); + } + else + { + this.errorMessage("Error occured during configuration loading!"); + } + } + + public void showDialogAfterSaveConfiguration(boolean result) + { + if (result) + { + this.infoMessage("Configuration successfully saved"); + } + else + { + this.errorMessage("Error occured during configuration saving!"); + } + } } diff -r 0e7637965815 -r faa962e7e25b src/org/gfxtest/harness/MainWindow.java --- a/src/org/gfxtest/harness/MainWindow.java Thu Oct 07 16:34:58 2010 +0200 +++ b/src/org/gfxtest/harness/MainWindow.java Thu Oct 07 17:25:10 2010 +0200 @@ -127,6 +127,81 @@ public class MainWindow { JMenu configureMenu = new JMenu("Configure"); configureMenu.setMnemonic(KeyEvent.VK_C); + + JCheckBoxMenuItem verboseCompilation = new JCheckBoxMenuItem("Verbose compilation", this.configuration.isVerboseCompile()); + verboseCompilation.setHorizontalTextPosition(SwingConstants.RIGHT); + verboseCompilation.addItemListener(new ItemListener() + { + @Override + public void itemStateChanged(ItemEvent e) + { + onCompilationVerboseCheckBoxChanged(e.getStateChange() == ItemEvent.SELECTED); + } + }); + configureMenu.add(verboseCompilation); + + JCheckBoxMenuItem verboseTestRun = new JCheckBoxMenuItem("Verbose test run", this.configuration.isVerboseRun()); + verboseTestRun.setHorizontalTextPosition(SwingConstants.RIGHT); + verboseTestRun.addItemListener(new ItemListener() + { + @Override + public void itemStateChanged(ItemEvent e) + { + onTestRunVerboseCheckBoxChanged(e.getStateChange() == ItemEvent.SELECTED); + } + }); + configureMenu.add(verboseTestRun); + + configureMenu.addSeparator(); + + JMenuItem referenceJava = new JMenuItem("Path to reference JRE"); + referenceJava.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, ActionEvent.CTRL_MASK)); + referenceJava.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + onSetReferenceJavaMenuItemSelected(); + } + }); + configureMenu.add(referenceJava); + + JMenuItem testedJava = new JMenuItem("Path to tested JRE"); + testedJava.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, ActionEvent.CTRL_MASK)); + testedJava.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + onSetTestedJavaMenuItemSelected(); + } + }); + configureMenu.add(testedJava); + + configureMenu.addSeparator(); + + JMenuItem loadConfiguration = new JMenuItem("Load configuration"); + loadConfiguration.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + onLoadConfigurationMenuItemSelected(); + } + }); + configureMenu.add(loadConfiguration); + + JMenuItem saveConfiguration = new JMenuItem("Save configuration"); + saveConfiguration.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + onSaveConfigurationMenuItemSelected(); + } + }); + configureMenu.add(saveConfiguration); + return configureMenu; } @@ -487,6 +562,58 @@ public class MainWindow this.tableIsErasing = false; } + protected void onCompilationVerboseCheckBoxChanged(boolean verboseCompile) + { + this.configuration.setVerboseCompile(verboseCompile); + } + + protected void onTestRunVerboseCheckBoxChanged(boolean verboseRun) + { + this.configuration.setVerboseRun(verboseRun); + } + + private String selectPathToJava(String oldPath, String message) + { + JFileChooser fc = new JFileChooser(new File(oldPath)); + fc.setDialogTitle(message); + if (fc.showOpenDialog(this.mainWindow) == JFileChooser.APPROVE_OPTION) + { + File file = fc.getSelectedFile(); + System.out.println("selected path: " + file.toString()); + return file.getAbsolutePath(); + } + return null; + } + + protected void onSetReferenceJavaMenuItemSelected() + { + String selectedPath = selectPathToJava(this.configuration.getReferenceJava(), + "Path to reference JRE (to file java)"); + if (selectedPath != null) + { + this.configuration.setReferenceJava(selectedPath); + } + } + + protected void onSetTestedJavaMenuItemSelected() + { + String selectedPath = selectPathToJava(this.configuration.getTestedJava(), "Path to tested JRE (to file java)"); + if (selectedPath != null) + { + this.configuration.setTestedJava(selectedPath); + } + } + + protected void onLoadConfigurationMenuItemSelected() + { + this.dialogs.showDialogAfterLoadConfiguration(this.configuration.readConfiguration()); + } + + protected void onSaveConfigurationMenuItemSelected() + { + this.dialogs.showDialogAfterSaveConfiguration(this.configuration.writeConfiguration()); + } + protected void onHelpAboutMenuSelected() { this.dialogs.showAboutDialog(); From ptisnovs at icedtea.classpath.org Thu Oct 7 09:24:28 2010 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Thu, 07 Oct 2010 16:24:28 +0000 Subject: /hg/gfx-test: Added support for displaying differences between t... Message-ID: changeset 9e7e2cc488e3 in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=9e7e2cc488e3 author: Pavel Tisnovsky date: Thu Oct 07 18:24:55 2010 +0200 Added support for displaying differences between test and sample images in gfx. test harness GUI. diffstat: 3 files changed, 71 insertions(+), 34 deletions(-) Makefile | 2 src/org/gfxtest/ImageDiffer/Configuration.java | 5 + src/org/gfxtest/harness/MainWindow.java | 98 +++++++++++++++--------- diffs (153 lines): diff -r faa962e7e25b -r 9e7e2cc488e3 Makefile --- a/Makefile Thu Oct 07 17:25:10 2010 +0200 +++ b/Makefile Thu Oct 07 18:24:55 2010 +0200 @@ -41,6 +41,7 @@ OUTPUT=output OUTPUT=output SAMPLES=samples RESULTS=results +TEST_BUILD=test-build COMMON_DIR=org/gfxtest/common FRAMEWORK_DIR=org/gfxtest/framework @@ -245,6 +246,7 @@ clean-output: rm -rf $(OUTPUT) clean-test-build: + rm -rf $(TEST_BUILD) clean-results: rm -rf $(RESULTS) diff -r faa962e7e25b -r 9e7e2cc488e3 src/org/gfxtest/ImageDiffer/Configuration.java --- a/src/org/gfxtest/ImageDiffer/Configuration.java Thu Oct 07 17:25:10 2010 +0200 +++ b/src/org/gfxtest/ImageDiffer/Configuration.java Thu Oct 07 18:24:55 2010 +0200 @@ -71,6 +71,11 @@ public class Configuration private boolean writeStructDiffImages = false; private Log log = null; + + public Configuration() + { + this.log = new Log(this.getClass().getName(), true); + } public Configuration(String args[]) { diff -r faa962e7e25b -r 9e7e2cc488e3 src/org/gfxtest/harness/MainWindow.java --- a/src/org/gfxtest/harness/MainWindow.java Thu Oct 07 17:25:10 2010 +0200 +++ b/src/org/gfxtest/harness/MainWindow.java Thu Oct 07 18:24:55 2010 +0200 @@ -54,6 +54,9 @@ import javax.swing.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.table.DefaultTableModel; + +import org.gfxtest.ImageDiffer.ComparisonResult; +import org.gfxtest.ImageDiffer.ImageComparator; /** * Main window code and basic application logic for graphic test harness. @@ -449,44 +452,71 @@ public class MainWindow + ".png"; String sampleFileName = FileSystemTools.constructTestDirectoryName(this.configuration.getOutputDirectory(), this.selectedTestSuite); String testFileName = FileSystemTools.constructTestDirectoryName(this.configuration.getOutputDirectory(), this.selectedTestSuite); - - File sampleImageFile = new File(sampleFileName, testName); - if (sampleImageFile.exists() && sampleImageFile.isFile()) - { - BufferedImage sampleImage; - try - { - sampleImage = ImageIO.read(new File(sampleFileName, testName)); - this.topRightLabel.setIcon(new ImageIcon(sampleImage)); - this.topRightLabel.setText(""); - } - catch (IOException e) - { - e.printStackTrace(); - this.topRightLabel.setText(e.getMessage()); - } - } - - File testImageFile = new File(testFileName, testName); - if (testImageFile.exists() && testImageFile.isFile()) - { - BufferedImage testImage; - try - { - testImage = ImageIO.read(new File(testFileName, testName)); - this.bottomRightLabel.setIcon(new ImageIcon(testImage)); - this.bottomRightLabel.setText(""); - } - catch (IOException e) - { - e.printStackTrace(); - this.bottomRightLabel.setText(e.getMessage()); - } - } + BufferedImage sampleImage = loadAndShowSampleImage(testName, sampleFileName); + BufferedImage testImage = loadAndShowTestImage(testName, testFileName); + computeAndShowImagesDifference(testName, sampleImage, testImage); /* * JOptionPane.showMessageDialog(this.mainWindow, "Selected test: " * + testName, WINDOW_TITLE, JOptionPane.INFORMATION_MESSAGE); */ + } + } + + private BufferedImage loadAndShowTestImage(String testName, String testFileName) + { + BufferedImage testImage = null; + File testImageFile = new File(testFileName, testName); + if (testImageFile.exists() && testImageFile.isFile()) + { + try + { + testImage = ImageIO.read(new File(testFileName, testName)); + this.bottomRightLabel.setIcon(new ImageIcon(testImage)); + this.bottomRightLabel.setText(""); + } + catch (IOException e) + { + e.printStackTrace(); + this.bottomRightLabel.setText(e.getMessage()); + } + } + return testImage; + } + + private BufferedImage loadAndShowSampleImage(String testName, String sampleFileName) + { + BufferedImage sampleImage = null; + File sampleImageFile = new File(sampleFileName, testName); + if (sampleImageFile.exists() && sampleImageFile.isFile()) + { + try + { + sampleImage = ImageIO.read(new File(sampleFileName, testName)); + this.topRightLabel.setIcon(new ImageIcon(sampleImage)); + this.topRightLabel.setText(""); + } + catch (IOException e) + { + e.printStackTrace(); + this.topRightLabel.setText(e.getMessage()); + } + } + return sampleImage; + } + + private void computeAndShowImagesDifference(String testName, BufferedImage sampleImage, BufferedImage testImage) + { + if (testImage != null && sampleImage != null) + { + ImageComparator comparator = new ImageComparator(); + org.gfxtest.ImageDiffer.Configuration cfg = new org.gfxtest.ImageDiffer.Configuration(); + ComparisonResult result = comparator.diffImages(testName, new BufferedImage[] { testImage, sampleImage }, cfg); + this.bottomLeftLabel.setIcon(new ImageIcon(result.getDiffImage())); + this.bottomLeftLabel.setText(""); + } + else + { + this.bottomLeftLabel.setText("difference"); } } From ahughes at redhat.com Thu Oct 7 14:33:12 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Thu, 7 Oct 2010 22:33:12 +0100 Subject: RFC: Netx - implement -Xclearcache command line option In-Reply-To: <4CACEC94.3000701@redhat.com> References: <4CA4EE08.6000007@redhat.com> <20100930203203.GE31194@redhat.com> <4CA4F800.5000306@redhat.com> <20100930212727.GG31194@redhat.com> <4CAA2857.6020105@redhat.com> <4CAB724A.7010202@redhat.com> <20101005231941.GF30285@rivendell.middle-earth.co.uk> <4CAC9DF7.4060801@redhat.com> <20101006184022.GM21949@rivendell.middle-earth.co.uk> <4CACEC94.3000701@redhat.com> Message-ID: <20101007213312.GG3227@rivendell.middle-earth.co.uk> On 17:39 Wed 06 Oct , Omair Majid wrote: snip... > > > > Does it have to be called R and not 'translate' or something more readable? > > > > I am sure we can change it to something more sensible. I was just > sticking with what the rest of Netx uses (there is already a R function > in the same class). Still, I would like to handle that in a separate > patch if it is ok. > > BTW, I am sure you know that a lot of programs use _ as the translate > function. Is _ a valid java identifier? ;) > Yeah, you can use '_', I just checked. I presume you could also use $ but that's usually reserved for autogenerated code. I agree this is something to fix in a different patch. I'm not too familiar with the NetX code so these things come as a surprise to me :-) > >>> Should we really be catching IOExceptions rather than allowing them to propogate? > >>> > >> > >> Catching IOExceptions is just ignoring the errors. So the question is do > >> we want to ignore the errors and continue on or should we stop if we hit > >> any errors. Since the lock file is meant to stop a race condition > >> (between deleting jars and using them) which is not likely to happen, I > >> think an error in lock file creation should be ignored. If for some > >> reason a lock file can not be created, Netx should not abort running the > >> application. If you dont think this makes sense, please let me know and > >> I will change it. > >> > > > > That sounds sensible. I'm just always wary of catch blocks. I've seen them > > used all too often to mask exceptions instead of handling them (including in > > example code used by lecturers!) > > > > Heh. That's true. I think checked exceptions even (sort of) encourage > this. I am afraid of swallowing exceptions too (or worse, handling them > at the wrong level), but in this particular instance it makes sense to > do just that. > Yeah I agree on that score. > Thanks for looking over the changes. > No problem, please commit to the usual quartet of code trees. > Cheers, > Omair -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From omajid at redhat.com Thu Oct 7 14:33:30 2010 From: omajid at redhat.com (Omair Majid) Date: Thu, 07 Oct 2010 17:33:30 -0400 Subject: [RFC] plugin: use an AppContext to support applets running with different look and feels Message-ID: <4CAE3CAA.3050704@redhat.com> Hi, The attached patch is an (updated) attempt to fix PR565 [1]. The patch does two things: 1. It creates a ThreadGroup for the applet earlier in the initialization phase. The applet's intialization code (currently) creates 3 threads (most of this code is in NetxPanel, AppletPanel and Launcher). The first thread is what calls applet.init(), applet.start() etc. It creates the second thread to load the applet (so loading can be interrupted). This second thread is what calls Launcher.launch() which ends up creating the third thread to actually load the applet. This third thread is created in a new ThreadGroup and has the JNLPClassLoader set as the ContextClassLoader. The patch makes sure that all three threads are created in the same ThreadGroup and the appropriate context class loader is set for all of them. This part of the patch is attached to the bug report. With this patch, all the threads of an applet can load the classes for the custom look and feel. 2. Allows different applets to use different look and feels. The patch creates a new AppContext for each applet ThreadGroup. This means that each applet instance can set its own look and feel and not affect any other applet (which might lead to visual inconsistency as well as errors in loading custom look and feels). The AppContext class (part of sun.awt package) contains a map from ThreadGroup to AppContext that Swing and AWT can use to make sure they have the AppContext, which they can then use to index ThreadGroup-specific things like EventQueues and LookAndFeels. ApplicationInstance stores the AppContext for each applet instance, so the correct type of AppContext can be returned by JNLPSecuritymanager when AppContext.getAppContext() calls it to find the current AppContext. I would greatly appreciate it if people can try this patch out. While I have tested with a large number of jnlp files and many applets, it could certainly use more testing. Any and all feedback is welcome! Thanks, Omair [1] http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=565 -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea6-plugin-app-context-01.patch Type: text/x-patch Size: 17158 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101007/b1934850/icedtea6-plugin-app-context-01.patch From omajid at icedtea.classpath.org Fri Oct 8 08:06:49 2010 From: omajid at icedtea.classpath.org (omajid at icedtea.classpath.org) Date: Fri, 08 Oct 2010 15:06:49 +0000 Subject: /hg/icedtea6: netx: add -Xclearcache to clear the cache Message-ID: changeset 4698e476b886 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=4698e476b886 author: Omair Majid date: Fri Oct 08 11:06:14 2010 -0400 netx: add -Xclearcache to clear the cache 2010-10-08 Omair Majid * NEWS: Updated * net/sourceforge/jnlp/Launcher.java: Add fileLock. (launchApplication): Call markNetxRunning and install a shutdown hook for markNetxStopped. (markNetxRunning): New method. (markNetxStopped): New method. * net/sourceforge/jnlp/cache/CacheUtil.java (R): New method. (clearCache): New method. (okToClearCache): New method. * net/sourceforge/jnlp/resources/Messages.properties: Add BXclearcache and CCannotClearCache. * net/sourceforge/jnlp/runtime/Boot.java (run): Clear the cache. * net/sourceforge/jnlp/runtime/JNLPRuntime.java: Add NETX_RUNNING_FILE. * net/sourceforge/jnlp/util/FileUtils.java (recursiveDelete): New method. diffstat: 8 files changed, 229 insertions(+) ChangeLog | 20 +++ NEWS | 1 netx/net/sourceforge/jnlp/Launcher.java | 77 +++++++++++++++ netx/net/sourceforge/jnlp/cache/CacheUtil.java | 71 +++++++++++++ netx/net/sourceforge/jnlp/resources/Messages.properties | 2 netx/net/sourceforge/jnlp/runtime/Boot.java | 13 ++ netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java | 10 + netx/net/sourceforge/jnlp/util/FileUtils.java | 35 ++++++ diffs (387 lines): diff -r f41b0a7fbd70 -r 4698e476b886 ChangeLog --- a/ChangeLog Mon Oct 04 18:13:02 2010 -0400 +++ b/ChangeLog Fri Oct 08 11:06:14 2010 -0400 @@ -1,3 +1,23 @@ 2010-10-04 Paul Ebermann + + * NEWS: Updated + * net/sourceforge/jnlp/Launcher.java: Add fileLock. + (launchApplication): Call markNetxRunning and install a shutdown hook for + markNetxStopped. + (markNetxRunning): New method. + (markNetxStopped): New method. + * net/sourceforge/jnlp/cache/CacheUtil.java + (R): New method. + (clearCache): New method. + (okToClearCache): New method. + * net/sourceforge/jnlp/resources/Messages.properties: Add BXclearcache and + CCannotClearCache. + * net/sourceforge/jnlp/runtime/Boot.java + (run): Clear the cache. + * net/sourceforge/jnlp/runtime/JNLPRuntime.java: Add NETX_RUNNING_FILE. + * net/sourceforge/jnlp/util/FileUtils.java + (recursiveDelete): New method. + 2010-10-04 Paul Ebermann Omair Majid diff -r f41b0a7fbd70 -r 4698e476b886 NEWS --- a/NEWS Mon Oct 04 18:13:02 2010 -0400 +++ b/NEWS Fri Oct 08 11:06:14 2010 -0400 @@ -18,6 +18,7 @@ New in release 1.10 (2010-XX-XX): - S6650759: Inference of formal type parameter (unused in formal parameters) is not performed * Netx - A new man page for javaws. + - Add a new option -Xclearcache * Plugin - PR554: System.err writes content two times - PR556: Applet initialization code is prone to race conditions diff -r f41b0a7fbd70 -r 4698e476b886 netx/net/sourceforge/jnlp/Launcher.java --- a/netx/net/sourceforge/jnlp/Launcher.java Mon Oct 04 18:13:02 2010 -0400 +++ b/netx/net/sourceforge/jnlp/Launcher.java Fri Oct 08 11:06:14 2010 -0400 @@ -20,12 +20,17 @@ import java.applet.Applet; import java.applet.Applet; import java.awt.Container; import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; import java.lang.management.ManagementFactory; import java.lang.management.ThreadMXBean; import java.lang.reflect.Method; import java.net.InetAddress; import java.net.URL; import java.net.UnknownHostException; +import java.nio.channels.FileChannel; +import java.nio.channels.FileLock; import java.util.LinkedList; import java.util.List; import java.util.jar.JarFile; @@ -78,6 +83,9 @@ public class Launcher { /** If the application should call System.exit on fatal errors */ private boolean exitOnFailure = true; + /** a lock which is held to indicate that an instance of netx is running */ + private FileLock fileLock; + /** * Create a launcher with the runtime's default update policy * and launch handler. @@ -127,6 +135,7 @@ public class Launcher { this.handler = handler; this.updatePolicy = policy; + } /** @@ -385,6 +394,11 @@ public class Launcher { if (!file.isApplication()) throw launchError(new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LNotApplication"), R("LNotApplicationInfo"))); + markNetxRunning(); + Runtime.getRuntime().addShutdownHook(new Thread() { + public void run() { markNetxStopped(); } + }); + try { try { @@ -686,6 +700,69 @@ public class Launcher { return null; // chose to continue, or no handler } + /** + * Indicate that netx is running by creating the {@link JNLPRuntime#INSTANCE_FILE} and + * acquiring a shared lock on it + */ + private void markNetxRunning() { + try { + String message = "This file is used to check if netx is running"; + + File netxRunningFile = new File(JNLPRuntime.NETX_RUNNING_FILE); + netxRunningFile.getParentFile().mkdirs(); + if (netxRunningFile.createNewFile()) { + FileOutputStream fos = new FileOutputStream(netxRunningFile); + try { + fos.write(message.getBytes()); + } finally { + fos.close(); + } + } + + if (!netxRunningFile.isFile()) { + if (JNLPRuntime.isDebug()) { + System.err.println("Unable to create instance file"); + } + fileLock = null; + return; + } + + FileInputStream is = new FileInputStream(netxRunningFile); + FileChannel channel = is.getChannel(); + fileLock = channel.tryLock(0, Long.MAX_VALUE, true); + if (fileLock != null && fileLock.isShared()) { + if (JNLPRuntime.isDebug()) { + System.out.println("Acquired shared lock on " + + JNLPRuntime.NETX_RUNNING_FILE + " to indicate javaws is running"); + } + } else { + fileLock = null; + } + } catch (IOException e) { + e.printStackTrace(); + } + + } + + /** + * Indicate that netx is stopped by releasing the shared lock on + * {@link JNLPRuntime#INSTANCE_FILE}. + */ + private void markNetxStopped() { + if (fileLock == null) { + return; + } + try { + fileLock.release(); + fileLock.channel().close(); + fileLock = null; + if (JNLPRuntime.isDebug()) { + System.out.println("Release shared lock on " + JNLPRuntime.NETX_RUNNING_FILE); + } + } catch (IOException e) { + e.printStackTrace(); + } + } /** diff -r f41b0a7fbd70 -r 4698e476b886 netx/net/sourceforge/jnlp/cache/CacheUtil.java --- a/netx/net/sourceforge/jnlp/cache/CacheUtil.java Mon Oct 04 18:13:02 2010 -0400 +++ b/netx/net/sourceforge/jnlp/cache/CacheUtil.java Fri Oct 08 11:06:14 2010 -0400 @@ -19,6 +19,7 @@ package net.sourceforge.jnlp.cache; import java.io.*; import java.net.*; +import java.nio.channels.FileChannel; import java.util.*; import java.lang.reflect.*; import java.security.*; @@ -36,6 +37,10 @@ import net.sourceforge.jnlp.util.FileUti * @version $Revision: 1.17 $ */ public class CacheUtil { + + private static String R(String key) { + return JNLPRuntime.getMessage(key); + } private static String R(String key, Object param) { return JNLPRuntime.getMessage(key, new Object[] {param}); @@ -126,6 +131,72 @@ public class CacheUtil { } return null; + } + + /** + * Clears the cache by deleting all the Netx cache files + * + * Note: Because of how our caching system works, deleting jars of another javaws + * process is using them can be quite disasterous. Hence why Launcher creates lock files + * and we check for those by calling {@link #okToClearCache()} + */ + public static void clearCache() { + + if (!okToClearCache()) { + System.err.println(R("CCannotClearCache")); + return; + } + + File cacheDir = new File(JNLPRuntime.getBaseDir() + File.separator + "cache"); + if (!(cacheDir.isDirectory())) { + return; + } + + if (JNLPRuntime.isDebug()) { + System.err.println("Clearing cache directory: " + cacheDir); + } + try { + FileUtils.recursiveDelete(cacheDir, JNLPRuntime.getBaseDir()); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + /** + * Returns a boolean indicating if it ok to clear the netx application cache at this point + * @return true if the cache can be cleared at this time without problems + */ + private static boolean okToClearCache() { + File otherJavawsRunning = new File(JNLPRuntime.NETX_RUNNING_FILE); + try { + if (otherJavawsRunning.isFile()) { + FileOutputStream fis = new FileOutputStream(otherJavawsRunning); + try { + FileChannel channel = fis.getChannel(); + if (channel.tryLock() == null) { + if (JNLPRuntime.isDebug()) { + System.out.println("Other instances of netx are running"); + } + return false; + } + + if (JNLPRuntime.isDebug()) { + System.out.println("No other instances of netx are running"); + } + return true; + + } finally { + fis.close(); + } + } else { + if (JNLPRuntime.isDebug()) { + System.out.println("No instance file found"); + } + return true; + } + } catch (IOException e) { + return false; + } } /** diff -r f41b0a7fbd70 -r 4698e476b886 netx/net/sourceforge/jnlp/resources/Messages.properties --- a/netx/net/sourceforge/jnlp/resources/Messages.properties Mon Oct 04 18:13:02 2010 -0400 +++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Fri Oct 08 11:06:14 2010 -0400 @@ -139,6 +139,7 @@ BOViewer = Shows the trusted certific BOViewer = Shows the trusted certificate viewer. BOUmask = Sets the umask for files created by an application. BXnofork = Do not create another JVM. +BXclearcache= Clean the JNLP application cache. BOHelp = Print this message and exit. # Cache @@ -149,6 +150,7 @@ CChooseCache=Choose a cache directory... CChooseCache=Choose a cache directory... CChooseCacheInfo=Netx needs a location for storing cache files. CChooseCacheDir=Cache directory +CCannotClearCache=Can not clear cache at this time # Security SFileReadAccess=The application has requested read access to {0}. Do you want to allow this action? diff -r f41b0a7fbd70 -r 4698e476b886 netx/net/sourceforge/jnlp/runtime/Boot.java --- a/netx/net/sourceforge/jnlp/runtime/Boot.java Mon Oct 04 18:13:02 2010 -0400 +++ b/netx/net/sourceforge/jnlp/runtime/Boot.java Fri Oct 08 11:06:14 2010 -0400 @@ -40,6 +40,7 @@ import net.sourceforge.jnlp.ParseExcepti import net.sourceforge.jnlp.ParseException; import net.sourceforge.jnlp.PropertyDesc; import net.sourceforge.jnlp.ResourcesDesc; +import net.sourceforge.jnlp.cache.CacheUtil; import net.sourceforge.jnlp.cache.UpdatePolicy; import net.sourceforge.jnlp.security.VariableX509TrustManager; import net.sourceforge.jnlp.security.viewer.CertificateViewer; @@ -114,6 +115,7 @@ public final class Boot implements Privi + " -strict "+R("BOStrict")+"\n" + " -umask=value "+R("BOUmask")+"\n" + " -Xnofork "+R("BXnofork")+"\n" + + " -Xclearcache "+R("BXclearcache")+"\n" + " -help "+R("BOHelp")+"\n"; private static final String doubleArgs = "-basedir -jnlp -arg -param -property -update"; @@ -201,6 +203,17 @@ public final class Boot implements Privi JNLPRuntime.setBaseDir(getBaseDir()); JNLPRuntime.setSecurityEnabled(null == getOption("-nosecurity")); JNLPRuntime.initialize(true); + + /* + * FIXME + * This should have been done with the rest of the argument parsing + * code. But we need to know what the cache and base directories are, + * and baseDir is initialized here + */ + if (null != getOption("-Xclearcache")) { + CacheUtil.clearCache(); + return null; + } try { new Launcher().launch(getFile()); diff -r f41b0a7fbd70 -r 4698e476b886 netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Mon Oct 04 18:13:02 2010 -0400 +++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Fri Oct 08 11:06:14 2010 -0400 @@ -18,6 +18,7 @@ package net.sourceforge.jnlp.runtime; package net.sourceforge.jnlp.runtime; import java.io.*; +import java.nio.channels.FileLock; import java.awt.*; import java.text.*; import java.util.*; @@ -131,6 +132,15 @@ public class JNLPRuntime { */ public static final String LOCKS_DIR = TMP_DIR + File.separator + USER + File.separator + "netx" + File.separator + "locks"; + + /** + * The /tmp/$USER/netx/locks/netx_running file is used to indicate if any + * instances of netx are running (this file may exist even if no instances + * are running). All netx instances acquire a shared lock on this file. If + * this file can be locked (using a {@link FileLock}) in exclusive mode, then + * other netx instances are not running + */ + public static final String NETX_RUNNING_FILE = LOCKS_DIR + File.separator + "netx_running"; /** the java.home directory */ public static final String JAVA_HOME_DIR = System.getProperty("java.home"); diff -r f41b0a7fbd70 -r 4698e476b886 netx/net/sourceforge/jnlp/util/FileUtils.java --- a/netx/net/sourceforge/jnlp/util/FileUtils.java Mon Oct 04 18:13:02 2010 -0400 +++ b/netx/net/sourceforge/jnlp/util/FileUtils.java Fri Oct 08 11:06:14 2010 -0400 @@ -17,6 +17,9 @@ package net.sourceforge.jnlp.util; package net.sourceforge.jnlp.util; import java.io.File; +import java.io.IOException; + +import net.sourceforge.jnlp.runtime.JNLPRuntime; /** * This class contains a few file-related utility functions. @@ -121,4 +124,36 @@ public final class FileUtils { return prefix + OMITTED + suffix; } + /** + * Recursively delete everything under a directory. Works on either files or + * directories + * + * @param file the file object representing what to delete. Can be either a + * file or a directory. + * @param base the directory under which the file and its subdirectories must be located + * @throws IOException on an io exception or if trying to delete something + * outside the base + */ + public static void recursiveDelete(File file, File base) throws IOException { + if (JNLPRuntime.isDebug()) { + System.err.println("Deleting: " + file); + } + + if (!(file.getCanonicalPath().startsWith(base.getCanonicalPath()))) { + throw new IOException("Trying to delete a file outside Netx's basedir: " + + file.getCanonicalPath()); + } + + if (file.isDirectory()) { + File[] children = file.listFiles(); + for (int i = 0; i < children.length; i++) { + recursiveDelete(children[i], base); + } + } + if (!file.delete()) { + throw new IOException("Unable to delete file: " + file); + } + + } + } From omajid at redhat.com Fri Oct 8 08:11:50 2010 From: omajid at redhat.com (Omair Majid) Date: Fri, 08 Oct 2010 11:11:50 -0400 Subject: RFC: Netx - implement -Xclearcache command line option In-Reply-To: <20101007213312.GG3227@rivendell.middle-earth.co.uk> References: <4CA4EE08.6000007@redhat.com> <20100930203203.GE31194@redhat.com> <4CA4F800.5000306@redhat.com> <20100930212727.GG31194@redhat.com> <4CAA2857.6020105@redhat.com> <4CAB724A.7010202@redhat.com> <20101005231941.GF30285@rivendell.middle-earth.co.uk> <4CAC9DF7.4060801@redhat.com> <20101006184022.GM21949@rivendell.middle-earth.co.uk> <4CACEC94.3000701@redhat.com> <20101007213312.GG3227@rivendell.middle-earth.co.uk> Message-ID: <4CAF34B6.7000006@redhat.com> On 10/07/2010 05:33 PM, Dr Andrew John Hughes wrote: > On 17:39 Wed 06 Oct , Omair Majid wrote: > > snip... > >>> >>> Does it have to be called R and not 'translate' or something more readable? >>> >> >> I am sure we can change it to something more sensible. I was just >> sticking with what the rest of Netx uses (there is already a R function >> in the same class). Still, I would like to handle that in a separate >> patch if it is ok. >> >> BTW, I am sure you know that a lot of programs use _ as the translate >> function. Is _ a valid java identifier? ;) >> > > Yeah, you can use '_', I just checked. I presume you could also use $ but that's usually > reserved for autogenerated code. > > I agree this is something to fix in a different patch. I'm not too familiar > with the NetX code so these things come as a surprise to me :-) > >>>>> Should we really be catching IOExceptions rather than allowing them to propogate? >>>>> >>>> >>>> Catching IOExceptions is just ignoring the errors. So the question is do >>>> we want to ignore the errors and continue on or should we stop if we hit >>>> any errors. Since the lock file is meant to stop a race condition >>>> (between deleting jars and using them) which is not likely to happen, I >>>> think an error in lock file creation should be ignored. If for some >>>> reason a lock file can not be created, Netx should not abort running the >>>> application. If you dont think this makes sense, please let me know and >>>> I will change it. >>>> >>> >>> That sounds sensible. I'm just always wary of catch blocks. I've seen them >>> used all too often to mask exceptions instead of handling them (including in >>> example code used by lecturers!) >>> >> >> Heh. That's true. I think checked exceptions even (sort of) encourage >> this. I am afraid of swallowing exceptions too (or worse, handling them >> at the wrong level), but in this particular instance it makes sense to >> do just that. >> > > Yeah I agree on that score. > >> Thanks for looking over the changes. >> > > No problem, please commit to the usual quartet of code trees. > Thanks. Pushed to icedtea6 HEAD for now. I am going to backport it after it gets a little more testing. Omair, Omair From omajid at redhat.com Fri Oct 8 08:46:42 2010 From: omajid at redhat.com (Omair Majid) Date: Fri, 08 Oct 2010 11:46:42 -0400 Subject: [rfc] netx: do not create unnecessary native directories Message-ID: <4CAF3CE2.2030907@redhat.com> Hi, Netx currently creates one or more directories under /tmp/ to hold native libraries any time it launches an application. The attached patch tries to reduce the clutter caused by these directories. The patch ensures that a directory for holding native files is only created if there are native libraries. The patch also installs a shutdown hook to delete the directory containing the native files. Any thoughts or comments? Cheers, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea6-jnlp-reduce-native-dirs-clutter-01.patch Type: text/x-patch Size: 3195 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101008/c32aa41c/icedtea6-jnlp-reduce-native-dirs-clutter-01.patch From asu at redhat.com Fri Oct 8 12:03:08 2010 From: asu at redhat.com (Andrew Su) Date: Fri, 8 Oct 2010 15:03:08 -0400 (EDT) Subject: [RFC] [Plugin] Stop old applets from popping up. In-Reply-To: <172560858.438171286564527040.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <35407358.438291286564588333.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Hello, Currently when navigating to another page, while the first page is loading applets will cause the applet to popup a new window for display, which is then later closed. This patch tries to prevent this by reordering the order of which plugin handles the messages. It originally takes the first few messages to process, and while there is not enough workers, the messages get scrambled (this was because we wanted to look for priority messages and handle them). How this patch works: -When a message is queued by the Stream Handler, it does a check for which of the 4 queues this message belongs to. (priorityQueue, destroyQueue, handleQueue, otherQueue). --Once the queue has been determines, it appends it to the end of the queue. -When the message consumer tries to get a message, it goes through the different queues checking the size of each. --Rearranging the order which the checks are performed, we can change which type of messages should take precedence. --I have chosen to handle it the following way: Priority, Destroy, Initialization (handle), Other. ---I propose handling Destroy before Initialization because this greatly lowers the possibility of applet windows popping up. ---This led to a few minor changes in another part of the code. (more on this after) -After a message is successfully retrieved, we proceed to handling it. -The consumer now looks for a free worker to process the message, if no messages are found it will simply place it back onto the FRONT of the appropriate queue. Otherwise, proceed. --Reason for this is because we want to handle the message in each queue by seniority. (This sort of keep message order) The minor checked mentioned above are changes to how the PluginAppletViewer handles the destroy and init. -As I proposed earlier, destroy being handled before init. --We add two minor synchronization to where we change the status for an identifier (each identifier represents an applet). ---Within the synchronized code in the initialization, we check if the status has already been set for this identifier. ---If so, that means it has already been initialized (this should never happen), or destroy has been called on it. ---The other synchronized block is when the message is not init. In here we check if the message is Destroy and no status is already assigned. ---If so, we will set it to inactive then proceed. (It will noticed it is already inactive and return) ----This takes care of the initializing of the applet so preventing it from creating the applet after we have already navigated to another page. --Also added checking for inactive applet after parse to prevent exception for applet timeout. (do we need this anymore? If not I shall remove it in another patch) I am aware of the situation where...the applet is already in initialization stage, then destroy gets called. However, this patch will close it immediately after it finished starting up. Questions? Comments? Concerns? Cheers, --Andrew -------------- next part -------------- A non-text attachment was scrubbed... Name: 20101008_fix_old_applet_window_popup.patch Type: text/x-patch Size: 7612 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101008/68ac8a53/20101008_fix_old_applet_window_popup.patch From doko at icedtea.classpath.org Tue Oct 12 04:35:44 2010 From: doko at icedtea.classpath.org (doko at icedtea.classpath.org) Date: Tue, 12 Oct 2010 11:35:44 +0000 Subject: /hg/icedtea6: Makefile.am (stamps/add-netx.stamp): Create target... Message-ID: changeset a18694f7c8fa in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=a18694f7c8fa author: doko at ubuntu.com date: Tue Oct 12 13:32:46 2010 +0200 Makefile.am (stamps/add-netx.stamp): Create target directories. This fails otherwise, when BUILD_* and ALT_*_DIST environment vars are used as with --with-additional-vms=zero. 2010-10-12 Matthias Klose * Makefile.am (stamps/add-netx.stamp): Create target directories. diffstat: 2 files changed, 8 insertions(+), 2 deletions(-) ChangeLog | 4 ++++ Makefile.am | 6 ++++-- diffs (29 lines): diff -r 4698e476b886 -r a18694f7c8fa ChangeLog --- a/ChangeLog Fri Oct 08 11:06:14 2010 -0400 +++ b/ChangeLog Tue Oct 12 13:32:46 2010 +0200 @@ -1,3 +1,7 @@ 2010-10-08 Omair Majid + + * Makefile.am (stamps/add-netx.stamp): Create target directories. + 2010-10-08 Omair Majid * NEWS: Updated diff -r 4698e476b886 -r a18694f7c8fa Makefile.am --- a/Makefile.am Fri Oct 08 11:06:14 2010 -0400 +++ b/Makefile.am Tue Oct 12 13:32:46 2010 +0200 @@ -1386,10 +1386,12 @@ stamps/add-netx.stamp: stamps/netx-dist. $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib cp $(NETX_RESOURCE_DIR)/about.jnlp extra-lib/about.jar \ $(BUILD_OUTPUT_DIR)/j2re-image/lib + mkdir -p $(BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 cp $(NETX_SRCDIR)/javaws.1 \ - $(BUILD_OUTPUT_DIR)/j2sdk-image/man/man1; \ + $(BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 + mkdir -p $(BUILD_OUTPUT_DIR)/j2re-image/man/man1 cp $(NETX_SRCDIR)/javaws.1 \ - $(BUILD_OUTPUT_DIR)/j2re-image/man/man1; \ + $(BUILD_OUTPUT_DIR)/j2re-image/man/man1 touch stamps/add-netx.stamp clean-add-netx: From ahughes at redhat.com Tue Oct 12 05:20:52 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Tue, 12 Oct 2010 13:20:52 +0100 Subject: /hg/icedtea6: Makefile.am (stamps/add-netx.stamp): Create target... In-Reply-To: References: Message-ID: <20101012122052.GA6208@rivendell.middle-earth.co.uk> On 11:35 Tue 12 Oct , doko at icedtea.classpath.org wrote: > changeset a18694f7c8fa in /hg/icedtea6 > details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=a18694f7c8fa > author: doko at ubuntu.com > date: Tue Oct 12 13:32:46 2010 +0200 > > Makefile.am (stamps/add-netx.stamp): Create target directories. > > This fails otherwise, when BUILD_* and ALT_*_DIST environment vars > are used as with --with-additional-vms=zero. > > 2010-10-12 Matthias Klose > > * Makefile.am (stamps/add-netx.stamp): Create target > directories. > > > diffstat: > > 2 files changed, 8 insertions(+), 2 deletions(-) > ChangeLog | 4 ++++ > Makefile.am | 6 ++++-- > > diffs (29 lines): > > diff -r 4698e476b886 -r a18694f7c8fa ChangeLog > --- a/ChangeLog Fri Oct 08 11:06:14 2010 -0400 > +++ b/ChangeLog Tue Oct 12 13:32:46 2010 +0200 > @@ -1,3 +1,7 @@ 2010-10-08 Omair Majid +2010-10-12 Matthias Klose > + > + * Makefile.am (stamps/add-netx.stamp): Create target directories. > + > 2010-10-08 Omair Majid > > * NEWS: Updated > diff -r 4698e476b886 -r a18694f7c8fa Makefile.am > --- a/Makefile.am Fri Oct 08 11:06:14 2010 -0400 > +++ b/Makefile.am Tue Oct 12 13:32:46 2010 +0200 > @@ -1386,10 +1386,12 @@ stamps/add-netx.stamp: stamps/netx-dist. > $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib > cp $(NETX_RESOURCE_DIR)/about.jnlp extra-lib/about.jar \ > $(BUILD_OUTPUT_DIR)/j2re-image/lib > + mkdir -p $(BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 > cp $(NETX_SRCDIR)/javaws.1 \ > - $(BUILD_OUTPUT_DIR)/j2sdk-image/man/man1; \ > + $(BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 > + mkdir -p $(BUILD_OUTPUT_DIR)/j2re-image/man/man1 > cp $(NETX_SRCDIR)/javaws.1 \ > - $(BUILD_OUTPUT_DIR)/j2re-image/man/man1; \ > + $(BUILD_OUTPUT_DIR)/j2re-image/man/man1 > touch stamps/add-netx.stamp > > clean-add-netx: We already discussed this previously; if these directories are not present, it indicates that the JDK has not been built. I think a better solution would be to test if the directory exists, rather than just creating it, so we don't end up with one man page being installed on its own. We also need to cover the add-netx-debug case. -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From doko at ubuntu.com Tue Oct 12 05:28:26 2010 From: doko at ubuntu.com (Matthias Klose) Date: Tue, 12 Oct 2010 14:28:26 +0200 Subject: /hg/icedtea6: Makefile.am (stamps/add-netx.stamp): Create target... In-Reply-To: <20101012122052.GA6208@rivendell.middle-earth.co.uk> References: <20101012122052.GA6208@rivendell.middle-earth.co.uk> Message-ID: <4CB4546A.80404@ubuntu.com> On 12.10.2010 14:20, Dr Andrew John Hughes wrote: > We already discussed this previously; if these directories are not > present, it indicates that the JDK has not been built. yes, that's expected and explicitly configured for --with-additional-vms=zero > I think a better solution would be to test if the directory exists, > rather than just creating it, so we don't end up with one man page > being installed on its own. We also need to cover the add-netx-debug > case. I don't see why checking for the existence of the directory is better. the jar files are installed anyway, just because the lib dir happens to exist? To be consistent you should disable these installations too. the build in zerovm *is* an incomplete build, which is moved into the primary build. Matthias From ahughes at redhat.com Tue Oct 12 05:51:48 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Tue, 12 Oct 2010 13:51:48 +0100 Subject: /hg/icedtea6: Makefile.am (stamps/add-netx.stamp): Create target... In-Reply-To: <4CB4546A.80404@ubuntu.com> References: <20101012122052.GA6208@rivendell.middle-earth.co.uk> <4CB4546A.80404@ubuntu.com> Message-ID: <20101012125148.GE6208@rivendell.middle-earth.co.uk> On 14:28 Tue 12 Oct , Matthias Klose wrote: > On 12.10.2010 14:20, Dr Andrew John Hughes wrote: > > We already discussed this previously; if these directories are not > > present, it indicates that the JDK has not been built. > > yes, that's expected and explicitly configured for --with-additional-vms=zero > > > I think a better solution would be to test if the directory exists, > > rather than just creating it, so we don't end up with one man page > > being installed on its own. We also need to cover the add-netx-debug > > case. > > I don't see why checking for the existence of the directory is better. the jar > files are installed anyway, just because the lib dir happens to exist? To be > consistent you should disable these installations too. > I'm not saying it's ideal, but I think it's better than having an incomplete man directory. I'm not sure how to handle the lib directory issue. Is there a way of determining whether one of these incomplete builds has been done? And how is that different from a screwed up build? My worry with working around the valid-but-incomplete HotSpot build case is we allow through completely broken builds. > the build in zerovm *is* an incomplete build, which is moved into the primary build. Yeah, I didn't realise this. > > Matthias -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From mark at klomp.org Tue Oct 12 07:16:18 2010 From: mark at klomp.org (Mark Wielaard) Date: Tue, 12 Oct 2010 16:16:18 +0200 Subject: Adding cacao and shark to autobuilder (Was: IcedTea6 build failed for a18694f7c8fa) In-Reply-To: References: Message-ID: <1286892978.7611.17.camel@springer.wildebeest.org> The new builder is more powerful and has more room so I got greedy and added both cacao and shark to the autotester script. --with-additional-vms=cacao,shark But as can be seen below the shark/zero part fails when moving the plugin in place. So for now I have disabled shark (the build with cacao enabled succeeded, but tests are still running). I think the issue below is what Matthias and Andrew are discussing right now. So hopefully it will be resolved soon and then I will enable shark in the autobuilder too. On Tue, 2010-10-12 at 13:22 +0000, Mark Wielaard wrote: > The current IcedTea build fails. > [...] > Possibly, but not necessarily, because of one of these changes: > mkdir -p stamps > touch stamps/liveconnect.stamp > if test "xnetscape sun/applet" != x; then \ > (cd /usr/local/build/icedtea6-build/zerovm/liveconnect ; \ > mkdir -p lib ; \ > /usr/local/build/icedtea6-build/zerovm/bootstrap/jdk1.6.0/bin/jar cf lib/classes.jar netscape sun/applet ; \ > cp -pPR -l /usr/local/build/icedtea6/plugin/icedteanp/java src; \ > find src -type f -exec chmod 640 '{}' ';' -o -type d -exec chmod 750 '{}' ';'; \ > cd src ; \ > /usr/bin/zip -qr /usr/local/build/icedtea6-build/zerovm/liveconnect/lib/src.zip netscape sun/applet ) ; \ > fi > mkdir -p stamps > touch stamps/liveconnect-dist.stamp > mkdir -p stamps > touch stamps/plugin.stamp > cp -pPRf /usr/local/build/icedtea6-build/zerovm/plugin/icedteanp/IcedTeaPlugin.so \ > /usr/local/build/icedtea6-build/zerovm/openjdk.build-ecj/j2sdk-image/jre/lib/amd64 > cp: cannot create regular file `/usr/local/build/icedtea6-build/zerovm/openjdk.build-ecj/j2sdk-image/jre/lib/amd64': No such file or directory > make[1]: *** [stamps/add-plugin-ecj.stamp] Error 1 > make[1]: Leaving directory `/usr/local/build/icedtea6-build/zerovm' > make: *** [stamps/add-zero.stamp] Error 2 > > _______________________________________________ > Testresults mailing list > Testresults at icedtea.classpath.org > http://icedtea.classpath.org/mailman/listinfo/testresults From ahughes at redhat.com Tue Oct 12 07:50:10 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Tue, 12 Oct 2010 15:50:10 +0100 Subject: Adding cacao and shark to autobuilder (Was: IcedTea6 build failed for a18694f7c8fa) In-Reply-To: <1286892978.7611.17.camel@springer.wildebeest.org> References: <1286892978.7611.17.camel@springer.wildebeest.org> Message-ID: <20101012145010.GH6208@rivendell.middle-earth.co.uk> On 16:16 Tue 12 Oct , Mark Wielaard wrote: > The new builder is more powerful and has more room so I got greedy and > added both cacao and shark to the autotester script. > --with-additional-vms=cacao,shark > But as can be seen below the shark/zero part fails when moving the > plugin in place. So for now I have disabled shark (the build with cacao > enabled succeeded, but tests are still running). > Shark can be built with --enable-shark. CACAO can be built with --enable-cacao. > I think the issue below is what Matthias and Andrew are discussing right > now. So hopefully it will be resolved soon and then I will enable shark > in the autobuilder too. > > On Tue, 2010-10-12 at 13:22 +0000, Mark Wielaard wrote: > > The current IcedTea build fails. > > [...] > > Possibly, but not necessarily, because of one of these changes: > > mkdir -p stamps > > touch stamps/liveconnect.stamp > > if test "xnetscape sun/applet" != x; then \ > > (cd /usr/local/build/icedtea6-build/zerovm/liveconnect ; \ > > mkdir -p lib ; \ > > /usr/local/build/icedtea6-build/zerovm/bootstrap/jdk1.6.0/bin/jar cf lib/classes.jar netscape sun/applet ; \ > > cp -pPR -l /usr/local/build/icedtea6/plugin/icedteanp/java src; \ > > find src -type f -exec chmod 640 '{}' ';' -o -type d -exec chmod 750 '{}' ';'; \ > > cd src ; \ > > /usr/bin/zip -qr /usr/local/build/icedtea6-build/zerovm/liveconnect/lib/src.zip netscape sun/applet ) ; \ > > fi > > mkdir -p stamps > > touch stamps/liveconnect-dist.stamp > > mkdir -p stamps > > touch stamps/plugin.stamp > > cp -pPRf /usr/local/build/icedtea6-build/zerovm/plugin/icedteanp/IcedTeaPlugin.so \ > > /usr/local/build/icedtea6-build/zerovm/openjdk.build-ecj/j2sdk-image/jre/lib/amd64 > > cp: cannot create regular file `/usr/local/build/icedtea6-build/zerovm/openjdk.build-ecj/j2sdk-image/jre/lib/amd64': No such file or directory > > make[1]: *** [stamps/add-plugin-ecj.stamp] Error 1 > > make[1]: Leaving directory `/usr/local/build/icedtea6-build/zerovm' > > make: *** [stamps/add-zero.stamp] Error 2 > > > > _______________________________________________ > > Testresults mailing list > > Testresults at icedtea.classpath.org > > http://icedtea.classpath.org/mailman/listinfo/testresults > > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From mark at klomp.org Tue Oct 12 07:56:18 2010 From: mark at klomp.org (Mark Wielaard) Date: Tue, 12 Oct 2010 16:56:18 +0200 Subject: Adding cacao and shark to autobuilder (Was: IcedTea6 build failed for a18694f7c8fa) In-Reply-To: <20101012145010.GH6208@rivendell.middle-earth.co.uk> References: <1286892978.7611.17.camel@springer.wildebeest.org> <20101012145010.GH6208@rivendell.middle-earth.co.uk> Message-ID: <1286895378.7611.19.camel@springer.wildebeest.org> On Tue, 2010-10-12 at 15:50 +0100, Dr Andrew John Hughes wrote: > On 16:16 Tue 12 Oct , Mark Wielaard wrote: > > The new builder is more powerful and has more room so I got greedy and > > added both cacao and shark to the autotester script. > > --with-additional-vms=cacao,shark > > But as can be seen below the shark/zero part fails when moving the > > plugin in place. So for now I have disabled shark (the build with cacao > > enabled succeeded, but tests are still running). > > > Shark can be built with --enable-shark. > CACAO can be built with --enable-cacao. I admit to have never tried those options. I though that builds them instead of, I want them in addition. I thought that is why we have --with-additional-vms so you can just switch between them at runtime. Cheers, Mark From mark at klomp.org Tue Oct 12 08:10:10 2010 From: mark at klomp.org (Mark Wielaard) Date: Tue, 12 Oct 2010 17:10:10 +0200 Subject: Adding cacao and shark to autobuilder (Was: IcedTea6 build failed for a18694f7c8fa) In-Reply-To: <1286895378.7611.19.camel@springer.wildebeest.org> References: <1286892978.7611.17.camel@springer.wildebeest.org> <20101012145010.GH6208@rivendell.middle-earth.co.uk> <1286895378.7611.19.camel@springer.wildebeest.org> Message-ID: <1286896210.7611.22.camel@springer.wildebeest.org> On Tue, 2010-10-12 at 16:56 +0200, Mark Wielaard wrote: > On Tue, 2010-10-12 at 15:50 +0100, Dr Andrew John Hughes wrote: > > On 16:16 Tue 12 Oct , Mark Wielaard wrote: > > > The new builder is more powerful and has more room so I got greedy and > > > added both cacao and shark to the autotester script. > > > --with-additional-vms=cacao,shark > > > But as can be seen below the shark/zero part fails when moving the > > > plugin in place. So for now I have disabled shark (the build with cacao > > > enabled succeeded, but tests are still running). > > > > > Shark can be built with --enable-shark. > > CACAO can be built with --enable-cacao. > > I admit to have never tried those options. I though that builds them > instead of, I want them in addition. I thought that is why we have > --with-additional-vms so you can just switch between them at runtime. In fact, it would be nice if there was just one configure flag to select which runtime vms to include. Wouldn't it be possible to just have something like --with-vms=client,server,tiered,cacao,jamvm,zero,shark where each is optional and the default would depend on architecture, defaulting to client and/or server? Cheers, Mark From doko at icedtea.classpath.org Tue Oct 12 13:16:51 2010 From: doko at icedtea.classpath.org (doko at icedtea.classpath.org) Date: Tue, 12 Oct 2010 20:16:51 +0000 Subject: /hg/icedtea6: Fix build failures --with-additional-vms=zero/shark Message-ID: changeset 0e69fee3cd86 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=0e69fee3cd86 author: doko at ubuntu.com date: Tue Oct 12 22:13:50 2010 +0200 Fix build failures --with-additional-vms=zero/shark - Revert the last change - Robustify installation of files into directories, which might not exist - Work around assumptions made by several icedtea components 2010-10-12 Matthias Klose * Makefile.am (stamps/add-plugin.stamp, stamps/add-plugin- debug.stamp, stamps/add-pulseaudio-debug.stamp, stamps/add- plugin-ecj.stamp): Robustify. (ADD_ZERO_CONFIGURE_ARGS): Adjust to new configure flags. (stamps/add-zero.stamp): Explicitly create directories that icedtea components assume to be created by the jdk build (not built in zerovm). diffstat: 2 files changed, 31 insertions(+), 12 deletions(-) ChangeLog | 6 +++++- Makefile.am | 37 ++++++++++++++++++++++++++----------- diffs (117 lines): diff -r a18694f7c8fa -r 0e69fee3cd86 ChangeLog --- a/ChangeLog Tue Oct 12 13:32:46 2010 +0200 +++ b/ChangeLog Tue Oct 12 22:13:50 2010 +0200 @@ -1,6 +1,10 @@ 2010-10-12 Matthias Klose - * Makefile.am (stamps/add-netx.stamp): Create target directories. + * Makefile.am (stamps/add-plugin.stamp, stamps/add-plugin-debug.stamp, + stamps/add-pulseaudio-debug.stamp, stamps/add-plugin-ecj.stamp): Robustify. + (ADD_ZERO_CONFIGURE_ARGS): Adjust to new configure flags. + (stamps/add-zero.stamp): Explicitly create directories that icedtea + components assume to be created by the jdk build (not built in zerovm). 2010-10-08 Omair Majid diff -r a18694f7c8fa -r 0e69fee3cd86 Makefile.am --- a/Makefile.am Tue Oct 12 13:32:46 2010 +0200 +++ b/Makefile.am Tue Oct 12 22:13:50 2010 +0200 @@ -1340,9 +1340,9 @@ stamps/add-plugin.stamp: stamps/plugin.s stamps/add-plugin.stamp: stamps/plugin.stamp stamps/icedtea.stamp if ENABLE_PLUGIN cp -pPRf $(PLUGIN_DIR)/IcedTeaPlugin.so \ - $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR) + $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)/ cp -pPRf $(PLUGIN_DIR)/IcedTeaPlugin.so \ - $(BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR) + $(BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR)/ cp -pPRf $(abs_top_builddir)/liveconnect/lib/classes.jar \ $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/plugin.jar cp -pPRf $(abs_top_builddir)/liveconnect/lib/classes.jar \ @@ -1360,9 +1360,9 @@ stamps/add-plugin-debug.stamp: stamps/pl stamps/add-plugin-debug.stamp: stamps/plugin.stamp stamps/icedtea-debug.stamp if ENABLE_PLUGIN cp -pPRf $(PLUGIN_DIR)/IcedTeaPlugin.so \ - $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR) + $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)/ cp -pPRf $(PLUGIN_DIR)/IcedTeaPlugin.so \ - $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR) + $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR)/ cp -pPRf $(abs_top_builddir)/liveconnect/lib/classes.jar \ $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/plugin.jar cp -pPRf $(abs_top_builddir)/liveconnect/lib/classes.jar \ @@ -1386,10 +1386,8 @@ stamps/add-netx.stamp: stamps/netx-dist. $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib cp $(NETX_RESOURCE_DIR)/about.jnlp extra-lib/about.jar \ $(BUILD_OUTPUT_DIR)/j2re-image/lib - mkdir -p $(BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 cp $(NETX_SRCDIR)/javaws.1 \ $(BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 - mkdir -p $(BUILD_OUTPUT_DIR)/j2re-image/man/man1 cp $(NETX_SRCDIR)/javaws.1 \ $(BUILD_OUTPUT_DIR)/j2re-image/man/man1 touch stamps/add-netx.stamp @@ -1509,9 +1507,9 @@ stamps/add-pulseaudio-debug.stamp: stamp stamps/add-pulseaudio-debug.stamp: stamps/icedtea-debug.stamp $(PULSE_JAVA_TARGET) if ENABLE_PULSE_JAVA cp -pPRf $(PULSE_JAVA_NATIVE_BUILDDIR)/libpulse-java.so \ - $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR) + $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)/ cp -pPRf $(PULSE_JAVA_NATIVE_BUILDDIR)/libpulse-java.so \ - $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR) + $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR)/ cp -pPRf $(PULSE_JAVA_BUILDDIR)/pulse-java.jar \ $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/ext cp -pPRf $(PULSE_JAVA_BUILDDIR)/pulse-java.jar \ @@ -1600,9 +1598,9 @@ stamps/add-plugin-ecj.stamp: stamps/plug stamps/add-plugin-ecj.stamp: stamps/plugin.stamp stamps/icedtea-ecj.stamp if ENABLE_PLUGIN cp -pPRf $(PLUGIN_DIR)/IcedTeaPlugin.so \ - $(ECJ_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR) + $(ECJ_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)/ cp -pPRf $(PLUGIN_DIR)/IcedTeaPlugin.so \ - $(ECJ_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR) + $(ECJ_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR)/ cp -pPRf $(abs_top_builddir)/liveconnect/lib/classes.jar \ $(ECJ_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/plugin.jar cp -pPRf $(abs_top_builddir)/liveconnect/lib/classes.jar \ @@ -2088,7 +2086,7 @@ endif endif ADD_ZERO_CONFIGURE_ARGS += \ --disable-docs \ - $(filter-out '--with-gcj-home=% '--with-ecj=% \ + $(filter-out '--with-jdk-home=% '--with-ecj=% \ '--with-java=% '--with-javah=% \ '--with-rmic=% '--with-additional-vms=% \ '--with-openjdk '--with-openjdk=% , \ @@ -2100,6 +2098,7 @@ ADD_ZERO_CONFIGURE_ARGS += \ $(if $(findstring --with-hotspot-src-zip=, $(CONFIGURE_ARGS)),, \ --with-hotspot-src-zip=$(abs_top_builddir)/$(HOTSPOT_SRC_ZIP)) endif +ADD_ZERO_CONFIGURE_ARGS += --disable-plugin --disable-bootstrap ADD_ZERO_EXTRA_BUILD_ENV = \ BUILD_LANGTOOLS=false ALT_LANGTOOLS_DIST=$(BUILD_OUTPUT_DIR)/langtools/dist \ @@ -2116,6 +2115,22 @@ if ADD_ZERO_BUILD cd zerovm && \ $(ADD_ZERO_EXTRA_BUILD_ENV) \ $(ARCH_PREFIX) $(abs_top_srcdir)/configure $(ADD_ZERO_CONFIGURE_ARGS) + + : # create directories which are expected by icedtea components, + : # implicitly assumed to be created by the jdk build. + mkdir -p $(patsubst $(abs_top_builddir)/%,$(abs_top_builddir)/zerovm/%, \ + $(ECJ_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR) \ + $(ECJ_BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 \ + $(ECJ_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR) \ + $(ECJ_BUILD_OUTPUT_DIR)/j2re-image/man/man1 \ + $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR) \ + $(BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 \ + $(BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR) \ + $(BUILD_OUTPUT_DIR)/j2re-image/man/man1 \ + $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR) \ + $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 \ + $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR) \ + $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/man/man1) $(ADD_ZERO_EXTRA_BUILD_ENV) \ $(ARCH_PREFIX) $(MAKE) -C zerovm $(ICEDTEA_BUILD_TARGET) From ahughes at redhat.com Tue Oct 12 16:18:03 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Wed, 13 Oct 2010 00:18:03 +0100 Subject: [SECURITY] IcedTea6 1.7.5, 1.8.2, 1.9.1 Released! Message-ID: <20101012231802.GO6208@rivendell.middle-earth.co.uk> We are pleased to announce a new set of security releases, IcedTea6 1.7.5, IcedTea6 1.8.2 and IcedTea6 1.9.1. This update contains the following security updates: * S6914943, CVE-2009-3555: TLS: MITM attacks via session renegotiation * S6559775, CVE-2010-3568: OpenJDK Deserialization Race condition * S6891766, CVE-2010-3554: OpenJDK corba reflection vulnerabilities * S6925710, CVE-2010-3562: OpenJDK IndexColorModel double-free * S6938813, CVE-2010-3557: OpenJDK Swing mutable static * S6957564, CVE-2010-3548: OpenJDK DNS server IP address information leak * S6958060, CVE-2010-3564: OpenJDK kerberos vulnerability * S6963023, CVE-2010-3565: OpenJDK JPEG writeImage remote code execution * S6963489, CVE-2010-3566: OpenJDK ICC Profile remote code execution * S6966692, CVE-2010-3569: OpenJDK Serialization inconsistencies * S6622002, CVE-2010-3553: UIDefault.ProxyLazyValue has unsafe reflection usage * S6925672, CVE-2010-3561: Privileged ServerSocket.accept allows receiving connections from any host * S6952017, CVE-2010-3549: HttpURLConnection chunked encoding issue (Http request splitting) * S6952603, CVE-2010-3551: NetworkInterface reveals local network address to untrusted code * S6961084, CVE-2010-3541: limit setting of some request headers in HttpURLConnection * S6963285, CVE-2010-3567: Crash in ICU Opentype layout engine due to mismatch in character counts * S6980004, CVE-2010-3573: limit HTTP request cookie headers in HttpURLConnection * S6981426, CVE-2010-3574: limit use of TRACE method in HttpURLConnection See: http://www.oracle.com/technetwork/topics/security/javacpuoct2010-176258.html The IcedTea project provides a harness to build the source code from OpenJDK6 using Free Software build tools. It also includes the only Free Java plugin and Web Start implementation, and support for additional architectures over and above x86, x86_64 and SPARC via the Zero assembler port. What?s New? ?????? IcedTea6 1.7.5 ============== * Security updates - S6914943, CVE-2009-3555: TLS: MITM attacks via session renegotiation - S6559775, CVE-2010-3568: OpenJDK Deserialization Race condition - S6891766, CVE-2010-3554: OpenJDK corba reflection vulnerabilities - S6925710, CVE-2010-3562: OpenJDK IndexColorModel double-free - S6938813, CVE-2010-3557: OpenJDK Swing mutable static - S6957564, CVE-2010-3548: OpenJDK DNS server IP address information leak - S6958060, CVE-2010-3564: OpenJDK kerberos vulnerability - S6963023, CVE-2010-3565: OpenJDK JPEG writeImage remote code execution - S6963489, CVE-2010-3566: OpenJDK ICC Profile remote code execution - S6966692, CVE-2010-3569: OpenJDK Serialization inconsistencies - S6622002, CVE-2010-3553: UIDefault.ProxyLazyValue has unsafe reflection usage - S6925672, CVE-2010-3561: Privileged ServerSocket.accept allows receiving connections from any host - S6952017, CVE-2010-3549: HttpURLConnection chunked encoding issue (Http request splitting) - S6952603, CVE-2010-3551: NetworkInterface reveals local network address to untrusted code - S6961084, CVE-2010-3541: limit setting of some request headers in HttpURLConnection - S6963285, CVE-2010-3567: Crash in ICU Opentype layout engine due to mismatch in character counts - S6980004, CVE-2010-3573: limit HTTP request cookie headers in HttpURLConnection - S6981426, CVE-2010-3574: limit use of TRACE method in HttpURLConnection - S6990437: Update with correct copyright info for source and test files from SSR10_02 fixes * Fixes - G244901: Skip test_gamma on hardened (PaX-enabled) kernels - G266295: Provide font configuration for Gentoo. - Provide font configuration for RHEL 6. - RH633510: OpenJDK should use NUMA even if glibc doesn't provide it * Backports - S6539464, RH500077: Ensure java.lang.Math functions provide consistent results. - S6951319: enable solaris builds using Sun Studio 12 update 1 (fixes PR398). - S6638712: Inference with wildcard types causes selection of inapplicable method - S6650759: Inference of formal type parameter (unused in formal parameters) is not performed - S6623943: javax.swing.TimerQueue's thread occasionally fails to start * NetX - Fix browser command in BasicService.showDocument(URL) - Run programs that inherit main(String[]) in their main-class - Work with JNLP files that use spec version 1.6 - RH601281: Possible NullPointerException in splash screen code - New man page for javaws * Plugin - RH560193: Fix ziperror when applet jar contained another 0-byte jar - PR519: 100% CPU usage when displaying applets in Webkit based browsers IcedTea6 1.8.2 ============== * Security updates - S6914943, CVE-2009-3555: TLS: MITM attacks via session renegotiation - S6559775, CVE-2010-3568: OpenJDK Deserialization Race condition - S6891766, CVE-2010-3554: OpenJDK corba reflection vulnerabilities - S6925710, CVE-2010-3562: OpenJDK IndexColorModel double-free - S6938813, CVE-2010-3557: OpenJDK Swing mutable static - S6957564, CVE-2010-3548: OpenJDK DNS server IP address information leak - S6958060, CVE-2010-3564: OpenJDK kerberos vulnerability - S6963023, CVE-2010-3565: OpenJDK JPEG writeImage remote code execution - S6963489, CVE-2010-3566: OpenJDK ICC Profile remote code execution - S6966692, CVE-2010-3569: OpenJDK Serialization inconsistencies - S6622002, CVE-2010-3553: UIDefault.ProxyLazyValue has unsafe reflection usage - S6925672, CVE-2010-3561: Privileged ServerSocket.accept allows receiving connections from any host - S6952017, CVE-2010-3549: HttpURLConnection chunked encoding issue (Http request splitting) - S6952603, CVE-2010-3551: NetworkInterface reveals local network address to untrusted code - S6961084, CVE-2010-3541: limit setting of some request headers in HttpURLConnection - S6963285, CVE-2010-3567: Crash in ICU Opentype layout engine due to mismatch in character counts - S6980004, CVE-2010-3573: limit HTTP request cookie headers in HttpURLConnection - S6981426, CVE-2010-3574: limit use of TRACE method in HttpURLConnection - S6990437: Update with correct copyright info for source and test files from SSR10_02 fixes * Fixes: - G244901: Skip test_gamma on hardened (PaX-enabled) kernels - G266295: Provide font configuration for Gentoo. - Provide font configuration for RHEL 6. - RH633510: OpenJDK should use NUMA even if glibc doesn't provide it * Backports: - S6951319: enable solaris builds using Sun Studio 12 update 1 (fixes PR398) - S6539464, RH500077: Ensure java.lang.Math functions provide consistent results. - S6638712: Inference with wildcard types causes selection of inapplicable method - S6650759: Inference of formal type parameter (unused in formal parameters) is not performed - S6623943: javax.swing.TimerQueue's thread occasionally fails to start * NetX: - Fix browser command in BasicService.showDocument(URL) - Run programs that inherit main(String[]) in their main-class - Run JNLP files that use 1.6 as the spec version - RH601281: Possible NullPointerException in splash screen code - New man page for javaws * Plugin - RH560193: Fix ziperror when applet jar contained another 0-byte jar - PR519: 100% CPU usage when displaying applets in Webkit based browsers IcedTea6 1.9.1 ============== * HotSpot 19 supported; use --with-hotspot-build=hs19 to enable. * Security updates - S6914943, CVE-2009-3555: TLS: MITM attacks via session renegotiation - S6559775, CVE-2010-3568: OpenJDK Deserialization Race condition - S6891766, CVE-2010-3554: OpenJDK corba reflection vulnerabilities - S6925710, CVE-2010-3562: OpenJDK IndexColorModel double-free - S6938813, CVE-2010-3557: OpenJDK Swing mutable static - S6957564, CVE-2010-3548: OpenJDK DNS server IP address information leak - S6958060, CVE-2010-3564: OpenJDK kerberos vulnerability - S6963023, CVE-2010-3565: OpenJDK JPEG writeImage remote code execution - S6963489, CVE-2010-3566: OpenJDK ICC Profile remote code execution - S6966692, CVE-2010-3569: OpenJDK Serialization inconsistencies - S6622002, CVE-2010-3553: UIDefault.ProxyLazyValue has unsafe reflection usage - S6925672, CVE-2010-3561: Privileged ServerSocket.accept allows receiving connections from any host - S6952017, CVE-2010-3549: HttpURLConnection chunked encoding issue (Http request splitting) - S6952603, CVE-2010-3551: NetworkInterface reveals local network address to untrusted code - S6961084, CVE-2010-3541: limit setting of some request headers in HttpURLConnection - S6963285, CVE-2010-3567: Crash in ICU Opentype layout engine due to mismatch in character counts - S6980004, CVE-2010-3573: limit HTTP request cookie headers in HttpURLConnection - S6981426, CVE-2010-3574: limit use of TRACE method in HttpURLConnection - S6990437: Update with correct copyright info for source and test files from SSR10_02 fixes * Backports - S6638712: Inference with wildcard types causes selection of inapplicable method - S6650759: Inference of formal type parameter (unused in formal parameters) is not performed - S6623943: javax.swing.TimerQueue's thread occasionally fails to start * Fixes - Fix build failure on S390 - RH633510: OpenJDK should use NUMA even if glibc doesn't provide it * NetX - New man page for javaws * Plugin - PR519: 100% CPU usage when displaying applets in Webkit based browsers The tarballs can be downloaded from: * http://icedtea.classpath.org/download/source/icedtea6-1.7.5.tar.gz * http://icedtea.classpath.org/download/source/icedtea6-1.8.2.tar.gz * http://icedtea.classpath.org/download/source/icedtea6-1.9.1.tar.gz SHA256 sums: 1b62ac07d13f0b3a9acb503aeb38668f40bd9de8e81e0165d5d8e816bf274b4d icedtea6-1.7.5.tar.gz 93d7f427fde99f2df7b457c811405af8311e0bce4192ff99516b3227d5daa716 icedtea6-1.8.2.tar.gz d773a6eb60f560d291206bfdeb83b1da03b79c7c09b7ae53da1877e57ddb3cea icedtea6-1.9.1.tar.gz The following people helped with these releases: Deepak Bhole, Andrew John Hughes, Matthias Klose, Omair Majid, Man Lung Wong, Andrew Su, Pavel Tisnovsky, Jiri Vanek We would also like to thank the bug reporters and testers! To get started: $ tar xzf icedtea6-.tar.gz $ cd icedtea6- Full build requirements and instructions are in INSTALL: $ ./configure [--enable-zero --with-openjdk --enable-pulse-java --enable-systemtap ...] $ make -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From andrew at icedtea.classpath.org Tue Oct 12 16:19:13 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 12 Oct 2010 23:19:13 +0000 Subject: /hg/release/icedtea6-1.7: 9 new changesets Message-ID: changeset b5086c3910b3 in /hg/release/icedtea6-1.7 details: http://icedtea.classpath.org/hg/release/icedtea6-1.7?cmd=changeset;node=b5086c3910b3 author: Andrew John Hughes date: Tue Oct 05 15:57:31 2010 +0100 Security updates. 2010-10-05 Andrew John Hughes * Makefile.am: Add new patches. * NEWS: List security updates. * patches/security/20101012/6559775.patch, * patches/security/20101012/6891766.patch, * patches/security/20101012/6914943.patch, * patches/security/20101012/6925710.patch, * patches/security/20101012/6938813.patch, * patches/security/20101012/6957564.patch, * patches/security/20101012/6958060.patch, * patches/security/20101012/6963023.patch, * patches/security/20101012/6963489.patch, * patches/security/20101012/6966692.patch: New security patches. changeset 943f33237d51 in /hg/release/icedtea6-1.7 details: http://icedtea.classpath.org/hg/release/icedtea6-1.7?cmd=changeset;node=943f33237d51 author: Andrew John Hughes date: Tue Oct 05 16:01:23 2010 +0100 Bump to 1.7.5pre. 2010-10-05 Andrew John Hughes * configure.ac: Bump to 1.7.5pre. changeset 7215a5763a4e in /hg/release/icedtea6-1.7 details: http://icedtea.classpath.org/hg/release/icedtea6-1.7?cmd=changeset;node=7215a5763a4e author: Andrew John Hughes date: Wed Oct 06 16:27:10 2010 +0100 Bump to 1.7.5 and set date of release to 2010-10-13. 2010-10-06 Andrew John Hughes * configure.ac: Bump to 1.7.5. * NEWS: Set date of 1.7.5 to 2010-10-13. changeset 3dbe18286f7a in /hg/release/icedtea6-1.7 details: http://icedtea.classpath.org/hg/release/icedtea6-1.7?cmd=changeset;node=3dbe18286f7a author: Andrew John Hughes date: Thu Oct 07 14:10:27 2010 +0100 Apply HotSpot patches before conditional patches. 2010-10-07 Andrew John Hughes * Makefile.am: Move HotSpot patches up so they aren't affected by conditional patches. * patches/icedtea-systemtap.patch: Fix to apply after the hs16 sparc patch. changeset a6202fb4b8c4 in /hg/release/icedtea6-1.7 details: http://icedtea.classpath.org/hg/release/icedtea6-1.7?cmd=changeset;node=a6202fb4b8c4 author: Andrew John Hughes date: Fri Oct 08 00:46:01 2010 +0100 Fix SystemTap patch to work on both hs16 and original builds. 2010-10-07 Andrew John Hughes * patches/icedtea-systemtap.patch: Split patch into hs16 and original versions. * Makefile.am: Use a hsbuild-specific version of the systemtap patch. * patches/hotspot/hs16/systemtap.patch: SystemTap patch from last checkin. * patches/hotspot/original/systemtap.patch: SystemTap patch prior to last checkin. changeset 1cdd796efef3 in /hg/release/icedtea6-1.7 details: http://icedtea.classpath.org/hg/release/icedtea6-1.7?cmd=changeset;node=1cdd796efef3 author: Andrew John Hughes date: Mon Oct 11 21:52:05 2010 +0100 Second batch of security updates. 2010-10-11 Andrew John Hughes * patches/icedtea-timerqueue.patch: Dropped; superceded by 6623943. * Makefile.am: Add new security patches. * NEWS: List new security patches. * patches/security/20101012/6622002.patch, * patches/security/20101012/6623943.patch, * patches/security/20101012/6952017.patch, * patches/security/20101012/6952603.patch, * patches/security/20101012/6961084.patch, * patches/security/20101012/6963285.patch, * patches/security/20101012/6981426.patch, * patches/security/20101012/6990437.patch: Added. changeset 1c4624a3afe8 in /hg/release/icedtea6-1.7 details: http://icedtea.classpath.org/hg/release/icedtea6-1.7?cmd=changeset;node=1c4624a3afe8 author: andrew date: Mon Oct 11 22:31:47 2010 +0100 Add CVE numbers. 2010-10-11 Andrew John Hughes * NEWS: Add CVE numbers and list 6925672 which is covered by the 6891766 fix. changeset 9f1417fbbb12 in /hg/release/icedtea6-1.7 details: http://icedtea.classpath.org/hg/release/icedtea6-1.7?cmd=changeset;node=9f1417fbbb12 author: Andrew John Hughes date: Tue Oct 12 18:01:47 2010 +0100 Add man page for javaws. 2010-10-12 Andrew John Hughes * Makefile.am: (add-netx): Ensure directory exists before copying javaws man page. (add- netx-debug): Likewise. 2010-09-13 Omair Majid Add a new man page for netx's javaws. * NEWS: Updated to indicate the new man page for javaws. * Makefile.am (icedtea.stamp): Copy over the javaws man page into the build. (icedtea-debug.stamp): Copy over the javaws man page. * netx/javaws.1: New man page for netx's javaws. changeset 3b1a69fc737b in /hg/release/icedtea6-1.7 details: http://icedtea.classpath.org/hg/release/icedtea6-1.7?cmd=changeset;node=3b1a69fc737b author: Andrew John Hughes date: Wed Oct 13 00:18:49 2010 +0100 Added tag icedtea6-1.7.5 for changeset 9f1417fbbb12 diffstat: 28 files changed, 5604 insertions(+), 274 deletions(-) .hgtags | 1 ChangeLog | 80 + Makefile.am | 141 +- NEWS | 34 configure.ac | 2 patches/hotspot/hs16/systemtap.patch | 186 ++ patches/hotspot/original/systemtap.patch | 182 ++ patches/icedtea-lcms.patch | 28 patches/icedtea-systemtap.patch | 182 -- patches/icedtea-timerqueue.patch | 18 patches/security/20101012/6559775.patch | 303 ++++ patches/security/20101012/6622002.patch | 64 patches/security/20101012/6623943.patch | 138 ++ patches/security/20101012/6891766.patch | 1289 +++++++++++++++++++ patches/security/20101012/6914943.patch | 1982 ++++++++++++++++++++++++++++++ patches/security/20101012/6925710.patch | 198 ++ patches/security/20101012/6938813.patch | 175 ++ patches/security/20101012/6952017.patch | 50 patches/security/20101012/6952603.patch | 38 patches/security/20101012/6957564.patch | 77 + patches/security/20101012/6958060.patch | 15 patches/security/20101012/6961084.patch | 325 ++++ patches/security/20101012/6963023.patch | 95 + patches/security/20101012/6963285.patch | 20 patches/security/20101012/6963489.patch | 31 patches/security/20101012/6966692.patch | 84 + patches/security/20101012/6981426.patch | 24 patches/security/20101012/6990437.patch | 116 + diffs (truncated from 6107 to 500 lines): diff -r 02e3bf7ef716 -r 3b1a69fc737b .hgtags --- a/.hgtags Mon Oct 04 16:58:32 2010 +0100 +++ b/.hgtags Wed Oct 13 00:18:49 2010 +0100 @@ -22,3 +22,4 @@ 6e9e64c22c9625939edcd20c1a9dcd7a7aaea723 6e9e64c22c9625939edcd20c1a9dcd7a7aaea723 icedtea6-1.7.2 cf5e5cb5f1cd9aa7f3237e918504be6fa732fa26 icedtea6-1.7.3 30dc9370bebaf7d7bed1f49ff220bcb75f3b2140 icedtea6-1.7.4 +9f1417fbbb12374a1585da2c3265deb8c10d6ec6 icedtea6-1.7.5 diff -r 02e3bf7ef716 -r 3b1a69fc737b ChangeLog --- a/ChangeLog Mon Oct 04 16:58:32 2010 +0100 +++ b/ChangeLog Wed Oct 13 00:18:49 2010 +0100 @@ -1,3 +1,83 @@ 2010-09-17 Andrew John Hughes + + * Makefile.am: + (add-netx): Ensure directory exists before + copying javaws man page. + (add-netx-debug): Likewise. + +2010-09-13 Omair Majid + + Add a new man page for netx's javaws. + * NEWS: Updated to indicate the new man page for javaws. + * Makefile.am + (icedtea.stamp): Copy over the javaws man page into the build. + (icedtea-debug.stamp): Copy over the javaws man page. + * netx/javaws.1: New man page for netx's javaws. + +2010-10-11 Andrew John Hughes + + * NEWS: Add CVE numbers and list 6925672 + which is covered by the 6891766 fix. + +2010-10-11 Andrew John Hughes + + * patches/icedtea-timerqueue.patch: + Dropped; superceded by 6623943. + * Makefile.am: Add new security patches. + * NEWS: List new security patches. + * patches/security/20101012/6622002.patch, + * patches/security/20101012/6623943.patch, + * patches/security/20101012/6952017.patch, + * patches/security/20101012/6952603.patch, + * patches/security/20101012/6961084.patch, + * patches/security/20101012/6963285.patch, + * patches/security/20101012/6981426.patch, + * patches/security/20101012/6990437.patch: + Added. + +2010-10-07 Andrew John Hughes + + * patches/icedtea-systemtap.patch: + Split patch into hs16 and original versions. + * Makefile.am: Use a hsbuild-specific version + of the systemtap patch. + * patches/hotspot/hs16/systemtap.patch: + SystemTap patch from last checkin. + * patches/hotspot/original/systemtap.patch: + SystemTap patch prior to last checkin. + +2010-10-07 Andrew John Hughes + + * Makefile.am: Move HotSpot patches up + so they aren't affected by conditional patches. + * patches/icedtea-systemtap.patch: + Fix to apply after the hs16 sparc patch. + +2010-10-06 Andrew John Hughes + + * configure.ac: Bump to 1.7.5. + * NEWS: Set date of 1.7.5 to 2010-10-13. + +2010-10-05 Andrew John Hughes + + * configure.ac: Bump to 1.7.5pre. + +2010-10-05 Andrew John Hughes + + * Makefile.am: Add new patches. + * NEWS: List security updates. + * patches/security/20101012/6559775.patch, + * patches/security/20101012/6891766.patch, + * patches/security/20101012/6914943.patch, + * patches/security/20101012/6925710.patch, + * patches/security/20101012/6938813.patch, + * patches/security/20101012/6957564.patch, + * patches/security/20101012/6958060.patch, + * patches/security/20101012/6963023.patch, + * patches/security/20101012/6963489.patch, + * patches/security/20101012/6966692.patch: + New security patches. + 2010-09-17 Andrew John Hughes * Makefile.am: diff -r 02e3bf7ef716 -r 3b1a69fc737b Makefile.am --- a/Makefile.am Mon Oct 04 16:58:32 2010 +0100 +++ b/Makefile.am Wed Oct 13 00:18:49 2010 +0100 @@ -55,6 +55,7 @@ JAXWS = openjdk/jaxws/src/share/classes JAXWS = openjdk/jaxws/src/share/classes # FIXME (netx): NetX source directories go here +NETX_SRCDIR = $(abs_top_srcdir)/rt OPENJDK_SOURCEPATH_DIRS = \ $(SHARE):$(SOLARIS):$(LANGTOOLS):$(JAXP):$(CORBA):$(JAXWS) @@ -201,7 +202,64 @@ REWRITER_SRCS = $(abs_top_srcdir)/rewrit ICEDTEA_FSG_PATCHES = +SECURITY_PATCHES = \ + patches/security/icedtea-6862968.patch \ + patches/security/icedtea-6863503.patch \ + patches/security/icedtea-6864911.patch \ + patches/security/icedtea-6872357.patch \ + patches/security/icedtea-6874643.patch \ + patches/security/icedtea-6631533.patch \ + patches/security/icedtea-6632445.patch \ + patches/security/icedtea-6636650.patch \ + patches/security/icedtea-6657026.patch \ + patches/security/icedtea-6657138.patch \ + patches/security/icedtea-6822057.patch \ + patches/security/icedtea-6824265.patch \ + patches/security/icedtea-6861062.patch \ + patches/security/icedtea-6872358.patch \ + patches/security/icedtea-6664512.patch \ + patches/security/20100330/hotspot/$(HSBUILD)/6626217.patch \ + patches/security/20100330/6633872.patch \ + patches/security/20100330/6639665.patch \ + patches/security/20100330/6736390.patch \ + patches/security/20100330/6745393.patch \ + patches/security/20100330/6887703.patch \ + patches/security/20100330/6888149.patch \ + patches/security/20100330/6892265.patch \ + patches/security/20100330/6893947.patch \ + patches/security/20100330/6893954.patch \ + patches/security/20100330/6894807.patch \ + patches/security/20100330/6898622.patch \ + patches/security/20100330/6898739.patch \ + patches/security/20100330/6899653.patch \ + patches/security/20100330/6902299.patch \ + patches/security/20100330/6904691.patch \ + patches/security/20100330/6909597.patch \ + patches/security/20100330/6910590.patch \ + patches/security/20100330/6914823.patch \ + patches/security/20100330/6914866.patch \ + patches/security/20100330/6932480.patch \ + patches/security/20101012/6891766.patch \ + patches/security/20101012/6925710.patch \ + patches/security/20101012/6938813.patch \ + patches/security/20101012/6957564.patch \ + patches/security/20101012/6958060.patch \ + patches/security/20101012/6963023.patch \ + patches/security/20101012/6963489.patch \ + patches/security/20101012/6966692.patch \ + patches/security/20101012/6914943.patch \ + patches/security/20101012/6559775.patch \ + patches/security/20101012/6622002.patch \ + patches/security/20101012/6623943.patch \ + patches/security/20101012/6952017.patch \ + patches/security/20101012/6952603.patch \ + patches/security/20101012/6961084.patch \ + patches/security/20101012/6963285.patch \ + patches/security/20101012/6981426.patch \ + patches/security/20101012/6990437.patch + ICEDTEA_PATCHES = \ + $(SECURITY_PATCHES) \ patches/zero/6890308.patch \ patches/zero/6891677.patch \ patches/zero/6896043.patch \ @@ -235,7 +293,6 @@ ICEDTEA_PATCHES = \ patches/icedtea-javafiles.patch \ patches/icedtea-jvmtiEnv.patch \ patches/icedtea-lcms.patch \ - patches/icedtea-timerqueue.patch \ patches/icedtea-print-lsb-release.patch \ patches/icedtea-jpegclasses.patch \ patches/icedtea-uname.patch \ @@ -270,21 +327,6 @@ ICEDTEA_PATCHES = \ patches/icedtea-sparc64-linux.patch \ patches/icedtea-sparc-ptracefix.patch \ patches/icedtea-sparc-trapsfix.patch \ - patches/security/icedtea-6862968.patch \ - patches/security/icedtea-6863503.patch \ - patches/security/icedtea-6864911.patch \ - patches/security/icedtea-6872357.patch \ - patches/security/icedtea-6874643.patch \ - patches/security/icedtea-6631533.patch \ - patches/security/icedtea-6632445.patch \ - patches/security/icedtea-6636650.patch \ - patches/security/icedtea-6657026.patch \ - patches/security/icedtea-6657138.patch \ - patches/security/icedtea-6822057.patch \ - patches/security/icedtea-6824265.patch \ - patches/security/icedtea-6861062.patch \ - patches/security/icedtea-6872358.patch \ - patches/security/icedtea-6664512.patch \ patches/icedtea-demo-swingapplet.patch \ patches/icedtea-awt-window-size.patch \ patches/icedtea-java2d-dasher.patch \ @@ -311,27 +353,6 @@ ICEDTEA_PATCHES = \ patches/icedtea-policy-evaluation.patch \ patches/libpng.patch \ patches/icedtea-jtreg-httpTest.patch \ - patches/security/20100330/hotspot/$(HSBUILD)/6626217.patch \ - patches/security/20100330/6633872.patch \ - patches/security/20100330/6639665.patch \ - patches/security/20100330/6736390.patch \ - patches/security/20100330/6745393.patch \ - patches/security/20100330/6887703.patch \ - patches/security/20100330/6888149.patch \ - patches/security/20100330/6892265.patch \ - patches/security/20100330/6893947.patch \ - patches/security/20100330/6893954.patch \ - patches/security/20100330/6894807.patch \ - patches/security/20100330/6898622.patch \ - patches/security/20100330/6898739.patch \ - patches/security/20100330/6899653.patch \ - patches/security/20100330/6902299.patch \ - patches/security/20100330/6904691.patch \ - patches/security/20100330/6909597.patch \ - patches/security/20100330/6910590.patch \ - patches/security/20100330/6914823.patch \ - patches/security/20100330/6914866.patch \ - patches/security/20100330/6932480.patch \ patches/ant-1.8.0.patch \ patches/icedtea-use-system-tzdata.patch \ patches/icedtea-override-redirect-metacity.patch \ @@ -349,6 +370,20 @@ ICEDTEA_PATCHES = \ patches/openjdk/6638712-wildcard_types.patch \ patches/openjdk/6650759-missing_inference.patch \ patches/numa_on_early_glibc.patch + +if WITH_ALT_HSBUILD +ICEDTEA_PATCHES += patches/hotspot/$(HSBUILD)/openjdk-6886353-ignore_deoptimizealot.patch \ + patches/hotspot/$(HSBUILD)/zero.patch \ + patches/hotspot/$(HSBUILD)/shark.patch \ + patches/hotspot/$(HSBUILD)/6951319-sparc_build_fixes.patch +else +ICEDTEA_PATCHES += patches/hotspot/original/icedtea-6778662-lib64.patch \ + patches/hotspot/original/icedtea-6778657-f2i-overflow.patch \ + patches/hotspot/original/icedtea-6791168.patch \ + patches/hotspot/original/icedtea-6793825-includedb.patch \ + patches/openjdk/6822370-reentrantreadwritelock.patch \ + patches/hotspot/original/6539464-consistent-math.patch +endif if WITH_RHINO ICEDTEA_PATCHES += \ @@ -387,27 +422,13 @@ endif endif if ENABLE_SYSTEMTAP -ICEDTEA_PATCHES += patches/icedtea-systemtap.patch \ +ICEDTEA_PATCHES += patches/hotspot/$(HSBUILD)/systemtap.patch \ patches/systemtap-gcc-4.5.patch endif if ENABLE_NSS ICEDTEA_PATCHES += patches/icedtea-nss-config.patch \ patches/icedtea-nss-6763530.patch -endif - -if WITH_ALT_HSBUILD -ICEDTEA_PATCHES += patches/hotspot/$(HSBUILD)/openjdk-6886353-ignore_deoptimizealot.patch \ - patches/hotspot/$(HSBUILD)/zero.patch \ - patches/hotspot/$(HSBUILD)/shark.patch \ - patches/hotspot/$(HSBUILD)/6951319-sparc_build_fixes.patch -else -ICEDTEA_PATCHES += patches/hotspot/original/icedtea-6778662-lib64.patch \ - patches/hotspot/original/icedtea-6778657-f2i-overflow.patch \ - patches/hotspot/original/icedtea-6791168.patch \ - patches/hotspot/original/icedtea-6793825-includedb.patch \ - patches/openjdk/6822370-reentrantreadwritelock.patch \ - patches/hotspot/original/6539464-consistent-math.patch endif if HAS_PAX @@ -1341,6 +1362,14 @@ endif cp $(abs_top_srcdir)/rt/net/sourceforge/jnlp/resources/about.jnlp \ extra-lib/about.jar \ $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib + if [ -d $(BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 ] ; then \ + cp $(NETX_SRCDIR)/javaws.1 \ + $(BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 ; \ + fi + if [ -d $(BUILD_OUTPUT_DIR)/j2re-image/man/man1 ] ; then \ + cp $(NETX_SRCDIR)/javaws.1 \ + $(BUILD_OUTPUT_DIR)/j2re-image/man/man1 ; \ + fi if ZERO_BUILD printf -- '-zero ALIASED_TO -server\n' >> $(BUILD_JRE_ARCH_DIR)/jvm.cfg endif @@ -1444,6 +1473,14 @@ endif cp $(abs_top_srcdir)/rt/net/sourceforge/jnlp/resources/default.jnlp \ extra-lib/about.jar \ $(BUILD_OUTPUT_DIR)-debug/j2sdk-image/jre/lib + if [ -d $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 ] ; then \ + cp $(NETX_SRCDIR)/javaws.1 \ + $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 ; \ + fi + if [ -d $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/man/man1 ] ; then \ + cp $(NETX_SRCDIR)/javaws.1 \ + $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/man/man1 ; \ + fi if ZERO_BUILD printf -- '-zero ALIASED_TO -server\n' >> $(BUILD_DEBUG_JRE_ARCH_DIR)/jvm.cfg endif diff -r 02e3bf7ef716 -r 3b1a69fc737b NEWS --- a/NEWS Mon Oct 04 16:58:32 2010 +0100 +++ b/NEWS Wed Oct 13 00:18:49 2010 +0100 @@ -1,5 +1,36 @@ New in release 1.7.5 (XXXX-XX-XX): -New in release 1.7.5 (XXXX-XX-XX): +Key: +SX - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=X +PRX - http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=X +RHX - https://bugzilla.redhat.com/show_bug.cgi?id=X +DX - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=X +GX - http://bugs.gentoo.org/show_bug.cgi?id=X + +CVE-XXXX-YYYY: http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY + +New in release 1.7.5 (2010-10-13): + +* Security updates + - S6914943, CVE-2009-3555: TLS: MITM attacks via session renegotiation + - S6559775, CVE-2010-3568: OpenJDK Deserialization Race condition + - S6891766, CVE-2010-3554: OpenJDK corba reflection vulnerabilities + - S6925710, CVE-2010-3562: OpenJDK IndexColorModel double-free + - S6938813, CVE-2010-3557: OpenJDK Swing mutable static + - S6957564, CVE-2010-3548: OpenJDK DNS server IP address information leak + - S6958060, CVE-2010-3564: OpenJDK kerberos vulnerability + - S6963023, CVE-2010-3565: OpenJDK JPEG writeImage remote code execution + - S6963489, CVE-2010-3566: OpenJDK ICC Profile remote code execution + - S6966692, CVE-2010-3569: OpenJDK Serialization inconsistencies + - S6622002, CVE-2010-3553: UIDefault.ProxyLazyValue has unsafe reflection usage + - S6623943: javax.swing.TimerQueue's thread occasionally fails to start + - S6925672, CVE-2010-3561: Privileged ServerSocket.accept allows receiving connections from any host + - S6952017, CVE-2010-3549: HttpURLConnection chunked encoding issue (Http request splitting) + - S6952603, CVE-2010-3551: NetworkInterface reveals local network address to untrusted code + - S6961084, CVE-2010-3541: limit setting of some request headers in HttpURLConnection + - S6963285, CVE-2010-3567: Crash in ICU Opentype layout engine due to mismatch in character counts + - S6980004, CVE-2010-3573: limit HTTP request cookie headers in HttpURLConnection + - S6981426, CVE-2010-3574: limit use of TRACE method in HttpURLConnection + - S6990437: Update with correct copyright info for source and test files from SSR10_02 fixes * Fixes - G244901: Skip test_gamma on hardened (PaX-enabled) kernels - G266295: Provide font configuration for Gentoo. @@ -15,6 +46,7 @@ New in release 1.7.5 (XXXX-XX-XX): - Run programs that inherit main(String[]) in their main-class - Work with JNLP files that use spec version 1.6 - RH601281: Possible NullPointerException in splash screen code + - New man page for javaws * Plugin - RH560193: Fix ziperror when applet jar contained another 0-byte jar - PR519: 100% CPU usage when displaying applets in Webkit based browsers diff -r 02e3bf7ef716 -r 3b1a69fc737b configure.ac --- a/configure.ac Mon Oct 04 16:58:32 2010 +0100 +++ b/configure.ac Wed Oct 13 00:18:49 2010 +0100 @@ -1,4 +1,4 @@ AC_INIT([icedtea6], [1.7.4], [distro-pkg -AC_INIT([icedtea6], [1.7.4], [distro-pkg-dev at openjdk.java.net]) +AC_INIT([icedtea6], [1.7.5], [distro-pkg-dev at openjdk.java.net]) AM_INIT_AUTOMAKE([1.9 tar-pax foreign]) AC_CONFIG_FILES([Makefile]) diff -r 02e3bf7ef716 -r 3b1a69fc737b patches/hotspot/hs16/systemtap.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/hs16/systemtap.patch Wed Oct 13 00:18:49 2010 +0100 @@ -0,0 +1,186 @@ +diff -Nru openjdk.orig/hotspot/make/linux/makefiles/dtrace.make openjdk/hotspot/make/linux/makefiles/dtrace.make +--- openjdk.orig/hotspot/make/linux/makefiles/dtrace.make 2009-12-08 23:12:17.000000000 +0000 ++++ openjdk/hotspot/make/linux/makefiles/dtrace.make 2010-10-07 11:45:17.510211682 +0100 +@@ -25,3 +25,7 @@ + # Linux does not build jvm_db + LIBJVM_DB = + ++# But it does have a Systemtap dtrace compatible sys/sdt.h ++CFLAGS += -DDTRACE_ENABLED ++ ++# It doesn't support HAVE_DTRACE_H though. +diff -Nru openjdk.orig/hotspot/src/share/vm/prims/jni.cpp openjdk/hotspot/src/share/vm/prims/jni.cpp +--- openjdk.orig/hotspot/src/share/vm/prims/jni.cpp 2010-10-06 21:54:38.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/prims/jni.cpp 2010-10-07 11:45:17.510211682 +0100 +@@ -1753,10 +1753,7 @@ + JNI_QUICK_ENTRY(void, jni_Set##Result##Field(JNIEnv *env, jobject obj, jfieldID fieldID, Argument value)) \ + JNIWrapper("Set" XSTR(Result) "Field"); \ + \ +- HS_DTRACE_PROBE_CDECL_N(hotspot_jni, Set##Result##Field__entry, \ +- ( JNIEnv*, jobject, jfieldID FP_SELECT_##Result(COMMA Argument,/*empty*/) ) ); \ +- HS_DTRACE_PROBE_N(hotspot_jni, Set##Result##Field__entry, \ +- ( env, obj, fieldID FP_SELECT_##Result(COMMA value,/*empty*/) ) ); \ ++ FP_SELECT_##Result(DTRACE_PROBE4(hotspot_jni, Set##Result##Field__entry, env, obj, fieldID, value),DTRACE_PROBE3(hotspot_jni, Set##Result##Field__entry, env, obj, fieldID)); \ + \ + oop o = JNIHandles::resolve_non_null(obj); \ + klassOop k = o->klass(); \ +@@ -1930,10 +1927,7 @@ + \ + JNI_ENTRY(void, jni_SetStatic##Result##Field(JNIEnv *env, jclass clazz, jfieldID fieldID, Argument value)) \ + JNIWrapper("SetStatic" XSTR(Result) "Field"); \ +- HS_DTRACE_PROBE_CDECL_N(hotspot_jni, SetStatic##Result##Field__entry,\ +- ( JNIEnv*, jclass, jfieldID FP_SELECT_##Result(COMMA Argument,/*empty*/) ) ); \ +- HS_DTRACE_PROBE_N(hotspot_jni, SetStatic##Result##Field__entry, \ +- ( env, clazz, fieldID FP_SELECT_##Result(COMMA value,/*empty*/) ) ); \ ++ FP_SELECT_##Result(DTRACE_PROBE4(hotspot_jni, SetStatic##Result##Field__entry, env, clazz, fieldID, value),DTRACE_PROBE3(hotspot_jni, SetStatic##Result##Field__entry, env, clazz, fieldID)); \ + \ + JNIid* id = jfieldIDWorkaround::from_static_jfieldID(fieldID); \ + assert(id->is_static_field_id(), "invalid static field id"); \ +@@ -2116,7 +2110,7 @@ + DT_RETURN_MARK(GetObjectArrayElement, jobject, (const jobject&)ret); + objArrayOop a = objArrayOop(JNIHandles::resolve_non_null(array)); + if (a->is_within_bounds(index)) { +- jobject ret = JNIHandles::make_local(env, a->obj_at(index)); ++ ret = JNIHandles::make_local(env, a->obj_at(index)); + return ret; + } else { + char buf[jintAsStringSize]; +@@ -2150,14 +2144,14 @@ + + #define DEFINE_NEWSCALARARRAY(Return,Allocator,Result) \ + \ +- DT_RETURN_MARK_DECL_FOR(Result, New##Result##Array, Return);\ ++ DT_RETURN_MARK_DECL(New##Result##Array, Return);\ + \ + JNI_ENTRY(Return, \ + jni_New##Result##Array(JNIEnv *env, jsize len)) \ + JNIWrapper("New" XSTR(Result) "Array"); \ + DTRACE_PROBE2(hotspot_jni, New##Result##Array__entry, env, len);\ + Return ret = NULL;\ +- DT_RETURN_MARK_FOR(Result, New##Result##Array, Return, (const Return&)ret);\ ++ DT_RETURN_MARK(New##Result##Array, Return, (const Return&)ret);\ + \ + oop obj= oopFactory::Allocator(len, CHECK_0); \ + ret = (Return) JNIHandles::make_local(env, obj); \ +diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp openjdk/hotspot/src/share/vm/runtime/arguments.cpp +--- openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp 2010-10-06 21:54:42.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp 2010-10-07 11:45:17.510211682 +0100 +@@ -2352,16 +2352,16 @@ + FLAG_SET_CMDLINE(bool, DisplayVMOutputToStderr, false); + FLAG_SET_CMDLINE(bool, DisplayVMOutputToStdout, true); + } else if (match_option(option, "-XX:+ExtendedDTraceProbes", &tail)) { +-#ifdef SOLARIS ++#ifdef DTRACE_ENABLED + FLAG_SET_CMDLINE(bool, ExtendedDTraceProbes, true); + FLAG_SET_CMDLINE(bool, DTraceMethodProbes, true); + FLAG_SET_CMDLINE(bool, DTraceAllocProbes, true); + FLAG_SET_CMDLINE(bool, DTraceMonitorProbes, true); +-#else // ndef SOLARIS ++#else // ndef DTRACE_ENABLED + jio_fprintf(defaultStream::error_stream(), +- "ExtendedDTraceProbes flag is only applicable on Solaris\n"); ++ "ExtendedDTraceProbes flag is only applicable on dtrace enabled builds\n"); + return JNI_EINVAL; +-#endif // ndef SOLARIS ++#endif // ndef DTRACE_ENABLED + } else + #ifdef ASSERT + if (match_option(option, "-XX:+FullGCALot", &tail)) { +diff -Nru openjdk.orig/hotspot/src/share/vm/utilities/dtrace.hpp openjdk/hotspot/src/share/vm/utilities/dtrace.hpp +--- openjdk.orig/hotspot/src/share/vm/utilities/dtrace.hpp 2010-10-06 21:54:47.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/utilities/dtrace.hpp 2010-10-07 11:46:11.357276841 +0100 +@@ -1,5 +1,6 @@ + /* + * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. ++ * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -22,7 +23,7 @@ + * + */ + +-#if defined(SOLARIS) && defined(DTRACE_ENABLED) ++#if defined(DTRACE_ENABLED) + + #include + +@@ -33,7 +34,7 @@ + #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() \ + do { volatile size_t dtrace_workaround_tail_call_bug = 1; } while (0) + +-#else // ndef SOLARIS || ndef DTRACE_ENABLED ++#else // ndef DTRACE_ENABLED + + #define DTRACE_ONLY(x) + #define NOT_DTRACE(x) x +@@ -44,11 +45,18 @@ + #define DTRACE_PROBE3(a,b,c,d,e) {;} + #define DTRACE_PROBE4(a,b,c,d,e,f) {;} + #define DTRACE_PROBE5(a,b,c,d,e,f,g) {;} ++#define DTRACE_PROBE6(a,b,c,d,e,f,g,h) {;} ++#define DTRACE_PROBE7(a,b,c,d,e,f,g,h,i) {;} ++#define DTRACE_PROBE8(a,b,c,d,e,f,g,h,i,j) {;} ++#define DTRACE_PROBE9(a,b,c,d,e,f,g,h,i,j,k) {;} ++#define DTRACE_PROBE10(a,b,c,d,e,f,g,h,i,j,k,l) {;} + + #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() + + #endif From andrew at icedtea.classpath.org Tue Oct 12 16:23:08 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 12 Oct 2010 23:23:08 +0000 Subject: /hg/release/icedtea6-1.8: 8 new changesets Message-ID: changeset 0aff588d7af9 in /hg/release/icedtea6-1.8 details: http://icedtea.classpath.org/hg/release/icedtea6-1.8?cmd=changeset;node=0aff588d7af9 author: Andrew John Hughes date: Tue Oct 05 17:19:35 2010 +0100 Security update. 2010-10-05 Andrew John Hughes * Makefile.am: Add new patches. * NEWS: List security updates. * patches/security/20101012/6559775.patch, * patches/security/20101012/6891766.patch, * patches/security/20101012/6914943.patch, * patches/security/20101012/6925710.patch, * patches/security/20101012/6938813.patch, * patches/security/20101012/6957564.patch, * patches/security/20101012/6958060.patch, * patches/security/20101012/6963023.patch, * patches/security/20101012/6963489.patch, * patches/security/20101012/6966692.patch: New security patches. * patches/icedtea-lcms.patch: Updated. changeset 14537bc41955 in /hg/release/icedtea6-1.8 details: http://icedtea.classpath.org/hg/release/icedtea6-1.8?cmd=changeset;node=14537bc41955 author: Andrew John Hughes date: Tue Oct 05 17:20:17 2010 +0100 Bump version to 1.8.2pre. 2010-10-05 Andrew John Hughes * configure.ac: Bump version to 1.8.2pre. changeset ea137f4594e0 in /hg/release/icedtea6-1.8 details: http://icedtea.classpath.org/hg/release/icedtea6-1.8?cmd=changeset;node=ea137f4594e0 author: Andrew John Hughes date: Wed Oct 06 16:25:39 2010 +0100 Bump to 1.8.2 and set date of release to 2010-10-13. 2010-10-06 Andrew John Hughes * configure.ac: Bump to 1.8.2. * NEWS: Set date of 1.8.2 to 2010-10-13. changeset 899ce6f90ccd in /hg/release/icedtea6-1.8 details: http://icedtea.classpath.org/hg/release/icedtea6-1.8?cmd=changeset;node=899ce6f90ccd author: Andrew John Hughes date: Mon Oct 11 19:59:28 2010 +0100 Apply HotSpot patches first and use a different SystemTap patch for hs16. 2010-10-11 Andrew John Hughes * patches/icedtea-systemtap.patch: Split patch into hs16 and original versions. * Makefile.am: Use a hsbuild-specific version of the systemtap patch. Apply HotSpot patches first. * patches/hotspot/hs16/systemtap.patch: New SystemTap patch against hs16. * patches/hotspot/original/systemtap.patch: Old SystemTap patch. changeset e909e9c8607e in /hg/release/icedtea6-1.8 details: http://icedtea.classpath.org/hg/release/icedtea6-1.8?cmd=changeset;node=e909e9c8607e author: Andrew John Hughes date: Mon Oct 11 22:39:36 2010 +0100 Second batch of security updates. 2010-10-11 Andrew John Hughes * patches/icedtea-timerqueue.patch: Dropped; superceded by 6623943. * Makefile.am: Add new security patches. * NEWS: List new security patches. * patches/security/20101012/6622002.patch, * patches/security/20101012/6623943.patch, * patches/security/20101012/6952017.patch, * patches/security/20101012/6952603.patch, * patches/security/20101012/6961084.patch, * patches/security/20101012/6963285.patch, * patches/security/20101012/6981426.patch, * patches/security/20101012/6990437.patch: Added. changeset 5fd9043308bb in /hg/release/icedtea6-1.8 details: http://icedtea.classpath.org/hg/release/icedtea6-1.8?cmd=changeset;node=5fd9043308bb author: andrew date: Mon Oct 11 22:31:47 2010 +0100 Add CVE numbers. 2010-10-11 Andrew John Hughes * NEWS: Add CVE numbers and list 6925672 which is covered by the 6891766 fix. changeset e96213dd3cd6 in /hg/release/icedtea6-1.8 details: http://icedtea.classpath.org/hg/release/icedtea6-1.8?cmd=changeset;node=e96213dd3cd6 author: Andrew John Hughes date: Tue Oct 12 15:44:58 2010 +0100 Add man page for javaws. 2010-10-12 Andrew John Hughes * Makefile.am: (add-netx): Ensure directory exists before copying javaws man page. (add-netx-debug): Likewise. 2010-09-13 Omair Majid Add a new man page for netx's javaws. * NEWS: Updated to indicate the new man page for javaws. * Makefile.am (icedtea.stamp): Copy over the javaws man page into the build. (icedtea-debug.stamp): Copy over the javaws man page. * netx/javaws.1: New man page for netx's javaws. changeset a0fc1afc5d95 in /hg/release/icedtea6-1.8 details: http://icedtea.classpath.org/hg/release/icedtea6-1.8?cmd=changeset;node=a0fc1afc5d95 author: Andrew John Hughes date: Wed Oct 13 00:23:00 2010 +0100 Added tag icedtea6-1.8.2 for changeset e96213dd3cd6 diffstat: 29 files changed, 5706 insertions(+), 259 deletions(-) .hgtags | 1 ChangeLog | 75 + Makefile.am | 110 + NEWS | 34 configure.ac | 2 netx/javaws.1 | 123 + patches/hotspot/hs16/systemtap.patch | 186 ++ patches/hotspot/original/systemtap.patch | 182 ++ patches/icedtea-lcms.patch | 28 patches/icedtea-systemtap.patch | 182 -- patches/icedtea-timerqueue.patch | 18 patches/security/20101012/6559775.patch | 303 ++++ patches/security/20101012/6622002.patch | 64 patches/security/20101012/6623943.patch | 138 ++ patches/security/20101012/6891766.patch | 1289 +++++++++++++++++++ patches/security/20101012/6914943.patch | 1982 ++++++++++++++++++++++++++++++ patches/security/20101012/6925710.patch | 198 ++ patches/security/20101012/6938813.patch | 175 ++ patches/security/20101012/6952017.patch | 50 patches/security/20101012/6952603.patch | 38 patches/security/20101012/6957564.patch | 77 + patches/security/20101012/6958060.patch | 15 patches/security/20101012/6961084.patch | 325 ++++ patches/security/20101012/6963023.patch | 95 + patches/security/20101012/6963285.patch | 20 patches/security/20101012/6963489.patch | 31 patches/security/20101012/6966692.patch | 84 + patches/security/20101012/6981426.patch | 24 patches/security/20101012/6990437.patch | 116 + diffs (truncated from 6185 to 500 lines): diff -r 43a38e678ae4 -r a0fc1afc5d95 .hgtags --- a/.hgtags Mon Oct 04 17:01:26 2010 +0100 +++ b/.hgtags Wed Oct 13 00:23:00 2010 +0100 @@ -22,3 +22,4 @@ f736007b642b5b07582ba5251ca90554f7b95e8b f736007b642b5b07582ba5251ca90554f7b95e8b icedtea6-1.8-branch a0120629678b904ef41bcac470b9025dc777ff03 icedtea6-1.8 1419166fcebf45ac187cfe2a4e1a45548cdeb5bd icedtea6-1.8.1 +e96213dd3cd67306ded33a13319e8681728c7299 icedtea6-1.8.2 diff -r 43a38e678ae4 -r a0fc1afc5d95 ChangeLog --- a/ChangeLog Mon Oct 04 17:01:26 2010 +0100 +++ b/ChangeLog Wed Oct 13 00:23:00 2010 +0100 @@ -1,3 +1,78 @@ 2010-09-17 Andrew John Hughes + + * Makefile.am: + (add-netx): Ensure directory exists before + copying javaws man page. + (add-netx-debug): Likewise. + +2010-09-13 Omair Majid + + Add a new man page for netx's javaws. + * NEWS: Updated to indicate the new man page for javaws. + * Makefile.am + (icedtea.stamp): Copy over the javaws man page into the build. + (icedtea-debug.stamp): Copy over the javaws man page. + * netx/javaws.1: New man page for netx's javaws. + +2010-10-11 Andrew John Hughes + + * NEWS: Add CVE numbers and list 6925672 + which is covered by the 6891766 fix. + +2010-10-11 Andrew John Hughes + + * patches/icedtea-timerqueue.patch: + Dropped; superceded by 6623943. + * Makefile.am: Add new security patches. + * NEWS: List new security patches. + * patches/security/20101012/6622002.patch, + * patches/security/20101012/6623943.patch, + * patches/security/20101012/6952017.patch, + * patches/security/20101012/6952603.patch, + * patches/security/20101012/6961084.patch, + * patches/security/20101012/6963285.patch, + * patches/security/20101012/6981426.patch, + * patches/security/20101012/6990437.patch: + Added. + +2010-10-11 Andrew John Hughes + + * patches/icedtea-systemtap.patch: + Split patch into hs16 and original versions. + * Makefile.am: Use a hsbuild-specific version + of the systemtap patch. Apply HotSpot patches + first. + * patches/hotspot/hs16/systemtap.patch: + New SystemTap patch against hs16. + * patches/hotspot/original/systemtap.patch: + Old SystemTap patch. + +2010-10-06 Andrew John Hughes + + * configure.ac: Bump to 1.8.2. + * NEWS: Set date of 1.8.2 to 2010-10-13. + +2010-10-05 Andrew John Hughes + + * configure.ac: Bump version to 1.8.2pre. + +2010-10-05 Andrew John Hughes + + * Makefile.am: Add new patches. + * NEWS: List security updates. + * patches/security/20101012/6559775.patch, + * patches/security/20101012/6891766.patch, + * patches/security/20101012/6914943.patch, + * patches/security/20101012/6925710.patch, + * patches/security/20101012/6938813.patch, + * patches/security/20101012/6957564.patch, + * patches/security/20101012/6958060.patch, + * patches/security/20101012/6963023.patch, + * patches/security/20101012/6963489.patch, + * patches/security/20101012/6966692.patch: + New security patches. + * patches/icedtea-lcms.patch: Updated. + 2010-09-17 Andrew John Hughes * Makefile.am: diff -r 43a38e678ae4 -r a0fc1afc5d95 Makefile.am --- a/Makefile.am Mon Oct 04 17:01:26 2010 +0100 +++ b/Makefile.am Wed Oct 13 00:23:00 2010 +0100 @@ -212,7 +212,49 @@ REWRITER_SRCS = $(abs_top_srcdir)/rewrit ICEDTEA_FSG_PATCHES = +SECURITY_PATCHES = \ + patches/security/20100330/hotspot/$(HSBUILD)/6626217.patch \ + patches/security/20100330/6633872.patch \ + patches/security/20100330/6639665.patch \ + patches/security/20100330/6736390.patch \ + patches/security/20100330/6745393.patch \ + patches/security/20100330/6887703.patch \ + patches/security/20100330/6888149.patch \ + patches/security/20100330/6892265.patch \ + patches/security/20100330/6893947.patch \ + patches/security/20100330/6893954.patch \ + patches/security/20100330/6894807.patch \ + patches/security/20100330/6898622.patch \ + patches/security/20100330/6898739.patch \ + patches/security/20100330/6899653.patch \ + patches/security/20100330/6902299.patch \ + patches/security/20100330/6904691.patch \ + patches/security/20100330/6909597.patch \ + patches/security/20100330/6910590.patch \ + patches/security/20100330/6914823.patch \ + patches/security/20100330/6914866.patch \ + patches/security/20100330/6932480.patch \ + patches/security/20101012/6891766.patch \ + patches/security/20101012/6925710.patch \ + patches/security/20101012/6938813.patch \ + patches/security/20101012/6957564.patch \ + patches/security/20101012/6958060.patch \ + patches/security/20101012/6963023.patch \ + patches/security/20101012/6963489.patch \ + patches/security/20101012/6966692.patch \ + patches/security/20101012/6914943.patch \ + patches/security/20101012/6559775.patch \ + patches/security/20101012/6622002.patch \ + patches/security/20101012/6623943.patch \ + patches/security/20101012/6952017.patch \ + patches/security/20101012/6952603.patch \ + patches/security/20101012/6961084.patch \ + patches/security/20101012/6963285.patch \ + patches/security/20101012/6981426.patch \ + patches/security/20101012/6990437.patch + ICEDTEA_PATCHES = \ + $(SECURITY_PATCHES) \ patches/zero/6890308.patch \ patches/zero/6891677.patch \ patches/zero/6896043.patch \ @@ -243,7 +285,6 @@ ICEDTEA_PATCHES = \ patches/icedtea-javafiles.patch \ patches/icedtea-jvmtiEnv.patch \ patches/icedtea-lcms.patch \ - patches/icedtea-timerqueue.patch \ patches/icedtea-print-lsb-release.patch \ patches/icedtea-jpegclasses.patch \ patches/icedtea-uname.patch \ @@ -304,27 +345,6 @@ ICEDTEA_PATCHES = \ patches/extensions/netx-dist.patch \ patches/extensions/netx-umask.patch \ patches/icedtea-jtreg-httpTest.patch \ - patches/security/20100330/hotspot/$(HSBUILD)/6626217.patch \ - patches/security/20100330/6633872.patch \ - patches/security/20100330/6639665.patch \ - patches/security/20100330/6736390.patch \ - patches/security/20100330/6745393.patch \ - patches/security/20100330/6887703.patch \ - patches/security/20100330/6888149.patch \ - patches/security/20100330/6892265.patch \ - patches/security/20100330/6893947.patch \ - patches/security/20100330/6893954.patch \ - patches/security/20100330/6894807.patch \ - patches/security/20100330/6898622.patch \ - patches/security/20100330/6898739.patch \ - patches/security/20100330/6899653.patch \ - patches/security/20100330/6902299.patch \ - patches/security/20100330/6904691.patch \ - patches/security/20100330/6909597.patch \ - patches/security/20100330/6910590.patch \ - patches/security/20100330/6914823.patch \ - patches/security/20100330/6914866.patch \ - patches/security/20100330/6932480.patch \ patches/ant-1.8.0.patch \ patches/icedtea-nss-6763530.patch \ patches/nss-debug.patch \ @@ -336,6 +356,20 @@ ICEDTEA_PATCHES = \ patches/openjdk/6638712-wildcard_types.patch \ patches/openjdk/6650759-missing_inference.patch \ patches/numa_on_early_glibc.patch + +if WITH_ALT_HSBUILD +ICEDTEA_PATCHES += patches/hotspot/$(HSBUILD)/openjdk-6886353-ignore_deoptimizealot.patch \ + patches/hotspot/$(HSBUILD)/zero.patch \ + patches/hotspot/$(HSBUILD)/shark.patch \ + patches/hotspot/$(HSBUILD)/6951319-sparc_build_fixes.patch +else +ICEDTEA_PATCHES += patches/hotspot/original/icedtea-6778662-lib64.patch \ + patches/hotspot/original/icedtea-6778657-f2i-overflow.patch \ + patches/hotspot/original/icedtea-6791168.patch \ + patches/hotspot/original/icedtea-6793825-includedb.patch \ + patches/openjdk/6822370-reentrantreadwritelock.patch \ + patches/hotspot/original/6539464-consistent-math.patch +endif if WITH_RHINO ICEDTEA_PATCHES += \ @@ -383,7 +417,7 @@ endif endif if ENABLE_SYSTEMTAP -ICEDTEA_PATCHES += patches/icedtea-systemtap.patch \ +ICEDTEA_PATCHES += patches/hotspot/$(HSBUILD)/systemtap.patch \ patches/systemtap-gcc-4.5.patch endif @@ -391,20 +425,6 @@ ICEDTEA_PATCHES += patches/icedtea-nss-c ICEDTEA_PATCHES += patches/icedtea-nss-config.patch else ICEDTEA_PATCHES += patches/icedtea-nss-not-enabled-config.patch -endif - -if WITH_ALT_HSBUILD -ICEDTEA_PATCHES += patches/hotspot/$(HSBUILD)/openjdk-6886353-ignore_deoptimizealot.patch \ - patches/hotspot/$(HSBUILD)/zero.patch \ - patches/hotspot/$(HSBUILD)/shark.patch \ - patches/hotspot/$(HSBUILD)/6951319-sparc_build_fixes.patch -else -ICEDTEA_PATCHES += patches/hotspot/original/icedtea-6778662-lib64.patch \ - patches/hotspot/original/icedtea-6778657-f2i-overflow.patch \ - patches/hotspot/original/icedtea-6791168.patch \ - patches/hotspot/original/icedtea-6793825-includedb.patch \ - patches/openjdk/6822370-reentrantreadwritelock.patch \ - patches/hotspot/original/6539464-consistent-math.patch endif if HAS_PAX @@ -1332,6 +1352,14 @@ endif $(BUILD_OUTPUT_DIR)/j2re-image/lib ; \ cp $(NETX_RESOURCE_DIR)/about.jnlp extra-lib/about.jar \ $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib + if [ -d $(BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 ] ; then \ + cp $(NETX_SRCDIR)/javaws.1 \ + $(BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 ; \ + fi + if [ -d $(BUILD_OUTPUT_DIR)/j2re-image/man/man1 ] ; then \ + cp $(NETX_SRCDIR)/javaws.1 \ + $(BUILD_OUTPUT_DIR)/j2re-image/man/man1 ; \ + fi if ZERO_BUILD printf -- '-zero ALIASED_TO -server\n' >> $(BUILD_JRE_ARCH_DIR)/jvm.cfg endif @@ -1422,6 +1450,14 @@ endif $(BUILD_OUTPUT_DIR)-debug/j2re-image/lib ; \ cp $(NETX_RESOURCE_DIR)/default.jnlp extra-lib/about.jar \ $(BUILD_OUTPUT_DIR)-debug/j2sdk-image/jre/lib + if [ -d $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 ] ; then \ + cp $(NETX_SRCDIR)/javaws.1 \ + $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 ; \ + fi + if [ -d $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/man/man1 ] ; then \ + cp $(NETX_SRCDIR)/javaws.1 \ + $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/man/man1 ; \ + fi if ZERO_BUILD printf -- '-zero ALIASED_TO -server\n' >> $(BUILD_DEBUG_JRE_ARCH_DIR)/jvm.cfg endif diff -r 43a38e678ae4 -r a0fc1afc5d95 NEWS --- a/NEWS Mon Oct 04 17:01:26 2010 +0100 +++ b/NEWS Wed Oct 13 00:23:00 2010 +0100 @@ -1,5 +1,36 @@ New in release 1.8.2 (XXXX-XX-XX): -New in release 1.8.2 (XXXX-XX-XX): +Key: +SX - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=X +PRX - http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=X +RHX - https://bugzilla.redhat.com/show_bug.cgi?id=X +DX - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=X +GX - http://bugs.gentoo.org/show_bug.cgi?id=X + +CVE-XXXX-YYYY: http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY + +New in release 1.8.2 (2010-10-13): + +* Security updates + - S6914943, CVE-2009-3555: TLS: MITM attacks via session renegotiation + - S6559775, CVE-2010-3568: OpenJDK Deserialization Race condition + - S6891766, CVE-2010-3554: OpenJDK corba reflection vulnerabilities + - S6925710, CVE-2010-3562: OpenJDK IndexColorModel double-free + - S6938813, CVE-2010-3557: OpenJDK Swing mutable static + - S6957564, CVE-2010-3548: OpenJDK DNS server IP address information leak + - S6958060, CVE-2010-3564: OpenJDK kerberos vulnerability + - S6963023, CVE-2010-3565: OpenJDK JPEG writeImage remote code execution + - S6963489, CVE-2010-3566: OpenJDK ICC Profile remote code execution + - S6966692, CVE-2010-3569: OpenJDK Serialization inconsistencies + - S6622002, CVE-2010-3553: UIDefault.ProxyLazyValue has unsafe reflection usage + - S6623943: javax.swing.TimerQueue's thread occasionally fails to start + - S6925672, CVE-2010-3561: Privileged ServerSocket.accept allows receiving connections from any host + - S6952017, CVE-2010-3549: HttpURLConnection chunked encoding issue (Http request splitting) + - S6952603, CVE-2010-3551: NetworkInterface reveals local network address to untrusted code + - S6961084, CVE-2010-3541: limit setting of some request headers in HttpURLConnection + - S6963285, CVE-2010-3567: Crash in ICU Opentype layout engine due to mismatch in character counts + - S6980004, CVE-2010-3573: limit HTTP request cookie headers in HttpURLConnection + - S6981426, CVE-2010-3574: limit use of TRACE method in HttpURLConnection + - S6990437: Update with correct copyright info for source and test files from SSR10_02 fixes * Fixes: - G244901: Skip test_gamma on hardened (PaX-enabled) kernels - G266295: Provide font configuration for Gentoo. @@ -15,6 +46,7 @@ New in release 1.8.2 (XXXX-XX-XX): - Run programs that inherit main(String[]) in their main-class - Run JNLP files that use 1.6 as the spec version - RH601281: Possible NullPointerException in splash screen code + - New man page for javaws * Plugin - RH560193: Fix ziperror when applet jar contained another 0-byte jar - PR519: 100% CPU usage when displaying applets in Webkit based browsers diff -r 43a38e678ae4 -r a0fc1afc5d95 configure.ac --- a/configure.ac Mon Oct 04 17:01:26 2010 +0100 +++ b/configure.ac Wed Oct 13 00:23:00 2010 +0100 @@ -1,4 +1,4 @@ AC_INIT([icedtea6],[1.8.1],[distro-pkg-d -AC_INIT([icedtea6],[1.8.1],[distro-pkg-dev at openjdk.java.net]) +AC_INIT([icedtea6],[1.8.2],[distro-pkg-dev at openjdk.java.net]) AM_INIT_AUTOMAKE([1.9 tar-pax foreign]) AC_CONFIG_FILES([Makefile]) diff -r 43a38e678ae4 -r a0fc1afc5d95 netx/javaws.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netx/javaws.1 Wed Oct 13 00:23:00 2010 +0100 @@ -0,0 +1,123 @@ +.TH javaws 1 "9 Sep 2010" +.SH NAME +javaws - a Java Web Start client +.SH SYNOPSYS +.B javaws +[-run-options] jnlp-file +.br +.B javaws +[-control-option] +.SH DESCRIPTION +.B javaws +is an implementation of a JNLP client. It uses a JNLP (Java Network +Launch Protocol) file to securely run a remote Java application or +a Java applet. This implementation of +.B javaws +is from the IcedTea project and is based on the NetX project. +.PP +A JNLP file is an xml file that describes how to securely run a +remote Java application or a Java applet. + +.SH OPTIONS +When specifying options, the name of the jnlp file must be the last +argument to +.B javaws +- all the options must preceede it. +.PP +The jnlp-file can either be a url or a local path. +.PP +.B Control Options +.PP +By default +.B javaws +will launch the jnlp file specified on the command line. The control +options can be used to change this behaviour. +.TP 12 +\-about +Shows a sample application that can be used to test the basic functionality +of this implementation. +.TP +\-viewer +Shows the trusted certificate viewer. This allows a user to list, examine, remove +or export trusted certificates. Note that this only reflects the certificates +trusted by +.B javaws +and not any other certificates or programs. + +.PP +.B Run Options +.PP +In the default mode, the following run-options can be used: +.TP 12 +\-basedir dir +Directory where the cache and certificates to be used are stored. +.TP +\-arg arg +Adds an application argument before launching. +.TP +\-param name=value +Adds an applet parameter before launching. +.TP +\-property name=value +Sets a system property before launching. +.TP +\-update seconds +Update check if seconds since last checked. +.TP +\-license +Display the GPL license and exit. +.TP +\-verbose +Enable verbose output. Very useful in debugging. +.TP +\-nosecurity +Disables the secure runtime environment. +.TP +\-noupdate +Disables checking for updates. +.TP +\-headless +Disables download window, other UIs. +.TP +\-strict +Enables strict checking of JNLP file format. Any deviations from +the JNLP DTD will cause +.B javaws +to abort. +.TP +\-umask=value +Sets the umask for files created by an application. +.TP +\-Xnofork +Do not create another JVM, even if the JNLP file asks for running in +a separate JVM. This is useful for debugging. +.TP +\-Jjava-option +This passes along java-option to the java binary that is running +javaws. For example, to make javaws run with a max heap size +of 80m, use -J-Xmx80m. +.TP +\-help +Print a help message and exit. + +.SH FILES +~/.netxrc specifies the location of the base directory + +.SH BUGS +There arent any known bugs. If you come across one, please file it at + http://icedtea.classpath.org/bugzilla/ +.br +Please run javaws in verbose mode and include that output along +with the jnlp file when filing out the bug report. + +.SH AUTHOR +Originally written by Jon. A. Maxwell. +.br +Currently maintained by the IcedTea contributors. + +.SH SEE ALSO +.BR java (1) +.br +http://icedtea.classpath.org/ +.br +http://jnlp.sourceforge.net/netx/ diff -r 43a38e678ae4 -r a0fc1afc5d95 patches/hotspot/hs16/systemtap.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/hotspot/hs16/systemtap.patch Wed Oct 13 00:23:00 2010 +0100 @@ -0,0 +1,186 @@ +diff -Nru openjdk.orig/hotspot/make/linux/makefiles/dtrace.make openjdk/hotspot/make/linux/makefiles/dtrace.make +--- openjdk.orig/hotspot/make/linux/makefiles/dtrace.make 2009-12-08 23:12:17.000000000 +0000 ++++ openjdk/hotspot/make/linux/makefiles/dtrace.make 2010-10-11 18:11:25.552094175 +0100 +@@ -25,3 +25,7 @@ + # Linux does not build jvm_db + LIBJVM_DB = + ++# But it does have a Systemtap dtrace compatible sys/sdt.h ++CFLAGS += -DDTRACE_ENABLED ++ ++# It doesn't support HAVE_DTRACE_H though. +diff -Nru openjdk.orig/hotspot/src/share/vm/prims/jni.cpp openjdk/hotspot/src/share/vm/prims/jni.cpp +--- openjdk.orig/hotspot/src/share/vm/prims/jni.cpp 2010-10-11 17:53:58.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/prims/jni.cpp 2010-10-11 18:11:25.552094175 +0100 +@@ -1753,10 +1753,7 @@ + JNI_QUICK_ENTRY(void, jni_Set##Result##Field(JNIEnv *env, jobject obj, jfieldID fieldID, Argument value)) \ + JNIWrapper("Set" XSTR(Result) "Field"); \ + \ +- HS_DTRACE_PROBE_CDECL_N(hotspot_jni, Set##Result##Field__entry, \ +- ( JNIEnv*, jobject, jfieldID FP_SELECT_##Result(COMMA Argument,/*empty*/) ) ); \ +- HS_DTRACE_PROBE_N(hotspot_jni, Set##Result##Field__entry, \ +- ( env, obj, fieldID FP_SELECT_##Result(COMMA value,/*empty*/) ) ); \ ++ FP_SELECT_##Result(DTRACE_PROBE4(hotspot_jni, Set##Result##Field__entry, env, obj, fieldID, value),DTRACE_PROBE3(hotspot_jni, Set##Result##Field__entry, env, obj, fieldID)); \ + \ + oop o = JNIHandles::resolve_non_null(obj); \ + klassOop k = o->klass(); \ +@@ -1930,10 +1927,7 @@ + \ + JNI_ENTRY(void, jni_SetStatic##Result##Field(JNIEnv *env, jclass clazz, jfieldID fieldID, Argument value)) \ + JNIWrapper("SetStatic" XSTR(Result) "Field"); \ +- HS_DTRACE_PROBE_CDECL_N(hotspot_jni, SetStatic##Result##Field__entry,\ +- ( JNIEnv*, jclass, jfieldID FP_SELECT_##Result(COMMA Argument,/*empty*/) ) ); \ +- HS_DTRACE_PROBE_N(hotspot_jni, SetStatic##Result##Field__entry, \ +- ( env, clazz, fieldID FP_SELECT_##Result(COMMA value,/*empty*/) ) ); \ ++ FP_SELECT_##Result(DTRACE_PROBE4(hotspot_jni, SetStatic##Result##Field__entry, env, clazz, fieldID, value),DTRACE_PROBE3(hotspot_jni, SetStatic##Result##Field__entry, env, clazz, fieldID)); \ + \ + JNIid* id = jfieldIDWorkaround::from_static_jfieldID(fieldID); \ + assert(id->is_static_field_id(), "invalid static field id"); \ +@@ -2116,7 +2110,7 @@ + DT_RETURN_MARK(GetObjectArrayElement, jobject, (const jobject&)ret); + objArrayOop a = objArrayOop(JNIHandles::resolve_non_null(array)); + if (a->is_within_bounds(index)) { +- jobject ret = JNIHandles::make_local(env, a->obj_at(index)); ++ ret = JNIHandles::make_local(env, a->obj_at(index)); + return ret; + } else { + char buf[jintAsStringSize]; +@@ -2150,14 +2144,14 @@ + + #define DEFINE_NEWSCALARARRAY(Return,Allocator,Result) \ + \ From andrew at icedtea.classpath.org Tue Oct 12 16:23:46 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 12 Oct 2010 23:23:46 +0000 Subject: /hg/release/icedtea6-1.9: 6 new changesets Message-ID: changeset 821336d74fc7 in /hg/release/icedtea6-1.9 details: http://icedtea.classpath.org/hg/release/icedtea6-1.9?cmd=changeset;node=821336d74fc7 author: Andrew John Hughes date: Wed Oct 06 00:23:56 2010 +0100 Security update. 2010-10-05 Andrew John Hughes * patches/security/20100330/hotspot/original/6626217.patch: Remove dead security patch. * Makefile.am: Add new patches. * NEWS: List security updates. * patches/security/20101012/6559775.patch, * patches/security/20101012/6891766.patch, * patches/security/20101012/6914943.patch, * patches/security/20101012/6925710.patch, * patches/security/20101012/6938813.patch, * patches/security/20101012/6957564.patch, * patches/security/20101012/6958060.patch, * patches/security/20101012/6963023.patch, * patches/security/20101012/6963489.patch, * patches/security/20101012/6966692.patch: New security patches. changeset 5a4598d77f03 in /hg/release/icedtea6-1.9 details: http://icedtea.classpath.org/hg/release/icedtea6-1.9?cmd=changeset;node=5a4598d77f03 author: Andrew John Hughes date: Wed Oct 06 16:22:46 2010 +0100 Bump to 1.9.1 proper and set assumed date of release. 2010-10-06 Andrew John Hughes * configure.ac: Bump to 1.9.1 proper. * NEWS: Set date of 1.9.1 to 2010-10-13. changeset 93e1ae5ab337 in /hg/release/icedtea6-1.9 details: http://icedtea.classpath.org/hg/release/icedtea6-1.9?cmd=changeset;node=93e1ae5ab337 author: Andrew John Hughes date: Mon Oct 11 23:32:31 2010 +0100 Second batch of security updates. 2010-10-11 Andrew John Hughes * patches/icedtea-timerqueue.patch: Dropped; superceded by 6623943. * Makefile.am: Add new security patches. * NEWS: List new security patches. * patches/security/20101012/6622002.patch, * patches/security/20101012/6623943.patch, * patches/security/20101012/6952017.patch, * patches/security/20101012/6952603.patch, * patches/security/20101012/6961084.patch, * patches/security/20101012/6963285.patch, * patches/security/20101012/6981426.patch, * patches/security/20101012/6990437.patch: Added. changeset e71a0bed639b in /hg/release/icedtea6-1.9 details: http://icedtea.classpath.org/hg/release/icedtea6-1.9?cmd=changeset;node=e71a0bed639b author: andrew date: Mon Oct 11 22:31:47 2010 +0100 Add CVE numbers. 2010-10-11 Andrew John Hughes * NEWS: Add CVE numbers and list 6925672 which is covered by the 6891766 fix. changeset 2fa3935ab384 in /hg/release/icedtea6-1.9 details: http://icedtea.classpath.org/hg/release/icedtea6-1.9?cmd=changeset;node=2fa3935ab384 author: Andrew John Hughes date: Tue Oct 12 14:07:07 2010 +0100 Ensure man page directory exists before copying javaws man page. 2010-10-12 Andrew John Hughes * Makefile.am: (add-netx): Ensure directory exists before copying javaws man page. (add-netx-debug): Likewise. changeset dd9c36d63a95 in /hg/release/icedtea6-1.9 details: http://icedtea.classpath.org/hg/release/icedtea6-1.9?cmd=changeset;node=dd9c36d63a95 author: Andrew John Hughes date: Wed Oct 13 00:23:28 2010 +0100 Added tag icedtea6-1.9.1 for changeset 2fa3935ab384 diffstat: 25 files changed, 5184 insertions(+), 209 deletions(-) .hgtags | 1 ChangeLog | 51 Makefile.am | 46 NEWS | 24 configure.ac | 2 patches/icedtea-timerqueue.patch | 18 patches/security/20100330/hotspot/original/6626217.patch | 180 - patches/security/20101012/6559775.patch | 317 ++ patches/security/20101012/6622002.patch | 64 patches/security/20101012/6623943.patch | 138 patches/security/20101012/6891766.patch | 1147 +++++++ patches/security/20101012/6914943.patch | 2129 ++++++++++++++ patches/security/20101012/6925710.patch | 198 + patches/security/20101012/6938813.patch | 196 + patches/security/20101012/6952017.patch | 50 patches/security/20101012/6952603.patch | 38 patches/security/20101012/6957564.patch | 77 patches/security/20101012/6958060.patch | 15 patches/security/20101012/6961084.patch | 325 ++ patches/security/20101012/6963023.patch | 95 patches/security/20101012/6963285.patch | 20 patches/security/20101012/6963489.patch | 31 patches/security/20101012/6966692.patch | 91 patches/security/20101012/6981426.patch | 24 patches/security/20101012/6990437.patch | 116 diffs (truncated from 5537 to 500 lines): diff -r f1c14c74edd7 -r dd9c36d63a95 .hgtags --- a/.hgtags Mon Oct 04 23:47:52 2010 +0100 +++ b/.hgtags Wed Oct 13 00:23:28 2010 +0100 @@ -20,3 +20,4 @@ 9420faca6468e1c75e9bfa73b31246ba0b73a77d 9420faca6468e1c75e9bfa73b31246ba0b73a77d icedtea6-1.8-branchpoint cb463b94b82da269ea089c481ed5e39700525a8a icedtea6-1.9-branch 5464f814f82f7d9c8428179a71c51f11094717fd icedtea6-1.9 +2fa3935ab384958d06614cec587506702bc8e658 icedtea6-1.9.1 diff -r f1c14c74edd7 -r dd9c36d63a95 ChangeLog --- a/ChangeLog Mon Oct 04 23:47:52 2010 +0100 +++ b/ChangeLog Wed Oct 13 00:23:28 2010 +0100 @@ -1,3 +1,54 @@ 2010-09-17 Andrew John Hughes + + * Makefile.am: + (add-netx): Ensure directory exists before + copying javaws man page. + (add-netx-debug): Likewise. + +2010-10-11 Andrew John Hughes + + * NEWS: Add CVE numbers and list 6925672 + which is covered by the 6891766 fix. + +2010-10-11 Andrew John Hughes + + * patches/icedtea-timerqueue.patch: + Dropped; superceded by 6623943. + * Makefile.am: Add new security patches. + * NEWS: List new security patches. + * patches/security/20101012/6622002.patch, + * patches/security/20101012/6623943.patch, + * patches/security/20101012/6952017.patch, + * patches/security/20101012/6952603.patch, + * patches/security/20101012/6961084.patch, + * patches/security/20101012/6963285.patch, + * patches/security/20101012/6981426.patch, + * patches/security/20101012/6990437.patch: + Added. + +2010-10-06 Andrew John Hughes + + * configure.ac: Bump to 1.9.1 proper. + * NEWS: Set date of 1.9.1 to 2010-10-13. + +2010-10-05 Andrew John Hughes + + * patches/security/20100330/hotspot/original/6626217.patch: + Remove dead security patch. + * Makefile.am: Add new patches. + * NEWS: List security updates. + * patches/security/20101012/6559775.patch, + * patches/security/20101012/6891766.patch, + * patches/security/20101012/6914943.patch, + * patches/security/20101012/6925710.patch, + * patches/security/20101012/6938813.patch, + * patches/security/20101012/6957564.patch, + * patches/security/20101012/6958060.patch, + * patches/security/20101012/6963023.patch, + * patches/security/20101012/6963489.patch, + * patches/security/20101012/6966692.patch: + New security patches. + 2010-09-17 Andrew John Hughes * Makefile.am: diff -r f1c14c74edd7 -r dd9c36d63a95 Makefile.am --- a/Makefile.am Mon Oct 04 23:47:52 2010 +0100 +++ b/Makefile.am Wed Oct 13 00:23:28 2010 +0100 @@ -199,7 +199,28 @@ REWRITER_SRCS = $(abs_top_srcdir)/rewrit ICEDTEA_FSG_PATCHES = +SECURITY_PATCHES = \ + patches/security/20101012/6891766.patch \ + patches/security/20101012/6925710.patch \ + patches/security/20101012/6938813.patch \ + patches/security/20101012/6957564.patch \ + patches/security/20101012/6958060.patch \ + patches/security/20101012/6963023.patch \ + patches/security/20101012/6963489.patch \ + patches/security/20101012/6966692.patch \ + patches/security/20101012/6914943.patch \ + patches/security/20101012/6559775.patch \ + patches/security/20101012/6622002.patch \ + patches/security/20101012/6623943.patch \ + patches/security/20101012/6952017.patch \ + patches/security/20101012/6952603.patch \ + patches/security/20101012/6961084.patch \ + patches/security/20101012/6963285.patch \ + patches/security/20101012/6981426.patch \ + patches/security/20101012/6990437.patch + ICEDTEA_PATCHES = \ + $(SECURITY_PATCHES) \ patches/icedtea-notice-safepoints.patch \ patches/icedtea-parisc-opt.patch \ patches/icedtea-lucene-crash.patch \ @@ -221,7 +242,6 @@ ICEDTEA_PATCHES = \ patches/icedtea-javafiles.patch \ patches/icedtea-jvmtiEnv.patch \ patches/icedtea-lcms.patch \ - patches/icedtea-timerqueue.patch \ patches/hotspot/$(HSBUILD)/print_lsb_release.patch \ patches/icedtea-jpegclasses.patch \ patches/icedtea-uname.patch \ @@ -1438,10 +1458,14 @@ stamps/add-netx.stamp: stamps/netx-dist. $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib cp $(NETX_RESOURCE_DIR)/about.jnlp extra-lib/about.jar \ $(BUILD_OUTPUT_DIR)/j2re-image/lib - cp $(NETX_SRCDIR)/javaws.1 \ - $(BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 - cp $(NETX_SRCDIR)/javaws.1 \ - $(BUILD_OUTPUT_DIR)/j2re-image/man/man1 + if [ -d $(BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 ] ; then \ + cp $(NETX_SRCDIR)/javaws.1 \ + $(BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 ; \ + fi + if [ -d $(BUILD_OUTPUT_DIR)/j2re-image/man/man1 ] ; then \ + cp $(NETX_SRCDIR)/javaws.1 \ + $(BUILD_OUTPUT_DIR)/j2re-image/man/man1 ; \ + fi touch stamps/add-netx.stamp clean-add-netx: @@ -1464,10 +1488,14 @@ stamps/add-netx-debug.stamp: stamps/netx $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib cp $(NETX_RESOURCE_DIR)/about.jnlp extra-lib/about.jar \ $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib - cp $(NETX_SRCDIR)/javaws.1 \ - $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 - cp $(NETX_SRCDIR)/javaws.1 \ - $(BUILD_OUTPUT_DIR)/j2re-image/man/man1 + if [ -d $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 ] ; then \ + cp $(NETX_SRCDIR)/javaws.1 \ + $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 ; \ + fi + if [ -d $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/man/man1 ] ; then \ + cp $(NETX_SRCDIR)/javaws.1 \ + $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/man/man1 ; \ + fi touch stamps/add-netx-debug.stamp clean-add-netx-debug: diff -r f1c14c74edd7 -r dd9c36d63a95 NEWS --- a/NEWS Mon Oct 04 23:47:52 2010 +0100 +++ b/NEWS Wed Oct 13 00:23:28 2010 +0100 @@ -8,8 +8,30 @@ GX - http://bugs.gentoo.org/show_bug.cg CVE-XXXX-YYYY: http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY -New in release 1.9.1 (2010-XX-XX): +New in release 1.9.1 (2010-10-13): + * HotSpot 19 supported; use --with-hotspot-build=hs19 to enable. +* Security updates + - S6914943, CVE-2009-3555: TLS: MITM attacks via session renegotiation + - S6559775, CVE-2010-3568: OpenJDK Deserialization Race condition + - S6891766, CVE-2010-3554: OpenJDK corba reflection vulnerabilities + - S6925710, CVE-2010-3562: OpenJDK IndexColorModel double-free + - S6938813, CVE-2010-3557: OpenJDK Swing mutable static + - S6957564, CVE-2010-3548: OpenJDK DNS server IP address information leak + - S6958060, CVE-2010-3564: OpenJDK kerberos vulnerability + - S6963023, CVE-2010-3565: OpenJDK JPEG writeImage remote code execution + - S6963489, CVE-2010-3566: OpenJDK ICC Profile remote code execution + - S6966692, CVE-2010-3569: OpenJDK Serialization inconsistencies + - S6622002, CVE-2010-3553: UIDefault.ProxyLazyValue has unsafe reflection usage + - S6623943: javax.swing.TimerQueue's thread occasionally fails to start + - S6925672, CVE-2010-3561: Privileged ServerSocket.accept allows receiving connections from any host + - S6952017, CVE-2010-3549: HttpURLConnection chunked encoding issue (Http request splitting) + - S6952603, CVE-2010-3551: NetworkInterface reveals local network address to untrusted code + - S6961084, CVE-2010-3541: limit setting of some request headers in HttpURLConnection + - S6963285, CVE-2010-3567: Crash in ICU Opentype layout engine due to mismatch in character counts + - S6980004, CVE-2010-3573: limit HTTP request cookie headers in HttpURLConnection + - S6981426, CVE-2010-3574: limit use of TRACE method in HttpURLConnection + - S6990437: Update with correct copyright info for source and test files from SSR10_02 fixes * Backports - S6638712: Inference with wildcard types causes selection of inapplicable method - S6650759: Inference of formal type parameter (unused in formal parameters) is not performed diff -r f1c14c74edd7 -r dd9c36d63a95 configure.ac --- a/configure.ac Mon Oct 04 23:47:52 2010 +0100 +++ b/configure.ac Wed Oct 13 00:23:28 2010 +0100 @@ -1,4 +1,4 @@ AC_INIT([icedtea6],[1.9.1pre],[distro-pk -AC_INIT([icedtea6],[1.9.1pre],[distro-pkg-dev at openjdk.java.net]) +AC_INIT([icedtea6],[1.9.1],[distro-pkg-dev at openjdk.java.net]) AM_INIT_AUTOMAKE([1.9 tar-pax foreign]) AC_CONFIG_FILES([Makefile]) diff -r f1c14c74edd7 -r dd9c36d63a95 patches/icedtea-timerqueue.patch --- a/patches/icedtea-timerqueue.patch Mon Oct 04 23:47:52 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ ---- TimerQueue.java.orig 2007-12-13 14:08:33.000000000 -0500 -+++ openjdk/jdk/src/share/classes/javax/swing/TimerQueue.java 2007-12-13 14:08:52.000000000 -0500 -@@ -106,7 +106,6 @@ - return null; - } - }); -- running = true; - } - } - -@@ -164,6 +163,7 @@ - - - public void run() { -+ running = true; - try { - while (running) { - try { diff -r f1c14c74edd7 -r dd9c36d63a95 patches/security/20100330/hotspot/original/6626217.patch --- a/patches/security/20100330/hotspot/original/6626217.patch Mon Oct 04 23:47:52 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,180 +0,0 @@ -# HG changeset patch -# User acorn -# Date 1261523209 18000 -# Node ID 209a7a8a8f966dc4d6b45333cf4f3fa6648a6ecb -# Parent 75e095764f403b7425e30711b00cc038554a1ae9 -6626217: Fixed loader constraint array handling -Summary: Loader constraints track array elements, not arrays themselves. -Reviewed-by: dcubed, kevinw - -diff --git openjdk.orig/hotspot/src/share/vm/ci/ciEnv.cpp openjdk/hotspot/src/share/vm/ci/ciEnv.cpp ---- openjdk.orig/hotspot/src/share/vm/ci/ciEnv.cpp -+++ openjdk/hotspot/src/share/vm/ci/ciEnv.cpp -@@ -348,30 +348,6 @@ ciKlass* ciEnv::get_klass_by_name_impl(c - if (found_klass != NULL) { - // Found it. Build a CI handle. - return get_object(found_klass)->as_klass(); -- } -- -- // If we fail to find an array klass, look again for its element type. -- // The element type may be available either locally or via constraints. -- // In either case, if we can find the element type in the system dictionary, -- // we must build an array type around it. The CI requires array klasses -- // to be loaded if their element klasses are loaded, except when memory -- // is exhausted. -- if (sym->byte_at(0) == '[' && -- (sym->byte_at(1) == '[' || sym->byte_at(1) == 'L')) { -- // We have an unloaded array. -- // Build it on the fly if the element class exists. -- symbolOop elem_sym = oopFactory::new_symbol(sym->as_utf8()+1, -- sym->utf8_length()-1, -- KILL_COMPILE_ON_FATAL_(fail_type)); -- // Get element ciKlass recursively. -- ciKlass* elem_klass = -- get_klass_by_name_impl(accessing_klass, -- get_object(elem_sym)->as_symbol(), -- require_local); -- if (elem_klass != NULL && elem_klass->is_loaded()) { -- // Now make an array for it -- return ciObjArrayKlass::make_impl(elem_klass); -- } - } - - if (require_local) return NULL; -diff --git openjdk.orig/hotspot/src/share/vm/classfile/loaderConstraints.cpp openjdk/hotspot/src/share/vm/classfile/loaderConstraints.cpp ---- openjdk.orig/hotspot/src/share/vm/classfile/loaderConstraints.cpp -+++ openjdk/hotspot/src/share/vm/classfile/loaderConstraints.cpp -@@ -338,32 +338,6 @@ klassOop LoaderConstraintTable::find_con - } - - --klassOop LoaderConstraintTable::find_constrained_elem_klass(symbolHandle name, -- symbolHandle elem_name, -- Handle loader, -- TRAPS) { -- LoaderConstraintEntry *p = *(find_loader_constraint(name, loader)); -- if (p != NULL) { -- assert(p->klass() == NULL, "Expecting null array klass"); -- -- // The array name has a constraint, but it will not have a class. Check -- // each loader for an associated elem -- for (int i = 0; i < p->num_loaders(); i++) { -- Handle no_protection_domain; -- -- klassOop k = SystemDictionary::find(elem_name, p->loader(i), no_protection_domain, THREAD); -- if (k != NULL) { -- // Return the first elem klass found. -- return k; -- } -- } -- } -- -- // No constraints, or else no klass loaded yet. -- return NULL; --} -- -- - void LoaderConstraintTable::ensure_loader_constraint_capacity( - LoaderConstraintEntry *p, - int nfree) { -diff --git openjdk.orig/hotspot/src/share/vm/classfile/loaderConstraints.hpp openjdk/hotspot/src/share/vm/classfile/loaderConstraints.hpp ---- openjdk.orig/hotspot/src/share/vm/classfile/loaderConstraints.hpp -+++ openjdk/hotspot/src/share/vm/classfile/loaderConstraints.hpp -@@ -67,9 +67,6 @@ public: - Handle loader2, bool is_method, TRAPS); - - klassOop find_constrained_klass(symbolHandle name, Handle loader); -- klassOop find_constrained_elem_klass(symbolHandle name, symbolHandle elem_name, -- Handle loader, TRAPS); -- - - // Class loader constraints - -diff --git openjdk.orig/hotspot/src/share/vm/classfile/systemDictionary.cpp openjdk/hotspot/src/share/vm/classfile/systemDictionary.cpp ---- openjdk.orig/hotspot/src/share/vm/classfile/systemDictionary.cpp -+++ openjdk/hotspot/src/share/vm/classfile/systemDictionary.cpp -@@ -2113,9 +2113,8 @@ klassOop SystemDictionary::find_constrai - // a loader constraint that would require this loader to return the - // klass that is already loaded. - if (FieldType::is_array(class_name())) { -- // Array classes are hard because their klassOops are not kept in the -- // constraint table. The array klass may be constrained, but the elem class -- // may not be. -+ // For array classes, their klassOops are not kept in the -+ // constraint table. The element klassOops are. - jint dimension; - symbolOop object_key; - BasicType t = FieldType::get_array_info(class_name(), &dimension, -@@ -2125,8 +2124,9 @@ klassOop SystemDictionary::find_constrai - } else { - symbolHandle elem_name(THREAD, object_key); - MutexLocker mu(SystemDictionary_lock, THREAD); -- klass = constraints()->find_constrained_elem_klass(class_name, elem_name, class_loader, THREAD); -+ klass = constraints()->find_constrained_klass(elem_name, class_loader); - } -+ // If element class already loaded, allocate array klass - if (klass != NULL) { - klass = Klass::cast(klass)->array_klass_or_null(dimension); - } -@@ -2142,24 +2142,40 @@ klassOop SystemDictionary::find_constrai - - bool SystemDictionary::add_loader_constraint(symbolHandle class_name, - Handle class_loader1, -- Handle class_loader2, -- Thread* THREAD) { -- unsigned int d_hash1 = dictionary()->compute_hash(class_name, class_loader1); -+ Handle class_loader2, -+ Thread* THREAD) { -+ symbolHandle constraint_name; -+ if (!FieldType::is_array(class_name())) { -+ constraint_name = class_name; -+ } else { -+ // For array classes, their klassOops are not kept in the -+ // constraint table. The element classes are. -+ jint dimension; -+ symbolOop object_key; -+ BasicType t = FieldType::get_array_info(class_name(), &dimension, -+ &object_key, CHECK_(false)); -+ // primitive types always pass -+ if (t != T_OBJECT) { -+ return true; -+ } else { -+ constraint_name = symbolHandle(THREAD, object_key); -+ } -+ } -+ unsigned int d_hash1 = dictionary()->compute_hash(constraint_name, class_loader1); - int d_index1 = dictionary()->hash_to_index(d_hash1); - -- unsigned int d_hash2 = dictionary()->compute_hash(class_name, class_loader2); -+ unsigned int d_hash2 = dictionary()->compute_hash(constraint_name, class_loader2); - int d_index2 = dictionary()->hash_to_index(d_hash2); -+ { -+ MutexLocker mu_s(SystemDictionary_lock, THREAD); - -- { -- MutexLocker mu_s(SystemDictionary_lock, THREAD); -+ // Better never do a GC while we're holding these oops -+ No_Safepoint_Verifier nosafepoint; - -- // Better never do a GC while we're holding these oops -- No_Safepoint_Verifier nosafepoint; -- -- klassOop klass1 = find_class(d_index1, d_hash1, class_name, class_loader1); -- klassOop klass2 = find_class(d_index2, d_hash2, class_name, class_loader2); -- return constraints()->add_entry(class_name, klass1, class_loader1, -- klass2, class_loader2); -+ klassOop klass1 = find_class(d_index1, d_hash1, constraint_name, class_loader1); -+ klassOop klass2 = find_class(d_index2, d_hash2, constraint_name, class_loader2); -+ return constraints()->add_entry(constraint_name, klass1, class_loader1, -+ klass2, class_loader2); - } - } - -@@ -2191,6 +2207,7 @@ symbolOop SystemDictionary::find_resolut - // Returns the name of the type that failed a loader constraint check, or - // NULL if no constraint failed. The returned C string needs cleaning up - // with a ResourceMark in the caller -+// Arrays are not added to the loader constraint table, their elements are. - char* SystemDictionary::check_signature_loaders(symbolHandle signature, - Handle loader1, Handle loader2, - bool is_method, TRAPS) { diff -r f1c14c74edd7 -r dd9c36d63a95 patches/security/20101012/6559775.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/security/20101012/6559775.patch Wed Oct 13 00:23:28 2010 +0100 @@ -0,0 +1,317 @@ +# HG changeset patch +# User skoppar +# Date 1285671517 25200 +# Node ID 57681551c11efbec9906bdf321554aabcac25228 +# Parent bb1c74cae929a5903c0aca64b9e5a7f67726b02a +6559775: Race allows defaultReadObject to be invoked instead of readFields during deserialization +Reviewed-by: hawtin + +diff --git a/make/java/java/FILES_java.gmk b/make/java/java/FILES_java.gmk +--- openjdk.orig/jdk/make/java/java/FILES_java.gmk ++++ openjdk/jdk/make/java/java/FILES_java.gmk +@@ -384,6 +384,7 @@ JAVA_JAVA_java = \ + java/io/FilePermission.java \ + java/io/Serializable.java \ + java/io/Externalizable.java \ ++ java/io/SerialCallbackContext.java \ + java/io/Bits.java \ + java/io/ObjectInput.java \ + java/io/ObjectInputStream.java \ +diff --git a/src/share/classes/java/io/ObjectInputStream.java b/src/share/classes/java/io/ObjectInputStream.java +--- openjdk.orig/jdk/src/share/classes/java/io/ObjectInputStream.java ++++ openjdk/jdk/src/share/classes/java/io/ObjectInputStream.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -264,7 +264,7 @@ public class ObjectInputStream + * object currently being deserialized and descriptor for current class. + * Null when not during readObject upcall. + */ +- private CallbackContext curContext; ++ private SerialCallbackContext curContext; + + /** + * Creates an ObjectInputStream that reads from the specified InputStream. +@@ -1797,7 +1797,7 @@ public class ObjectInputStream + private void readExternalData(Externalizable obj, ObjectStreamClass desc) + throws IOException + { +- CallbackContext oldContext = curContext; ++ SerialCallbackContext oldContext = curContext; + curContext = null; + try { + boolean blocked = desc.hasBlockExternalData(); +@@ -1856,10 +1856,10 @@ public class ObjectInputStream + slotDesc.hasReadObjectMethod() && + handles.lookupException(passHandle) == null) + { +- CallbackContext oldContext = curContext; ++ SerialCallbackContext oldContext = curContext; + + try { +- curContext = new CallbackContext(obj, slotDesc); ++ curContext = new SerialCallbackContext(obj, slotDesc); + + bin.setBlockDataMode(true); + slotDesc.invokeReadObject(obj, this); +@@ -3504,42 +3504,4 @@ public class ObjectInputStream + } + } + +- /** +- * Context that during upcalls to class-defined readObject methods; holds +- * object currently being deserialized and descriptor for current class. +- * This context keeps a boolean state to indicate that defaultReadObject +- * or readFields has already been invoked with this context or the class's +- * readObject method has returned; if true, the getObj method throws +- * NotActiveException. +- */ +- private static class CallbackContext { +- private final Object obj; +- private final ObjectStreamClass desc; +- private final AtomicBoolean used = new AtomicBoolean(); +- +- public CallbackContext(Object obj, ObjectStreamClass desc) { +- this.obj = obj; +- this.desc = desc; +- } +- +- public Object getObj() throws NotActiveException { +- checkAndSetUsed(); +- return obj; +- } +- +- public ObjectStreamClass getDesc() { +- return desc; +- } +- +- private void checkAndSetUsed() throws NotActiveException { +- if (!used.compareAndSet(false, true)) { +- throw new NotActiveException( +- "not in readObject invocation or fields already read"); +- } +- } +- +- public void setUsed() { +- used.set(true); +- } +- } From andrew at icedtea.classpath.org Tue Oct 12 16:26:09 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 12 Oct 2010 23:26:09 +0000 Subject: /hg/icedtea6: 5 new changesets Message-ID: changeset d8115f447e6f in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=d8115f447e6f author: andrew date: Tue Oct 05 13:56:11 2010 +0100 Security updates for 2010/10/12. 2010-10-05 Andrew John Hughes * patches/security/20100330/hotspot/original/6626217.patch: Remove dead security patch. * Makefile.am: Add new patches. * NEWS: List security updates. * patches/security/20101012/6559775.patch, * patches/security/20101012/6891766.patch, * patches/security/20101012/6914943.patch, * patches/security/20101012/6925710.patch, * patches/security/20101012/6938813.patch, * patches/security/20101012/6957564.patch, * patches/security/20101012/6958060.patch, * patches/security/20101012/6963023.patch, * patches/security/20101012/6963489.patch, * patches/security/20101012/6966692.patch: New security patches. changeset 420a4eede08d in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=420a4eede08d author: andrew date: Mon Oct 11 21:05:13 2010 +0100 Second batch of security updates. 2010-10-11 Andrew John Hughes * patches/icedtea-timerqueue.patch: Dropped; superceded by 6623943. * Makefile.am: Add new security patches. * NEWS: List new security patches. * patches/security/20101012/6622002.patch, * patches/security/20101012/6623943.patch, * patches/security/20101012/6952017.patch, * patches/security/20101012/6952603.patch, * patches/security/20101012/6961084.patch, * patches/security/20101012/6963285.patch, * patches/security/20101012/6981426.patch, * patches/security/20101012/6990437.patch: Added. changeset f4f7b88ae02c in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=f4f7b88ae02c author: andrew date: Mon Oct 11 21:06:13 2010 +0100 Merge changeset 2c5c2c6f314a in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=2c5c2c6f314a author: andrew date: Mon Oct 11 22:31:47 2010 +0100 Add CVE numbers. 2010-10-11 Andrew John Hughes * NEWS: Add CVE numbers and list 6925672 which is covered by the 6891766 fix. changeset c66cf32a25db in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=c66cf32a25db author: andrew date: Wed Oct 13 00:25:56 2010 +0100 Merge diffstat: 29 files changed, 5419 insertions(+), 210 deletions(-) ChangeLog | 67 Makefile.am | 63 NEWS | 22 netx/net/sourceforge/jnlp/Launcher.java | 77 netx/net/sourceforge/jnlp/cache/CacheUtil.java | 71 netx/net/sourceforge/jnlp/resources/Messages.properties | 2 netx/net/sourceforge/jnlp/runtime/Boot.java | 13 netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java | 10 netx/net/sourceforge/jnlp/util/FileUtils.java | 35 patches/icedtea-timerqueue.patch | 18 patches/security/20100330/hotspot/original/6626217.patch | 180 - patches/security/20101012/6559775.patch | 317 ++ patches/security/20101012/6622002.patch | 64 patches/security/20101012/6623943.patch | 138 patches/security/20101012/6891766.patch | 1147 +++++++ patches/security/20101012/6914943.patch | 2129 ++++++++++++++ patches/security/20101012/6925710.patch | 198 + patches/security/20101012/6938813.patch | 196 + patches/security/20101012/6952017.patch | 50 patches/security/20101012/6952603.patch | 38 patches/security/20101012/6957564.patch | 77 patches/security/20101012/6958060.patch | 15 patches/security/20101012/6961084.patch | 325 ++ patches/security/20101012/6963023.patch | 95 patches/security/20101012/6963285.patch | 20 patches/security/20101012/6963489.patch | 31 patches/security/20101012/6966692.patch | 91 patches/security/20101012/6981426.patch | 24 patches/security/20101012/6990437.patch | 116 diffs (truncated from 5953 to 500 lines): diff -r f41b0a7fbd70 -r c66cf32a25db ChangeLog --- a/ChangeLog Mon Oct 04 18:13:02 2010 -0400 +++ b/ChangeLog Wed Oct 13 00:25:56 2010 +0100 @@ -1,3 +1,70 @@ 2010-10-04 Paul Ebermann + + * Makefile.am (stamps/add-plugin.stamp, stamps/add-plugin-debug.stamp, + stamps/add-pulseaudio-debug.stamp, stamps/add-plugin-ecj.stamp): Robustify. + (ADD_ZERO_CONFIGURE_ARGS): Adjust to new configure flags. + (stamps/add-zero.stamp): Explicitly create directories that icedtea + components assume to be created by the jdk build (not built in zerovm). + +2010-10-11 Andrew John Hughes + + * NEWS: Add CVE numbers and list 6925672 + which is covered by the 6891766 fix. + +2010-10-11 Andrew John Hughes + + * patches/icedtea-timerqueue.patch: + Dropped; superceded by 6623943. + * Makefile.am: Add new security patches. + * NEWS: List new security patches. + * patches/security/20101012/6622002.patch, + * patches/security/20101012/6623943.patch, + * patches/security/20101012/6952017.patch, + * patches/security/20101012/6952603.patch, + * patches/security/20101012/6961084.patch, + * patches/security/20101012/6963285.patch, + * patches/security/20101012/6981426.patch, + * patches/security/20101012/6990437.patch: + Added. + +2010-10-08 Omair Majid + + * NEWS: Updated + * net/sourceforge/jnlp/Launcher.java: Add fileLock. + (launchApplication): Call markNetxRunning and install a shutdown hook for + markNetxStopped. + (markNetxRunning): New method. + (markNetxStopped): New method. + * net/sourceforge/jnlp/cache/CacheUtil.java + (R): New method. + (clearCache): New method. + (okToClearCache): New method. + * net/sourceforge/jnlp/resources/Messages.properties: Add BXclearcache and + CCannotClearCache. + * net/sourceforge/jnlp/runtime/Boot.java + (run): Clear the cache. + * net/sourceforge/jnlp/runtime/JNLPRuntime.java: Add NETX_RUNNING_FILE. + * net/sourceforge/jnlp/util/FileUtils.java + (recursiveDelete): New method. + +2010-10-05 Andrew John Hughes + + * patches/security/20100330/hotspot/original/6626217.patch: + Remove dead security patch. + * Makefile.am: Add new patches. + * NEWS: List security updates. + * patches/security/20101012/6559775.patch, + * patches/security/20101012/6891766.patch, + * patches/security/20101012/6914943.patch, + * patches/security/20101012/6925710.patch, + * patches/security/20101012/6938813.patch, + * patches/security/20101012/6957564.patch, + * patches/security/20101012/6958060.patch, + * patches/security/20101012/6963023.patch, + * patches/security/20101012/6963489.patch, + * patches/security/20101012/6966692.patch: + New security patches. + 2010-10-04 Paul Ebermann Omair Majid diff -r f41b0a7fbd70 -r c66cf32a25db Makefile.am --- a/Makefile.am Mon Oct 04 18:13:02 2010 -0400 +++ b/Makefile.am Wed Oct 13 00:25:56 2010 +0100 @@ -197,7 +197,30 @@ REWRITER_SRCS = $(abs_top_srcdir)/rewrit ICEDTEA_FSG_PATCHES = +BROKEN = + +SECURITY_PATCHES = \ + patches/security/20101012/6891766.patch \ + patches/security/20101012/6925710.patch \ + patches/security/20101012/6938813.patch \ + patches/security/20101012/6957564.patch \ + patches/security/20101012/6958060.patch \ + patches/security/20101012/6963023.patch \ + patches/security/20101012/6963489.patch \ + patches/security/20101012/6966692.patch \ + patches/security/20101012/6914943.patch \ + patches/security/20101012/6559775.patch \ + patches/security/20101012/6622002.patch \ + patches/security/20101012/6623943.patch \ + patches/security/20101012/6952017.patch \ + patches/security/20101012/6952603.patch \ + patches/security/20101012/6961084.patch \ + patches/security/20101012/6963285.patch \ + patches/security/20101012/6981426.patch \ + patches/security/20101012/6990437.patch + ICEDTEA_PATCHES = \ + $(SECURITY_PATCHES) \ patches/icedtea-notice-safepoints.patch \ patches/icedtea-parisc-opt.patch \ patches/icedtea-lucene-crash.patch \ @@ -219,7 +242,6 @@ ICEDTEA_PATCHES = \ patches/icedtea-javafiles.patch \ patches/icedtea-jvmtiEnv.patch \ patches/icedtea-lcms.patch \ - patches/icedtea-timerqueue.patch \ patches/hotspot/$(HSBUILD)/print_lsb_release.patch \ patches/icedtea-jpegclasses.patch \ patches/icedtea-uname.patch \ @@ -1340,9 +1362,9 @@ stamps/add-plugin.stamp: stamps/plugin.s stamps/add-plugin.stamp: stamps/plugin.stamp stamps/icedtea.stamp if ENABLE_PLUGIN cp -pPRf $(PLUGIN_DIR)/IcedTeaPlugin.so \ - $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR) + $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)/ cp -pPRf $(PLUGIN_DIR)/IcedTeaPlugin.so \ - $(BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR) + $(BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR)/ cp -pPRf $(abs_top_builddir)/liveconnect/lib/classes.jar \ $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/plugin.jar cp -pPRf $(abs_top_builddir)/liveconnect/lib/classes.jar \ @@ -1360,9 +1382,9 @@ stamps/add-plugin-debug.stamp: stamps/pl stamps/add-plugin-debug.stamp: stamps/plugin.stamp stamps/icedtea-debug.stamp if ENABLE_PLUGIN cp -pPRf $(PLUGIN_DIR)/IcedTeaPlugin.so \ - $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR) + $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)/ cp -pPRf $(PLUGIN_DIR)/IcedTeaPlugin.so \ - $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR) + $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR)/ cp -pPRf $(abs_top_builddir)/liveconnect/lib/classes.jar \ $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/plugin.jar cp -pPRf $(abs_top_builddir)/liveconnect/lib/classes.jar \ @@ -1387,9 +1409,9 @@ stamps/add-netx.stamp: stamps/netx-dist. cp $(NETX_RESOURCE_DIR)/about.jnlp extra-lib/about.jar \ $(BUILD_OUTPUT_DIR)/j2re-image/lib cp $(NETX_SRCDIR)/javaws.1 \ - $(BUILD_OUTPUT_DIR)/j2sdk-image/man/man1; \ + $(BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 cp $(NETX_SRCDIR)/javaws.1 \ - $(BUILD_OUTPUT_DIR)/j2re-image/man/man1; \ + $(BUILD_OUTPUT_DIR)/j2re-image/man/man1 touch stamps/add-netx.stamp clean-add-netx: @@ -1507,9 +1529,9 @@ stamps/add-pulseaudio-debug.stamp: stamp stamps/add-pulseaudio-debug.stamp: stamps/icedtea-debug.stamp $(PULSE_JAVA_TARGET) if ENABLE_PULSE_JAVA cp -pPRf $(PULSE_JAVA_NATIVE_BUILDDIR)/libpulse-java.so \ - $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR) + $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)/ cp -pPRf $(PULSE_JAVA_NATIVE_BUILDDIR)/libpulse-java.so \ - $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR) + $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR)/ cp -pPRf $(PULSE_JAVA_BUILDDIR)/pulse-java.jar \ $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/ext cp -pPRf $(PULSE_JAVA_BUILDDIR)/pulse-java.jar \ @@ -1598,9 +1620,9 @@ stamps/add-plugin-ecj.stamp: stamps/plug stamps/add-plugin-ecj.stamp: stamps/plugin.stamp stamps/icedtea-ecj.stamp if ENABLE_PLUGIN cp -pPRf $(PLUGIN_DIR)/IcedTeaPlugin.so \ - $(ECJ_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR) + $(ECJ_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)/ cp -pPRf $(PLUGIN_DIR)/IcedTeaPlugin.so \ - $(ECJ_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR) + $(ECJ_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR)/ cp -pPRf $(abs_top_builddir)/liveconnect/lib/classes.jar \ $(ECJ_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/plugin.jar cp -pPRf $(abs_top_builddir)/liveconnect/lib/classes.jar \ @@ -2086,7 +2108,7 @@ endif endif ADD_ZERO_CONFIGURE_ARGS += \ --disable-docs \ - $(filter-out '--with-gcj-home=% '--with-ecj=% \ + $(filter-out '--with-jdk-home=% '--with-ecj=% \ '--with-java=% '--with-javah=% \ '--with-rmic=% '--with-additional-vms=% \ '--with-openjdk '--with-openjdk=% , \ @@ -2098,6 +2120,7 @@ ADD_ZERO_CONFIGURE_ARGS += \ $(if $(findstring --with-hotspot-src-zip=, $(CONFIGURE_ARGS)),, \ --with-hotspot-src-zip=$(abs_top_builddir)/$(HOTSPOT_SRC_ZIP)) endif +ADD_ZERO_CONFIGURE_ARGS += --disable-plugin --disable-bootstrap ADD_ZERO_EXTRA_BUILD_ENV = \ BUILD_LANGTOOLS=false ALT_LANGTOOLS_DIST=$(BUILD_OUTPUT_DIR)/langtools/dist \ @@ -2114,6 +2137,22 @@ if ADD_ZERO_BUILD cd zerovm && \ $(ADD_ZERO_EXTRA_BUILD_ENV) \ $(ARCH_PREFIX) $(abs_top_srcdir)/configure $(ADD_ZERO_CONFIGURE_ARGS) + + : # create directories which are expected by icedtea components, + : # implicitly assumed to be created by the jdk build. + mkdir -p $(patsubst $(abs_top_builddir)/%,$(abs_top_builddir)/zerovm/%, \ + $(ECJ_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR) \ + $(ECJ_BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 \ + $(ECJ_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR) \ + $(ECJ_BUILD_OUTPUT_DIR)/j2re-image/man/man1 \ + $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR) \ + $(BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 \ + $(BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR) \ + $(BUILD_OUTPUT_DIR)/j2re-image/man/man1 \ + $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR) \ + $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/man/man1 \ + $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR) \ + $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/man/man1) $(ADD_ZERO_EXTRA_BUILD_ENV) \ $(ARCH_PREFIX) $(MAKE) -C zerovm $(ICEDTEA_BUILD_TARGET) diff -r f41b0a7fbd70 -r c66cf32a25db NEWS --- a/NEWS Mon Oct 04 18:13:02 2010 -0400 +++ b/NEWS Wed Oct 13 00:25:56 2010 +0100 @@ -10,6 +10,27 @@ CVE-XXXX-YYYY: http://www.cve.mitre.org/ New in release 1.10 (2010-XX-XX): +* Security updates + - S6914943, CVE-2009-3555: TLS: MITM attacks via session renegotiation + - S6559775, CVE-2010-3568: OpenJDK Deserialization Race condition + - S6891766, CVE-2010-3554: OpenJDK corba reflection vulnerabilities + - S6925710, CVE-2010-3562: OpenJDK IndexColorModel double-free + - S6938813, CVE-2010-3557: OpenJDK Swing mutable static + - S6957564, CVE-2010-3548: OpenJDK DNS server IP address information leak + - S6958060, CVE-2010-3564: OpenJDK kerberos vulnerability + - S6963023, CVE-2010-3565: OpenJDK JPEG writeImage remote code execution + - S6963489, CVE-2010-3566: OpenJDK ICC Profile remote code execution + - S6966692, CVE-2010-3569: OpenJDK Serialization inconsistencies + - S6622002, CVE-2010-3553: UIDefault.ProxyLazyValue has unsafe reflection usage + - S6623943: javax.swing.TimerQueue's thread occasionally fails to start + - S6925672, CVE-2010-3561: Privileged ServerSocket.accept allows receiving connections from any host + - S6952017, CVE-2010-3549: HttpURLConnection chunked encoding issue (Http request splitting) + - S6952603, CVE-2010-3551: NetworkInterface reveals local network address to untrusted code + - S6961084, CVE-2010-3541: limit setting of some request headers in HttpURLConnection + - S6963285, CVE-2010-3567: Crash in ICU Opentype layout engine due to mismatch in character counts + - S6980004, CVE-2010-3573: limit HTTP request cookie headers in HttpURLConnection + - S6981426, CVE-2010-3574: limit use of TRACE method in HttpURLConnection + - S6990437: Update with correct copyright info for source and test files from SSR10_02 fixes * Backports from OpenJDK6 - S4356282, RH525870: RFE: T2K should be used to rasterize CID/CFF fonts - S6954424: Support OpenType/CFF fonts in JDK 7 @@ -18,6 +39,7 @@ New in release 1.10 (2010-XX-XX): - S6650759: Inference of formal type parameter (unused in formal parameters) is not performed * Netx - A new man page for javaws. + - Add a new option -Xclearcache * Plugin - PR554: System.err writes content two times - PR556: Applet initialization code is prone to race conditions diff -r f41b0a7fbd70 -r c66cf32a25db netx/net/sourceforge/jnlp/Launcher.java --- a/netx/net/sourceforge/jnlp/Launcher.java Mon Oct 04 18:13:02 2010 -0400 +++ b/netx/net/sourceforge/jnlp/Launcher.java Wed Oct 13 00:25:56 2010 +0100 @@ -20,12 +20,17 @@ import java.applet.Applet; import java.applet.Applet; import java.awt.Container; import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; import java.lang.management.ManagementFactory; import java.lang.management.ThreadMXBean; import java.lang.reflect.Method; import java.net.InetAddress; import java.net.URL; import java.net.UnknownHostException; +import java.nio.channels.FileChannel; +import java.nio.channels.FileLock; import java.util.LinkedList; import java.util.List; import java.util.jar.JarFile; @@ -78,6 +83,9 @@ public class Launcher { /** If the application should call System.exit on fatal errors */ private boolean exitOnFailure = true; + /** a lock which is held to indicate that an instance of netx is running */ + private FileLock fileLock; + /** * Create a launcher with the runtime's default update policy * and launch handler. @@ -127,6 +135,7 @@ public class Launcher { this.handler = handler; this.updatePolicy = policy; + } /** @@ -385,6 +394,11 @@ public class Launcher { if (!file.isApplication()) throw launchError(new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LNotApplication"), R("LNotApplicationInfo"))); + markNetxRunning(); + Runtime.getRuntime().addShutdownHook(new Thread() { + public void run() { markNetxStopped(); } + }); + try { try { @@ -686,6 +700,69 @@ public class Launcher { return null; // chose to continue, or no handler } + /** + * Indicate that netx is running by creating the {@link JNLPRuntime#INSTANCE_FILE} and + * acquiring a shared lock on it + */ + private void markNetxRunning() { + try { + String message = "This file is used to check if netx is running"; + + File netxRunningFile = new File(JNLPRuntime.NETX_RUNNING_FILE); + netxRunningFile.getParentFile().mkdirs(); + if (netxRunningFile.createNewFile()) { + FileOutputStream fos = new FileOutputStream(netxRunningFile); + try { + fos.write(message.getBytes()); + } finally { + fos.close(); + } + } + + if (!netxRunningFile.isFile()) { + if (JNLPRuntime.isDebug()) { + System.err.println("Unable to create instance file"); + } + fileLock = null; + return; + } + + FileInputStream is = new FileInputStream(netxRunningFile); + FileChannel channel = is.getChannel(); + fileLock = channel.tryLock(0, Long.MAX_VALUE, true); + if (fileLock != null && fileLock.isShared()) { + if (JNLPRuntime.isDebug()) { + System.out.println("Acquired shared lock on " + + JNLPRuntime.NETX_RUNNING_FILE + " to indicate javaws is running"); + } + } else { + fileLock = null; + } + } catch (IOException e) { + e.printStackTrace(); + } + + } + + /** + * Indicate that netx is stopped by releasing the shared lock on + * {@link JNLPRuntime#INSTANCE_FILE}. + */ + private void markNetxStopped() { + if (fileLock == null) { + return; + } + try { + fileLock.release(); + fileLock.channel().close(); + fileLock = null; + if (JNLPRuntime.isDebug()) { + System.out.println("Release shared lock on " + JNLPRuntime.NETX_RUNNING_FILE); + } + } catch (IOException e) { + e.printStackTrace(); + } + } /** diff -r f41b0a7fbd70 -r c66cf32a25db netx/net/sourceforge/jnlp/cache/CacheUtil.java --- a/netx/net/sourceforge/jnlp/cache/CacheUtil.java Mon Oct 04 18:13:02 2010 -0400 +++ b/netx/net/sourceforge/jnlp/cache/CacheUtil.java Wed Oct 13 00:25:56 2010 +0100 @@ -19,6 +19,7 @@ package net.sourceforge.jnlp.cache; import java.io.*; import java.net.*; +import java.nio.channels.FileChannel; import java.util.*; import java.lang.reflect.*; import java.security.*; @@ -36,6 +37,10 @@ import net.sourceforge.jnlp.util.FileUti * @version $Revision: 1.17 $ */ public class CacheUtil { + + private static String R(String key) { + return JNLPRuntime.getMessage(key); + } private static String R(String key, Object param) { return JNLPRuntime.getMessage(key, new Object[] {param}); @@ -126,6 +131,72 @@ public class CacheUtil { } return null; + } + + /** + * Clears the cache by deleting all the Netx cache files + * + * Note: Because of how our caching system works, deleting jars of another javaws + * process is using them can be quite disasterous. Hence why Launcher creates lock files + * and we check for those by calling {@link #okToClearCache()} + */ + public static void clearCache() { + + if (!okToClearCache()) { + System.err.println(R("CCannotClearCache")); + return; + } + + File cacheDir = new File(JNLPRuntime.getBaseDir() + File.separator + "cache"); + if (!(cacheDir.isDirectory())) { + return; + } + + if (JNLPRuntime.isDebug()) { + System.err.println("Clearing cache directory: " + cacheDir); + } + try { + FileUtils.recursiveDelete(cacheDir, JNLPRuntime.getBaseDir()); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + /** + * Returns a boolean indicating if it ok to clear the netx application cache at this point + * @return true if the cache can be cleared at this time without problems + */ + private static boolean okToClearCache() { + File otherJavawsRunning = new File(JNLPRuntime.NETX_RUNNING_FILE); + try { + if (otherJavawsRunning.isFile()) { + FileOutputStream fis = new FileOutputStream(otherJavawsRunning); + try { + FileChannel channel = fis.getChannel(); + if (channel.tryLock() == null) { + if (JNLPRuntime.isDebug()) { + System.out.println("Other instances of netx are running"); + } + return false; + } + + if (JNLPRuntime.isDebug()) { + System.out.println("No other instances of netx are running"); + } + return true; + + } finally { + fis.close(); + } + } else { + if (JNLPRuntime.isDebug()) { + System.out.println("No instance file found"); + } + return true; + } + } catch (IOException e) { + return false; + } } /** diff -r f41b0a7fbd70 -r c66cf32a25db netx/net/sourceforge/jnlp/resources/Messages.properties --- a/netx/net/sourceforge/jnlp/resources/Messages.properties Mon Oct 04 18:13:02 2010 -0400 +++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Wed Oct 13 00:25:56 2010 +0100 @@ -139,6 +139,7 @@ BOViewer = Shows the trusted certific BOViewer = Shows the trusted certificate viewer. BOUmask = Sets the umask for files created by an application. BXnofork = Do not create another JVM. +BXclearcache= Clean the JNLP application cache. BOHelp = Print this message and exit. # Cache @@ -149,6 +150,7 @@ CChooseCache=Choose a cache directory... CChooseCache=Choose a cache directory... CChooseCacheInfo=Netx needs a location for storing cache files. CChooseCacheDir=Cache directory +CCannotClearCache=Can not clear cache at this time # Security SFileReadAccess=The application has requested read access to {0}. Do you want to allow this action? diff -r f41b0a7fbd70 -r c66cf32a25db netx/net/sourceforge/jnlp/runtime/Boot.java --- a/netx/net/sourceforge/jnlp/runtime/Boot.java Mon Oct 04 18:13:02 2010 -0400 +++ b/netx/net/sourceforge/jnlp/runtime/Boot.java Wed Oct 13 00:25:56 2010 +0100 @@ -40,6 +40,7 @@ import net.sourceforge.jnlp.ParseExcepti import net.sourceforge.jnlp.ParseException; import net.sourceforge.jnlp.PropertyDesc; import net.sourceforge.jnlp.ResourcesDesc; +import net.sourceforge.jnlp.cache.CacheUtil; import net.sourceforge.jnlp.cache.UpdatePolicy; import net.sourceforge.jnlp.security.VariableX509TrustManager; From andrew at icedtea.classpath.org Tue Oct 12 17:27:42 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Wed, 13 Oct 2010 00:27:42 +0000 Subject: /hg/release/icedtea6-1.7: Recategorise TimerQueue fix. Message-ID: changeset 11ee55e1c9b4 in /hg/release/icedtea6-1.7 details: http://icedtea.classpath.org/hg/release/icedtea6-1.7?cmd=changeset;node=11ee55e1c9b4 author: Andrew John Hughes date: Wed Oct 13 01:27:29 2010 +0100 Recategorise TimerQueue fix. 2010-10-13 Andrew John Hughes * NEWS: Recategorise TimerQueue fix (Oracle's mistake). diffstat: 2 files changed, 6 insertions(+), 1 deletion(-) ChangeLog | 5 +++++ NEWS | 2 +- diffs (31 lines): diff -r 3b1a69fc737b -r 11ee55e1c9b4 ChangeLog --- a/ChangeLog Wed Oct 13 00:18:49 2010 +0100 +++ b/ChangeLog Wed Oct 13 01:27:29 2010 +0100 @@ -1,3 +1,8 @@ 2010-10-12 Andrew John Hughes + + * NEWS: + Recategorise TimerQueue fix (Oracle's mistake). + 2010-10-12 Andrew John Hughes * Makefile.am: diff -r 3b1a69fc737b -r 11ee55e1c9b4 NEWS --- a/NEWS Wed Oct 13 00:18:49 2010 +0100 +++ b/NEWS Wed Oct 13 01:27:29 2010 +0100 @@ -22,7 +22,6 @@ New in release 1.7.5 (2010-10-13): - S6963489, CVE-2010-3566: OpenJDK ICC Profile remote code execution - S6966692, CVE-2010-3569: OpenJDK Serialization inconsistencies - S6622002, CVE-2010-3553: UIDefault.ProxyLazyValue has unsafe reflection usage - - S6623943: javax.swing.TimerQueue's thread occasionally fails to start - S6925672, CVE-2010-3561: Privileged ServerSocket.accept allows receiving connections from any host - S6952017, CVE-2010-3549: HttpURLConnection chunked encoding issue (Http request splitting) - S6952603, CVE-2010-3551: NetworkInterface reveals local network address to untrusted code @@ -41,6 +40,7 @@ New in release 1.7.5 (2010-10-13): - S6951319: enable solaris builds using Sun Studio 12 update 1 (fixes PR398). - S6638712: Inference with wildcard types causes selection of inapplicable method - S6650759: Inference of formal type parameter (unused in formal parameters) is not performed + - S6623943: javax.swing.TimerQueue's thread occasionally fails to start * NetX - Fix browser command in BasicService.showDocument(URL) - Run programs that inherit main(String[]) in their main-class From andrew at icedtea.classpath.org Tue Oct 12 17:28:52 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Wed, 13 Oct 2010 00:28:52 +0000 Subject: /hg/release/icedtea6-1.8: Recategorise TimerQueue fix. Message-ID: changeset 5022d1680b70 in /hg/release/icedtea6-1.8 details: http://icedtea.classpath.org/hg/release/icedtea6-1.8?cmd=changeset;node=5022d1680b70 author: Andrew John Hughes date: Wed Oct 13 01:28:37 2010 +0100 Recategorise TimerQueue fix. 2010-10-13 Andrew John Hughes * NEWS: Recategorise TimerQueue fix (Oracle's mistake). Fix formatting. diffstat: 2 files changed, 8 insertions(+), 2 deletions(-) ChangeLog | 6 ++++++ NEWS | 4 ++-- diffs (41 lines): diff -r a0fc1afc5d95 -r 5022d1680b70 ChangeLog --- a/ChangeLog Wed Oct 13 00:23:00 2010 +0100 +++ b/ChangeLog Wed Oct 13 01:28:37 2010 +0100 @@ -1,3 +1,9 @@ 2010-10-12 Andrew John Hughes + + * NEWS: + Recategorise TimerQueue fix (Oracle's mistake). + Fix formatting. + 2010-10-12 Andrew John Hughes * Makefile.am: diff -r a0fc1afc5d95 -r 5022d1680b70 NEWS --- a/NEWS Wed Oct 13 00:23:00 2010 +0100 +++ b/NEWS Wed Oct 13 01:28:37 2010 +0100 @@ -22,7 +22,6 @@ New in release 1.8.2 (2010-10-13): - S6963489, CVE-2010-3566: OpenJDK ICC Profile remote code execution - S6966692, CVE-2010-3569: OpenJDK Serialization inconsistencies - S6622002, CVE-2010-3553: UIDefault.ProxyLazyValue has unsafe reflection usage - - S6623943: javax.swing.TimerQueue's thread occasionally fails to start - S6925672, CVE-2010-3561: Privileged ServerSocket.accept allows receiving connections from any host - S6952017, CVE-2010-3549: HttpURLConnection chunked encoding issue (Http request splitting) - S6952603, CVE-2010-3551: NetworkInterface reveals local network address to untrusted code @@ -41,6 +40,7 @@ New in release 1.8.2 (2010-10-13): - S6539464, RH500077: Ensure java.lang.Math functions provide consistent results. - S6638712: Inference with wildcard types causes selection of inapplicable method - S6650759: Inference of formal type parameter (unused in formal parameters) is not performed + - S6623943: javax.swing.TimerQueue's thread occasionally fails to start * NetX: - Fix browser command in BasicService.showDocument(URL) - Run programs that inherit main(String[]) in their main-class @@ -48,7 +48,7 @@ New in release 1.8.2 (2010-10-13): - RH601281: Possible NullPointerException in splash screen code - New man page for javaws * Plugin - - RH560193: Fix ziperror when applet jar contained another 0-byte jar + - RH560193: Fix zip error when applet jar contained another 0-byte jar - PR519: 100% CPU usage when displaying applets in Webkit based browsers New in release 1.8.1 (2010-07-28): From andrew at icedtea.classpath.org Tue Oct 12 17:30:05 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Wed, 13 Oct 2010 00:30:05 +0000 Subject: /hg/release/icedtea6-1.9: Recategorise TimerQueue fix. Message-ID: changeset f087888f1785 in /hg/release/icedtea6-1.9 details: http://icedtea.classpath.org/hg/release/icedtea6-1.9?cmd=changeset;node=f087888f1785 author: Andrew John Hughes date: Wed Oct 13 01:29:59 2010 +0100 Recategorise TimerQueue fix. 2010-10-13 Andrew John Hughes * NEWS: Recategorise TimerQueue fix (Oracle's mistake). diffstat: 2 files changed, 6 insertions(+), 1 deletion(-) ChangeLog | 5 +++++ NEWS | 2 +- diffs (31 lines): diff -r dd9c36d63a95 -r f087888f1785 ChangeLog --- a/ChangeLog Wed Oct 13 00:23:28 2010 +0100 +++ b/ChangeLog Wed Oct 13 01:29:59 2010 +0100 @@ -1,3 +1,8 @@ 2010-10-12 Andrew John Hughes + + * NEWS: + Recategorise TimerQueue fix (Oracle's mistake). + 2010-10-12 Andrew John Hughes * Makefile.am: diff -r dd9c36d63a95 -r f087888f1785 NEWS --- a/NEWS Wed Oct 13 00:23:28 2010 +0100 +++ b/NEWS Wed Oct 13 01:29:59 2010 +0100 @@ -23,7 +23,6 @@ New in release 1.9.1 (2010-10-13): - S6963489, CVE-2010-3566: OpenJDK ICC Profile remote code execution - S6966692, CVE-2010-3569: OpenJDK Serialization inconsistencies - S6622002, CVE-2010-3553: UIDefault.ProxyLazyValue has unsafe reflection usage - - S6623943: javax.swing.TimerQueue's thread occasionally fails to start - S6925672, CVE-2010-3561: Privileged ServerSocket.accept allows receiving connections from any host - S6952017, CVE-2010-3549: HttpURLConnection chunked encoding issue (Http request splitting) - S6952603, CVE-2010-3551: NetworkInterface reveals local network address to untrusted code @@ -35,6 +34,7 @@ New in release 1.9.1 (2010-10-13): * Backports - S6638712: Inference with wildcard types causes selection of inapplicable method - S6650759: Inference of formal type parameter (unused in formal parameters) is not performed + - S6623943: javax.swing.TimerQueue's thread occasionally fails to start * Fixes - Fix build failure on S390 - RH633510: OpenJDK should use NUMA even if glibc doesn't provide it From andrew at icedtea.classpath.org Tue Oct 12 17:32:03 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Wed, 13 Oct 2010 00:32:03 +0000 Subject: /hg/icedtea6: Add 1.7.5, 1.8.2 and 1.9.1 releases. Message-ID: changeset 01c094e27afd in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=01c094e27afd author: andrew date: Wed Oct 13 01:31:53 2010 +0100 Add 1.7.5, 1.8.2 and 1.9.1 releases. 2010-10-13 Andrew John Hughes * NEWS: Add 1.7.5, 1.8.2 and 1.9.1 releases. diffstat: 2 files changed, 126 insertions(+) ChangeLog | 5 ++ NEWS | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diffs (143 lines): diff -r c66cf32a25db -r 01c094e27afd ChangeLog --- a/ChangeLog Wed Oct 13 00:25:56 2010 +0100 +++ b/ChangeLog Wed Oct 13 01:31:53 2010 +0100 @@ -1,3 +1,8 @@ 2010-10-12 Matthias Klose + + * NEWS: + Add 1.7.5, 1.8.2 and 1.9.1 releases. + 2010-10-12 Matthias Klose * Makefile.am (stamps/add-plugin.stamp, stamps/add-plugin-debug.stamp, diff -r c66cf32a25db -r 01c094e27afd NEWS --- a/NEWS Wed Oct 13 00:25:56 2010 +0100 +++ b/NEWS Wed Oct 13 01:31:53 2010 +0100 @@ -44,6 +44,127 @@ New in release 1.10 (2010-XX-XX): - PR554: System.err writes content two times - PR556: Applet initialization code is prone to race conditions - PR557: Applet opens in a separate window if tab is closed when the applet loads + - PR519: 100% CPU usage when displaying applets in Webkit based browsers + +New in release 1.9.1 (2010-10-13): + +* HotSpot 19 supported; use --with-hotspot-build=hs19 to enable. +* Security updates + - S6914943, CVE-2009-3555: TLS: MITM attacks via session renegotiation + - S6559775, CVE-2010-3568: OpenJDK Deserialization Race condition + - S6891766, CVE-2010-3554: OpenJDK corba reflection vulnerabilities + - S6925710, CVE-2010-3562: OpenJDK IndexColorModel double-free + - S6938813, CVE-2010-3557: OpenJDK Swing mutable static + - S6957564, CVE-2010-3548: OpenJDK DNS server IP address information leak + - S6958060, CVE-2010-3564: OpenJDK kerberos vulnerability + - S6963023, CVE-2010-3565: OpenJDK JPEG writeImage remote code execution + - S6963489, CVE-2010-3566: OpenJDK ICC Profile remote code execution + - S6966692, CVE-2010-3569: OpenJDK Serialization inconsistencies + - S6622002, CVE-2010-3553: UIDefault.ProxyLazyValue has unsafe reflection usage + - S6925672, CVE-2010-3561: Privileged ServerSocket.accept allows receiving connections from any host + - S6952017, CVE-2010-3549: HttpURLConnection chunked encoding issue (Http request splitting) + - S6952603, CVE-2010-3551: NetworkInterface reveals local network address to untrusted code + - S6961084, CVE-2010-3541: limit setting of some request headers in HttpURLConnection + - S6963285, CVE-2010-3567: Crash in ICU Opentype layout engine due to mismatch in character counts + - S6980004, CVE-2010-3573: limit HTTP request cookie headers in HttpURLConnection + - S6981426, CVE-2010-3574: limit use of TRACE method in HttpURLConnection + - S6990437: Update with correct copyright info for source and test files from SSR10_02 fixes +* Backports + - S6638712: Inference with wildcard types causes selection of inapplicable method + - S6650759: Inference of formal type parameter (unused in formal parameters) is not performed + - S6623943: javax.swing.TimerQueue's thread occasionally fails to start +* Fixes + - Fix build failure on S390 + - RH633510: OpenJDK should use NUMA even if glibc doesn't provide it +* NetX + - New man page for javaws +* Plugin + - PR519: 100% CPU usage when displaying applets in Webkit based browsers + +New in release 1.8.2 (2010-10-13): + +* Security updates + - S6914943, CVE-2009-3555: TLS: MITM attacks via session renegotiation + - S6559775, CVE-2010-3568: OpenJDK Deserialization Race condition + - S6891766, CVE-2010-3554: OpenJDK corba reflection vulnerabilities + - S6925710, CVE-2010-3562: OpenJDK IndexColorModel double-free + - S6938813, CVE-2010-3557: OpenJDK Swing mutable static + - S6957564, CVE-2010-3548: OpenJDK DNS server IP address information leak + - S6958060, CVE-2010-3564: OpenJDK kerberos vulnerability + - S6963023, CVE-2010-3565: OpenJDK JPEG writeImage remote code execution + - S6963489, CVE-2010-3566: OpenJDK ICC Profile remote code execution + - S6966692, CVE-2010-3569: OpenJDK Serialization inconsistencies + - S6622002, CVE-2010-3553: UIDefault.ProxyLazyValue has unsafe reflection usage + - S6925672, CVE-2010-3561: Privileged ServerSocket.accept allows receiving connections from any host + - S6952017, CVE-2010-3549: HttpURLConnection chunked encoding issue (Http request splitting) + - S6952603, CVE-2010-3551: NetworkInterface reveals local network address to untrusted code + - S6961084, CVE-2010-3541: limit setting of some request headers in HttpURLConnection + - S6963285, CVE-2010-3567: Crash in ICU Opentype layout engine due to mismatch in character counts + - S6980004, CVE-2010-3573: limit HTTP request cookie headers in HttpURLConnection + - S6981426, CVE-2010-3574: limit use of TRACE method in HttpURLConnection + - S6990437: Update with correct copyright info for source and test files from SSR10_02 fixes +* Fixes: + - G244901: Skip test_gamma on hardened (PaX-enabled) kernels + - G266295: Provide font configuration for Gentoo. + - Provide font configuration for RHEL 6. + - RH633510: OpenJDK should use NUMA even if glibc doesn't provide it +* Backports: + - S6951319: enable solaris builds using Sun Studio 12 update 1 (fixes PR398) + - S6539464, RH500077: Ensure java.lang.Math functions provide consistent results. + - S6638712: Inference with wildcard types causes selection of inapplicable method + - S6650759: Inference of formal type parameter (unused in formal parameters) is not performed + - S6623943: javax.swing.TimerQueue's thread occasionally fails to start +* NetX: + - Fix browser command in BasicService.showDocument(URL) + - Run programs that inherit main(String[]) in their main-class + - Run JNLP files that use 1.6 as the spec version + - RH601281: Possible NullPointerException in splash screen code + - New man page for javaws +* Plugin + - RH560193: Fix zip error when applet jar contained another 0-byte jar + - PR519: 100% CPU usage when displaying applets in Webkit based browsers + +New in release 1.7.5 (2010-10-13): + +* Security updates + - S6914943, CVE-2009-3555: TLS: MITM attacks via session renegotiation + - S6559775, CVE-2010-3568: OpenJDK Deserialization Race condition + - S6891766, CVE-2010-3554: OpenJDK corba reflection vulnerabilities + - S6925710, CVE-2010-3562: OpenJDK IndexColorModel double-free + - S6938813, CVE-2010-3557: OpenJDK Swing mutable static + - S6957564, CVE-2010-3548: OpenJDK DNS server IP address information leak + - S6958060, CVE-2010-3564: OpenJDK kerberos vulnerability + - S6963023, CVE-2010-3565: OpenJDK JPEG writeImage remote code execution + - S6963489, CVE-2010-3566: OpenJDK ICC Profile remote code execution + - S6966692, CVE-2010-3569: OpenJDK Serialization inconsistencies + - S6622002, CVE-2010-3553: UIDefault.ProxyLazyValue has unsafe reflection usage + - S6925672, CVE-2010-3561: Privileged ServerSocket.accept allows receiving connections from any host + - S6952017, CVE-2010-3549: HttpURLConnection chunked encoding issue (Http request splitting) + - S6952603, CVE-2010-3551: NetworkInterface reveals local network address to untrusted code + - S6961084, CVE-2010-3541: limit setting of some request headers in HttpURLConnection + - S6963285, CVE-2010-3567: Crash in ICU Opentype layout engine due to mismatch in character counts + - S6980004, CVE-2010-3573: limit HTTP request cookie headers in HttpURLConnection + - S6981426, CVE-2010-3574: limit use of TRACE method in HttpURLConnection + - S6990437: Update with correct copyright info for source and test files from SSR10_02 fixes +* Fixes + - G244901: Skip test_gamma on hardened (PaX-enabled) kernels + - G266295: Provide font configuration for Gentoo. + - Provide font configuration for RHEL 6. + - RH633510: OpenJDK should use NUMA even if glibc doesn't provide it +* Backports + - S6539464, RH500077: Ensure java.lang.Math functions provide consistent results. + - S6951319: enable solaris builds using Sun Studio 12 update 1 (fixes PR398). + - S6638712: Inference with wildcard types causes selection of inapplicable method + - S6650759: Inference of formal type parameter (unused in formal parameters) is not performed + - S6623943: javax.swing.TimerQueue's thread occasionally fails to start +* NetX + - Fix browser command in BasicService.showDocument(URL) + - Run programs that inherit main(String[]) in their main-class + - Work with JNLP files that use spec version 1.6 + - RH601281: Possible NullPointerException in splash screen code + - New man page for javaws +* Plugin + - RH560193: Fix ziperror when applet jar contained another 0-byte jar - PR519: 100% CPU usage when displaying applets in Webkit based browsers New in release 1.9 (2010-09-07): From bugzilla-daemon at icedtea.classpath.org Wed Oct 13 01:56:15 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 13 Oct 2010 08:56:15 +0000 Subject: [Bug 569] New: JVM6 crashes on native library libzip.so @ ZIP_GetNextEntry+0x58 Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=569 Summary: JVM6 crashes on native library libzip.so @ ZIP_GetNextEntry+0x58 Product: IcedTea Version: 6-1.8.1 Platform: x86 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: IcedTea6 AssignedTo: unassigned at icedtea.classpath.org ReportedBy: ankostis at gmail.com JVM6 crashed on native library libzip.so @ ZIP_GetNextEntry+0x58 cause by the eclipse's indexer thread. I wil attach the jvm crash-dump file and `emerge --info`. I don't know whether this is the correct place to report it. $ uname -a Linux hostname 2.6.34-gentoo-r6 #1 SMP Fri Oct 1 10:49:48 EEST 2010 i686 Intel(R) Core(TM)2 Duo CPU E4400 @ 2.00GHz GenuineIntel GNU/Linux $ eix icedtea dev-java/icedtea6-bin Installed versions: 1.8.1!s(11:39:33 ?? 12/10/2010)(X alsa nsplugin -doc -examples -source) -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Wed Oct 13 01:58:00 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 13 Oct 2010 08:58:00 +0000 Subject: [Bug 569] JVM6 crashes on native library libzip.so @ ZIP_GetNextEntry+0x58 Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=569 ------- Comment #1 from ankostis at gmail.com 2010-10-13 08:58 ------- Created an attachment (id=428) --> (http://icedtea.classpath.org/bugzilla/attachment.cgi?id=428&action=view) JVM crash-dump file for on libzip.so crash getNextEntry() -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Wed Oct 13 01:58:39 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 13 Oct 2010 08:58:39 +0000 Subject: [Bug 569] JVM6 crashes on native library libzip.so @ ZIP_GetNextEntry+0x58 Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=569 ------- Comment #2 from ankostis at gmail.com 2010-10-13 08:58 ------- Created an attachment (id=429) --> (http://icedtea.classpath.org/bugzilla/attachment.cgi?id=429&action=view) emerge --info file for jvm-crash on libzip.so @ getNextEntry() -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Wed Oct 13 02:02:30 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 13 Oct 2010 09:02:30 +0000 Subject: [Bug 569] JVM6 crashes on native library libzip.so @ ZIP_GetNextEntry+0x58 Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=569 ------- Comment #3 from ankostis at gmail.com 2010-10-13 09:02 ------- The exact same bug occurs frequently with Sun's jdk (all versions) and i tried icedtea6 in an attempt to escape from it. If it is not obvious from report files i note that i have installed the gentoo's precompiled (binary) icedtea6, not the compilable from-sources variant. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Wed Oct 13 02:07:57 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 13 Oct 2010 09:07:57 +0000 Subject: [Bug 569] JVM6 crashes on native library libzip.so @ ZIP_GetNextEntry+0x58 Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=569 ankostis at gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |DUPLICATE ------- Comment #4 from ankostis at gmail.com 2010-10-13 09:07 ------- A similar bug has already been filed, bug 363. The proposed solution, "not to overwrite jars" is not a viable options, since the OSGI eclipse runtime is a big enough stack to apply such remedy. I would suggests to add an extra locking somewhere... *** This bug has been marked as a duplicate of bug 363 *** -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Wed Oct 13 02:07:57 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 13 Oct 2010 09:07:57 +0000 Subject: [Bug 363] SIGBUS error at [libzip.so+0x40d1] Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=363 ankostis at gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ankostis at gmail.com ------- Comment #5 from ankostis at gmail.com 2010-10-13 09:07 ------- *** Bug 569 has been marked as a duplicate of this bug. *** -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Wed Oct 13 02:13:45 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 13 Oct 2010 09:13:45 +0000 Subject: [Bug 363] SIGBUS error at [libzip.so+0x40d1] Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=363 ------- Comment #6 from ankostis at gmail.com 2010-10-13 09:13 ------- This serious inhereted by upstream crash-bug has been lurkng for too many years. At least, its Severity should be elevated. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Wed Oct 13 02:25:07 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 13 Oct 2010 09:25:07 +0000 Subject: [Bug 363] SIGBUS error at [libzip.so+0x40d1] Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=363 ------- Comment #7 from aph at redhat.com 2010-10-13 09:25 ------- I'm not sure this even is a bug: the zip file is being overwritten while the zip library is trying to use it. I suppose we could copy every zipfile when opened for reading, but I would have thought it makes more sense to say "don't do that". As Martin Bucholz says, it's pretty easy to avoid this problem by renaming the old copy. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Wed Oct 13 02:45:24 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 13 Oct 2010 09:45:24 +0000 Subject: [Bug 363] SIGBUS error at [libzip.so+0x40d1] Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=363 ------- Comment #8 from ankostis at gmail.com 2010-10-13 09:45 ------- Are we sure that this crash happend only when *overwritting* jars? The bug 6390352 suggests that when ?...multiple instances of ZipFile are simultaneously open on the same underlying file...? a similar jvm crash happens. And indeed this seems the case for my submitted bug 569, given the fact that it always occurs from within eclipse's index-thread, which i assume to be read-only. Hence, if this bug referes solely to "overwritten" jars, maybe a separate bug should opene for the "concurrent access" case. Thank you in advance, Kostis -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Wed Oct 13 02:54:33 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 13 Oct 2010 09:54:33 +0000 Subject: [Bug 363] SIGBUS error at [libzip.so+0x40d1] Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=363 ------- Comment #9 from aph at redhat.com 2010-10-13 09:54 ------- If this bug can be reproduced without attempting to overwrite a jarfile, then it should be fixed. However, I'm pretty sure it won't happen until someone provides a test case that reproduces the problem. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From omajid at redhat.com Wed Oct 13 08:32:33 2010 From: omajid at redhat.com (Omair Majid) Date: Wed, 13 Oct 2010 11:32:33 -0400 Subject: [RFC] PR568: LWJGL Applets fail to work with IcedTea Plugin Message-ID: <4CB5D111.5060607@redhat.com> Hi, The attached patch attempts to fix PR568. The LWJGL applet downloads a jar to /tmp/ and then calls getPermissions() using that jar as the CodeSource. Currently, since there is no SecurityDesc for this new location, an exception is thrown. A comment from the source code of LWJGL is: // getPermissions from original classloader is important as it checks // for signed jars and shows any security dialogs needed The attached patch modifies JNLPClassLoader.getPermissions() to treat the new jar the same way it would be treated if it was loaded by initializeResources(). Currently, it checks that the jar is on the local machine and the plugin is being used. The check for a local jar means that any jar on the local machine can now be accessed by an applet (can untrusted applets do this? - they do not have any file permissions). Even though a security dialog will tell the user if the jar is unsigned (or any of the cases that can happen in initializeResources), I am not sure if this is the best solution. I would also like to extend this to all JNLPs in general, but two things are keeping me 1. I have not seen any JNLP applications using this. 2. I cant see a way to figure out what SecurityDesc should be used (since there is no JNLP file to describe the security permissions that should be granted). Any thoughts or comments? Thanks, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea6-jnlp-classloader-load-new-codesources-01.patch Type: text/x-patch Size: 12756 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101013/cb041cf0/icedtea6-jnlp-classloader-load-new-codesources-01.patch From doko at icedtea.classpath.org Thu Oct 14 04:28:54 2010 From: doko at icedtea.classpath.org (doko at icedtea.classpath.org) Date: Thu, 14 Oct 2010 11:28:54 +0000 Subject: /hg/icedtea6: New configure option --with-llvm-config Message-ID: changeset be9262040bbc in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=be9262040bbc author: doko at ubuntu.com date: Thu Oct 14 13:25:44 2010 +0200 New configure option --with-llvm-config 2010-10-14 Matthias Klose * configure.ac: New option --with-llvm-config. * INSTALL: Document it. diffstat: 3 files changed, 22 insertions(+), 1 deletion(-) ChangeLog | 5 +++++ INSTALL | 1 + configure.ac | 17 ++++++++++++++++- diffs (51 lines): diff -r 01c094e27afd -r be9262040bbc ChangeLog --- a/ChangeLog Wed Oct 13 01:31:53 2010 +0100 +++ b/ChangeLog Thu Oct 14 13:25:44 2010 +0200 @@ -1,3 +1,8 @@ 2010-10-13 Andrew John Hughes + + * configure.ac: New option --with-llvm-config. + * INSTALL: Document it. + 2010-10-13 Andrew John Hughes * NEWS: diff -r 01c094e27afd -r be9262040bbc INSTALL --- a/INSTALL Wed Oct 13 01:31:53 2010 +0100 +++ b/INSTALL Thu Oct 14 13:25:44 2010 +0200 @@ -151,6 +151,7 @@ to configure: * --with-tzdata-dir: Specify the location of Java timezone data, defaulting to /usr/share/javazi. * --with-netbeans: Specify the location of NetBeans for VisualVM, defaulting to the netbeans on the path. * --with-abs-install-dir: The final install location of the j2sdk-image, for use in the SystemTap tapset. +* --with-llvm-config: Specify the location of the llvm-config binary. Other options may be supplied which enable or disable new features. These are documented fully in the relevant section below. diff -r 01c094e27afd -r be9262040bbc configure.ac --- a/configure.ac Wed Oct 13 01:31:53 2010 +0100 +++ b/configure.ac Thu Oct 14 13:25:44 2010 +0200 @@ -395,8 +395,23 @@ AC_SUBST(LIBFFI_CFLAGS) AC_SUBST(LIBFFI_CFLAGS) AC_SUBST(LIBFFI_LIBS) +AC_ARG_WITH([llvm-config], + [AS_HELP_STRING([--with-llvm-config], + [llvm-config binary (default is llvm-config)])], + [ + if test "x${withval}" != x; then + if which ${withval} >/dev/null 2>&1 && ${withval} --version >/dev/null 2>&1; then + LLVM_CONFIG=${withval} + else + AC_MSG_ERROR([invalid argument for --with-llvm-config ($withval)]) + fi + fi + ]) + if test "x${SHARK_BUILD_TRUE}" = x || test "x${ADD_SHARK_BUILD_TRUE}" = x; then - FIND_TOOL([LLVM_CONFIG], [llvm-config]) + if test "x${LLVM_CONFIG}" = x; then + FIND_TOOL([LLVM_CONFIG], [llvm-config]) + fi llvm_components="jit engine nativecodegen" LLVM_VERSION="`$LLVM_CONFIG --version`" dnl LLVM_CFLAGS From tomas.hurka at googlemail.com Thu Oct 14 06:03:29 2010 From: tomas.hurka at googlemail.com (Tomas Hurka) Date: Thu, 14 Oct 2010 15:03:29 +0200 Subject: VisualVM 1.3.1 patch Message-ID: <2594AA86-9315-4866-AD2F-AB2FB891B1D5@googlemail.com> Hi All, attached is a patch to update VisualVM to the latest (1.3.1) version. The patch is done against new VisualVM mercurial repository (http://icedtea.classpath.org/hg/visualvm). Can somebody review and commit these changes for me? Note that VisualVM 1.3.1 uses NetBeans Platform 6.9.1. Thanks, -- Tomas Hurka NetBeans Profiler http://profiler.netbeans.org VisualVM http://visualvm.dev.java.net Software Developer Oracle, Praha Czech Republic -------------- next part -------------- A non-text attachment was scrubbed... Name: visualvm_131.diff Type: application/octet-stream Size: 3157 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101014/6e5a25e8/visualvm_131.diff -------------- next part -------------- From omajid at redhat.com Thu Oct 14 07:09:54 2010 From: omajid at redhat.com (Omair Majid) Date: Thu, 14 Oct 2010 10:09:54 -0400 Subject: [rfc] netx: split code to show warnings from the SecurityWarningDialog class Message-ID: <4CB70F32.30503@redhat.com> Hi, The current implementation of SecurityWarningDialog class mixes a few responsibilities - it is responsible for creating SecurityWarningDialogs as well as getting the user response to these security prompts. The attached patch splits up the class into two classes: SecurityWarningDialog and SecurityWarning. The SecurityWarningDialog is still responsible for creating the actual security dialog, but the new SecurityWarning class is responsible for showing and getting the user response to these security prompts. This split will much more important in the near future - I am working on a patch that will cause security dialogs to be shown by a different thread then the thread calling (say) the showAccessWarning() method. Any thoughts or comments? Cheers, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea6-jnlp-split-dialog-showing-01.patch Type: text/x-patch Size: 34307 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101014/3452aa01/icedtea6-jnlp-split-dialog-showing-01.patch From omajid at redhat.com Thu Oct 14 11:10:18 2010 From: omajid at redhat.com (Omair Majid) Date: Thu, 14 Oct 2010 14:10:18 -0400 Subject: [RFC] plugin: use an AppContext to support applets running with different look and feels In-Reply-To: <4CAE3CAA.3050704@redhat.com> References: <4CAE3CAA.3050704@redhat.com> Message-ID: <4CB7478A.8010407@redhat.com> On 10/07/2010 05:33 PM, Omair Majid wrote: > Hi, > > The attached patch is an (updated) attempt to fix PR565 [1]. The patch > does two things: > > 1. It creates a ThreadGroup for the applet earlier in the initialization > phase. > > The applet's intialization code (currently) creates 3 threads (most of > this code is in NetxPanel, AppletPanel and Launcher). The first thread > is what calls applet.init(), applet.start() etc. It creates the second > thread to load the applet (so loading can be interrupted). This second > thread is what calls Launcher.launch() which ends up creating the third > thread to actually load the applet. This third thread is created in a > new ThreadGroup and has the JNLPClassLoader set as the > ContextClassLoader. The patch makes sure that all three threads are > created in the same ThreadGroup and the appropriate context class loader > is set for all of them. This part of the patch is attached to the bug > report. With this patch, all the threads of an applet can load the > classes for the custom look and feel. > > 2. Allows different applets to use different look and feels. > > The patch creates a new AppContext for each applet ThreadGroup. This > means that each applet instance can set its own look and feel and not > affect any other applet (which might lead to visual inconsistency as > well as errors in loading custom look and feels). The AppContext class > (part of sun.awt package) contains a map from ThreadGroup to AppContext > that Swing and AWT can use to make sure they have the AppContext, which > they can then use to index ThreadGroup-specific things like EventQueues > and LookAndFeels. ApplicationInstance stores the AppContext for each > applet instance, so the correct type of AppContext can be returned by > JNLPSecuritymanager when AppContext.getAppContext() calls it to find the > current AppContext. > > I would greatly appreciate it if people can try this patch out. While I > have tested with a large number of jnlp files and many applets, it could > certainly use more testing. > > Any and all feedback is welcome! > > Thanks, > Omair > > [1] http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=565 Anyone? Any comments? Thanks, Omair From dbhole at redhat.com Thu Oct 14 11:34:52 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Thu, 14 Oct 2010 14:34:52 -0400 Subject: [RFC] plugin: use an AppContext to support applets running with different look and feels In-Reply-To: <4CB7478A.8010407@redhat.com> References: <4CAE3CAA.3050704@redhat.com> <4CB7478A.8010407@redhat.com> Message-ID: <20101014183452.GC23588@redhat.com> * Omair Majid [2010-10-14 14:17]: > On 10/07/2010 05:33 PM, Omair Majid wrote: > >Hi, > > > >The attached patch is an (updated) attempt to fix PR565 [1]. The patch > >does two things: > > > >1. It creates a ThreadGroup for the applet earlier in the initialization > >phase. > > > >The applet's intialization code (currently) creates 3 threads (most of > >this code is in NetxPanel, AppletPanel and Launcher). The first thread > >is what calls applet.init(), applet.start() etc. It creates the second > >thread to load the applet (so loading can be interrupted). This second > >thread is what calls Launcher.launch() which ends up creating the third > >thread to actually load the applet. This third thread is created in a > >new ThreadGroup and has the JNLPClassLoader set as the > >ContextClassLoader. The patch makes sure that all three threads are > >created in the same ThreadGroup and the appropriate context class loader > >is set for all of them. This part of the patch is attached to the bug > >report. With this patch, all the threads of an applet can load the > >classes for the custom look and feel. > > > >2. Allows different applets to use different look and feels. > > > >The patch creates a new AppContext for each applet ThreadGroup. This > >means that each applet instance can set its own look and feel and not > >affect any other applet (which might lead to visual inconsistency as > >well as errors in loading custom look and feels). The AppContext class > >(part of sun.awt package) contains a map from ThreadGroup to AppContext > >that Swing and AWT can use to make sure they have the AppContext, which > >they can then use to index ThreadGroup-specific things like EventQueues > >and LookAndFeels. ApplicationInstance stores the AppContext for each > >applet instance, so the correct type of AppContext can be returned by > >JNLPSecuritymanager when AppContext.getAppContext() calls it to find the > >current AppContext. > > > >I would greatly appreciate it if people can try this patch out. While I > >have tested with a large number of jnlp files and many applets, it could > >certainly use more testing. > > > >Any and all feedback is welcome! > > > >Thanks, > >Omair > > > >[1] http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=565 > > Anyone? Any comments? > Looks okay to me. The changes look extensive though, and need a bit of testing. Ok for commit to HEAD. We'll hold off on backporting this one for now. Cheers, Deepak > Thanks, > Omair From omajid at icedtea.classpath.org Thu Oct 14 13:00:18 2010 From: omajid at icedtea.classpath.org (omajid at icedtea.classpath.org) Date: Thu, 14 Oct 2010 20:00:18 +0000 Subject: /hg/icedtea6: plugin: Fix PR565: allow applets to have their own... Message-ID: changeset 519a6f970eba in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=519a6f970eba author: Omair Majid date: Thu Oct 14 15:59:52 2010 -0400 plugin: Fix PR565: allow applets to have their own look and feels 2010-10-14 Omair Majid Fixes PR565 * NEWS: Update with fix. * netx/net/sourceforge/jnlp/Launcher.java: Make mainGroup package- private so NetxPanel can access it. (createThreadGroup): Only create a new AppThreadGroup if not a plugin. (run): Update comments and make dependence on SunToolkit explicit. * netx/net/sourceforge/jnlp/NetxPanel.java (run): New method. Create a new AppContext for the applet. (createAppletThread): Create a new AppThreadGroup and start the applet thread in that ThreadGroup. * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: Add new private variable appContext. (ApplicationInstance): Initialize appContext. (getAppContext): New method. * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: Extend AWTSecurityManager. (JNLPSecurityManager): Save the AppContext. (getAppContext): New method. Traverse the stack to find the application and return its AppContext. diffstat: 6 files changed, 123 insertions(+), 7 deletions(-) ChangeLog | 22 ++++++ NEWS | 1 netx/net/sourceforge/jnlp/Launcher.java | 23 +++++-- netx/net/sourceforge/jnlp/NetxPanel.java | 24 +++++++ netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java | 21 ++++++ netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java | 39 +++++++++++- diffs (285 lines): diff -r be9262040bbc -r 519a6f970eba ChangeLog --- a/ChangeLog Thu Oct 14 13:25:44 2010 +0200 +++ b/ChangeLog Thu Oct 14 15:59:52 2010 -0400 @@ -1,3 +1,25 @@ 2010-10-14 Matthias Klose + + Fixes PR565 + * NEWS: Update with fix. + * netx/net/sourceforge/jnlp/Launcher.java: + Make mainGroup package-private so NetxPanel can access it. + (createThreadGroup): Only create a new AppThreadGroup if not a plugin. + (run): Update comments and make dependence on SunToolkit explicit. + * netx/net/sourceforge/jnlp/NetxPanel.java + (run): New method. Create a new AppContext for the applet. + (createAppletThread): Create a new AppThreadGroup and start the applet + thread in that ThreadGroup. + * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: + Add new private variable appContext. + (ApplicationInstance): Initialize appContext. + (getAppContext): New method. + * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: + Extend AWTSecurityManager. + (JNLPSecurityManager): Save the AppContext. + (getAppContext): New method. Traverse the stack to find the application + and return its AppContext. + 2010-10-14 Matthias Klose * configure.ac: New option --with-llvm-config. diff -r be9262040bbc -r 519a6f970eba NEWS --- a/NEWS Thu Oct 14 13:25:44 2010 +0200 +++ b/NEWS Thu Oct 14 15:59:52 2010 -0400 @@ -45,6 +45,7 @@ New in release 1.10 (2010-XX-XX): - PR556: Applet initialization code is prone to race conditions - PR557: Applet opens in a separate window if tab is closed when the applet loads - PR519: 100% CPU usage when displaying applets in Webkit based browsers + - PR565: UIDefaults.getUI fails with jgoodies:looks 2.3.1 New in release 1.9.1 (2010-10-13): diff -r be9262040bbc -r 519a6f970eba netx/net/sourceforge/jnlp/Launcher.java --- a/netx/net/sourceforge/jnlp/Launcher.java Thu Oct 14 13:25:44 2010 +0200 +++ b/netx/net/sourceforge/jnlp/Launcher.java Thu Oct 14 15:59:52 2010 -0400 @@ -49,6 +49,8 @@ import net.sourceforge.jnlp.util.Reflect import javax.swing.SwingUtilities; +import sun.awt.SunToolkit; + /** * Launches JNLPFiles either in the foreground or background.

* @@ -69,7 +71,7 @@ public class Launcher { private static String R(String key) { return JNLPRuntime.getMessage(key); } /** shared thread group */ - private static final ThreadGroup mainGroup = new ThreadGroup(R("LAllThreadGroup")); + /*package*/ static final ThreadGroup mainGroup = new ThreadGroup(R("LAllThreadGroup")); /** the handler */ private LaunchHandler handler = null; @@ -668,9 +670,21 @@ public class Launcher { /** * Create a thread group for the JNLP file. + * + * Note: if the JNLPFile is an applet (ie it is a subclass of PluginBridge) + * then this method simply returns the existing ThreadGroup. The applet + * ThreadGroup has to be created at an earlier point in the applet code. */ protected AppThreadGroup createThreadGroup(JNLPFile file) { - return new AppThreadGroup(mainGroup, file.getTitle()); + AppThreadGroup appThreadGroup = null; + + if (file instanceof PluginBridge) { + appThreadGroup = (AppThreadGroup) Thread.currentThread().getThreadGroup(); + } else { + appThreadGroup = new AppThreadGroup(mainGroup, file.getTitle()); + } + + return appThreadGroup; } /** @@ -796,9 +810,10 @@ public class Launcher { public void run() { try { - // Do not create new AppContext if we're using NetX and gcjwebplugin. + // Do not create new AppContext if we're using NetX and icedteaplugin. + // The plugin needs an AppContext too, but it has to be created earlier. if (context && !isPlugin) - new Reflect().invokeStatic("sun.awt.SunToolkit", "createNewAppContext"); + SunToolkit.createNewAppContext(); if (isPlugin) { // Do not display download indicators if we're using gcjwebplugin. diff -r be9262040bbc -r 519a6f970eba netx/net/sourceforge/jnlp/NetxPanel.java --- a/netx/net/sourceforge/jnlp/NetxPanel.java Thu Oct 14 13:25:44 2010 +0200 +++ b/netx/net/sourceforge/jnlp/NetxPanel.java Thu Oct 14 15:59:52 2010 -0400 @@ -22,6 +22,7 @@ package net.sourceforge.jnlp; +import net.sourceforge.jnlp.runtime.AppThreadGroup; import net.sourceforge.jnlp.runtime.AppletInstance; import net.sourceforge.jnlp.runtime.JNLPRuntime; @@ -29,6 +30,7 @@ import java.util.Hashtable; import java.util.Hashtable; import sun.applet.AppletViewerPanel; +import sun.awt.SunToolkit; /** * This panel calls into netx to run an applet, and pipes the display @@ -54,6 +56,18 @@ public class NetxPanel extends AppletVie this(documentURL, atts); this.exitOnFailure = exitOnFailure; this.appletAlive = true; + } + + @Override + public void run() { + /* + * create an AppContext for this thread associated with this particular + * plugin instance (which runs in a different thread group from the rest + * of the plugin). + */ + SunToolkit.createNewAppContext(); + + super.run(); } //Overriding to use Netx classloader. You might need to relax visibility @@ -125,9 +139,17 @@ public class NetxPanel extends AppletVie } } + /** + * Creates a new Thread (in a new applet-specific ThreadGroup) for running + * the applet + */ // Reminder: Relax visibility in sun.applet.AppletPanel protected synchronized void createAppletThread() { - handler = new Thread(this); + // when this was being done (incorrectly) in Launcher, the call was + // new AppThreadGroup(mainGroup, file.getTitle()); + ThreadGroup tg = new AppThreadGroup(Launcher.mainGroup, + this.documentURL.toString()); + handler = new Thread(tg, this); handler.start(); } diff -r be9262040bbc -r 519a6f970eba netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java --- a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Thu Oct 14 13:25:44 2010 +0200 +++ b/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Thu Oct 14 15:59:52 2010 -0400 @@ -26,6 +26,8 @@ import java.security.ProtectionDomain; import java.security.ProtectionDomain; import javax.swing.event.EventListenerList; + +import sun.awt.AppContext; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.PropertyDesc; @@ -61,6 +63,16 @@ public class ApplicationInstance { /** the classloader */ private ClassLoader loader; + /** + * Every application/applet gets its own AppContext. This allows us to do + * things like have two different look and feels for two different applets + * (running in the same VM), allows untrusted programs to manipulate the + * event queue (safely) and (possibly) more.

+ * + * It is set to the AppContext which created this ApplicationInstance + */ + private AppContext appContext; + /** whether the application has stopped running */ private boolean stopped = false; @@ -74,13 +86,15 @@ public class ApplicationInstance { private boolean isSigned = false; /** - * Create an application instance for the file. + * Create an application instance for the file. This should be done in the + * appropriate {@link ThreadGroup} only. */ public ApplicationInstance(JNLPFile file, ThreadGroup group, ClassLoader loader) { this.file = file; this.group = group; this.loader = loader; this.isSigned = ((JNLPClassLoader) loader).getSigning(); + this.appContext = AppContext.getAppContext(); } /** @@ -297,4 +311,9 @@ public class ApplicationInstance { public boolean isSigned() { return isSigned; } + + public AppContext getAppContext() { + return appContext; + } + } diff -r be9262040bbc -r 519a6f970eba netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java Thu Oct 14 13:25:44 2010 +0200 +++ b/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java Thu Oct 14 15:59:52 2010 -0400 @@ -37,6 +37,8 @@ import net.sourceforge.jnlp.security.Sec import net.sourceforge.jnlp.security.SecurityWarningDialog; import net.sourceforge.jnlp.services.ServiceUtil; import net.sourceforge.jnlp.util.WeakList; +import sun.awt.AWTSecurityManager; +import sun.awt.AppContext; import sun.security.util.SecurityConstants; /** @@ -53,7 +55,7 @@ import sun.security.util.SecurityConstan * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.17 $ */ -class JNLPSecurityManager extends SecurityManager { +class JNLPSecurityManager extends AWTSecurityManager { // todo: some apps like JDiskReport can close the VM even when // an exit class is set - fix! @@ -108,6 +110,13 @@ class JNLPSecurityManager extends Securi private boolean exitAllowed = true; /** + * The AppContext of the main application (netx). We need to store this here + * so we can return this when no code from an external application is + * running on the thread + */ + private AppContext mainAppContext; + + /** * Creates a JNLP SecurityManager. */ JNLPSecurityManager() { @@ -118,6 +127,8 @@ class JNLPSecurityManager extends Securi if (!JNLPRuntime.isHeadless()) new JWindow().getOwner(); + + mainAppContext = AppContext.getAppContext(); } /** @@ -501,4 +512,30 @@ class JNLPSecurityManager extends Securi exitAllowed = false; } + /** + * This returns the appropriate {@link AppContext}. Hooks in AppContext + * check if the current {@link SecurityManager} is an instance of + * AWTSecurityManager and if so, call this method to give it a chance to + * return the appropriate appContext based on the application that is + * running.

+ * + * This can be called from any thread (possibly a swing thread) to find out + * the AppContext for the thread (which may correspond to a particular + * applet). + */ + @Override + public AppContext getAppContext() { + ApplicationInstance app = getApplication(); + if (app == null) { + /* + * if we cannot find an application based on the code on the stack, + * then assume it is the main application + */ + return mainAppContext; + } else { + return app.getAppContext(); + } + + } + } From omajid at redhat.com Thu Oct 14 13:37:13 2010 From: omajid at redhat.com (Omair Majid) Date: Thu, 14 Oct 2010 16:37:13 -0400 Subject: [RFC] netx/plugin: do not prompt user multiple times for the same Certificate Message-ID: <4CB769F9.7010202@redhat.com> Hi, In the current implementation of the plugin, when the user rejects a https certificate, the next time the https connection is attempted, another certificate warning is shown. The attached patch makes it so that if the user does not accept a certificate, he is not prompted again for accepting it. The patch keeps a list of certificates that the user has not accepted and skips the user prompt if it is for one of those certificates. Any comments or suggestions? Cheers, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea6-netx-untrust-certs-01.patch Type: text/x-patch Size: 2176 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101014/794bd1a2/icedtea6-netx-untrust-certs-01.patch From dbhole at redhat.com Thu Oct 14 14:03:54 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Thu, 14 Oct 2010 17:03:54 -0400 Subject: [RFC] netx/plugin: do not prompt user multiple times for the same Certificate In-Reply-To: <4CB769F9.7010202@redhat.com> References: <4CB769F9.7010202@redhat.com> Message-ID: <20101014210354.GE23588@redhat.com> * Omair Majid [2010-10-14 16:37]: > Hi, > > In the current implementation of the plugin, when the user rejects a > https certificate, the next time the https connection is attempted, > another certificate warning is shown. > > The attached patch makes it so that if the user does not accept a > certificate, he is not prompted again for accepting it. The patch > keeps a list of certificates that the user has not accepted and > skips the user prompt if it is for one of those certificates. > > Any comments or suggestions? > Looks fine to me. Okay for commit to all active branches. Cheers, Deepak > Cheers, > Omair > diff -r 519a6f970eba netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java > --- a/netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java Thu Oct 14 15:59:52 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java Thu Oct 14 16:23:50 2010 -0400 > @@ -66,7 +66,8 @@ > X509TrustManager userTrustManager = null; > X509TrustManager caTrustManager = null; > > - ArrayList temporarilyTrusted = new ArrayList(); > + ArrayList temporarilyTrusted = new ArrayList(); > + ArrayList temporarilyUntrusted = new ArrayList(); > > static VariableX509TrustManager instance = null; > > @@ -192,11 +193,14 @@ > if (checkOnly) { > throw ce; > } else { > + if (!isTemporarilyUntrusted(chain[0])) { > + boolean b = askUser(chain, authType, trusted, CNMatched, hostName); > > - boolean b = askUser(chain, authType, trusted, CNMatched, hostName); > - > - if (b) { > - temporarilyTrust(chain[0]); > + if (b) { > + temporarilyTrust(chain[0]); > + } else { > + temporarilyUntrust(chain[0]); > + } > } > > checkAllManagers(chain, authType); > @@ -247,6 +251,30 @@ > } > > /** > + * Temporarily untrust the given cert - do not ask the user to trust this > + * certificate again > + * > + * @param c The certificate to trust > + */ > + private void temporarilyUntrust(Certificate c) { > + temporarilyUntrusted.add(c); > + } > + > + /** > + * Was this certificate explicitly untrusted by user? > + * > + * @param c the certificate > + * @return true if the user was presented with this certificate and chose > + * not to trust it > + */ > + private boolean isTemporarilyUntrusted(Certificate c) { > + if (temporarilyUntrusted.contains(c)) { > + return true; > + } > + return false; > + } > + > + /** > * Temporarily trust the given cert (runtime) > * > * @param c The certificate to trust From ahughes at redhat.com Thu Oct 14 14:28:55 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Thu, 14 Oct 2010 22:28:55 +0100 Subject: VisualVM 1.3.1 patch In-Reply-To: <2594AA86-9315-4866-AD2F-AB2FB891B1D5@googlemail.com> References: <2594AA86-9315-4866-AD2F-AB2FB891B1D5@googlemail.com> Message-ID: <20101014212855.GE6346@rivendell.middle-earth.co.uk> On 15:03 Thu 14 Oct , Tomas Hurka wrote: > Hi All, > attached is a patch to update VisualVM to the latest (1.3.1) version. The patch is done against new VisualVM mercurial repository (http://icedtea.classpath.org/hg/visualvm). Can somebody review and commit these changes for me? > > Note that VisualVM 1.3.1 uses NetBeans Platform 6.9.1. > > Thanks, > -- > Tomas Hurka > NetBeans Profiler http://profiler.netbeans.org > VisualVM http://visualvm.dev.java.net > Software Developer > Oracle, Praha Czech Republic > > > > Thanks Tomas. I'll apply this to the new repository. Cheers, -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From andrew at icedtea.classpath.org Thu Oct 14 14:40:29 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Thu, 14 Oct 2010 21:40:29 +0000 Subject: /hg/visualvm: Support VisualVM 1.3.1. Message-ID: changeset ba2ccec163d0 in /hg/visualvm details: http://icedtea.classpath.org/hg/visualvm?cmd=changeset;node=ba2ccec163d0 author: Andrew John Hughes date: Thu Oct 14 22:40:23 2010 +0100 Support VisualVM 1.3.1. 2010-10-14 Tomas Hurka > Support VisualVM 1.3.1. * INSTALL: Mention 1.3.1. * Makefile.am: Add settings for 1.3.1. * acinclude.m4: Define VVVERSION_131 if 1.3.1 is requested. diffstat: 4 files changed, 35 insertions(+), 1 deletion(-) ChangeLog | 8 ++++++++ INSTALL | 1 + Makefile.am | 21 +++++++++++++++++++++ acinclude.m4 | 6 +++++- diffs (97 lines): diff -r 12011c66e520 -r ba2ccec163d0 ChangeLog --- a/ChangeLog Thu Sep 09 12:59:32 2010 +0100 +++ b/ChangeLog Thu Oct 14 22:40:23 2010 +0100 @@ -1,3 +1,11 @@ 2010-09-09 Andrew John Hughes > + + Support VisualVM 1.3.1. + * INSTALL: Mention 1.3.1. + * Makefile.am: Add settings for 1.3.1. + * acinclude.m4: Define VVVERSION_131 if 1.3.1 + is requested. + 2010-09-09 Andrew John Hughes * configure.ac: Bump to 1.1pre. diff -r 12011c66e520 -r ba2ccec163d0 INSTALL --- a/INSTALL Thu Sep 09 12:59:32 2010 +0100 +++ b/INSTALL Thu Oct 14 22:40:23 2010 +0100 @@ -20,6 +20,7 @@ are: * 1.2.2 with NetBeans 6.8 * 1.3 with NetBeans 6.9 +* 1.3.1 with NetBeans Platform 6.9.1 To build with a version other than the default, specify --with-visualvm-version=x where x is the version. diff -r 12011c66e520 -r ba2ccec163d0 Makefile.am --- a/Makefile.am Thu Sep 09 12:59:32 2010 +0100 +++ b/Makefile.am Thu Oct 14 22:40:23 2010 +0100 @@ -5,6 +5,10 @@ NETBEANS_69_PROFILER_URL = https://visua NETBEANS_69_PROFILER_URL = https://visualvm.dev.java.net/files/documents/7163/152022/ NETBEANS_69_PROFILER_SRC_ZIP = netbeans-profiler-visualvm_release69.tar.gz NETBEANS_69_PROFILER_SHA256SUM = 201060e9ccb4243f7ff1bb490e66a23f3fb16d450892e15f9adbd0728ec0ec83 + +NETBEANS_691_PROFILER_URL = https://visualvm.dev.java.net/files/documents/7163/153051/ +NETBEANS_691_PROFILER_SRC_ZIP = netbeans-profiler-visualvm_release691.tar.gz +NETBEANS_691_PROFILER_SHA256SUM = 9f0e285d983c29bab7aa4f0644d64618139b2967fae80a1ef2b96299bf00fcc0 VISUALVM_122_URL = https://visualvm.dev.java.net/files/documents/7163/146746/ VISUALVM_122_SRC_ZIP = visualvm_122-src.tar.gz @@ -14,6 +18,22 @@ VISUALVM_13_SRC_ZIP = visualvm_13-src.ta VISUALVM_13_SRC_ZIP = visualvm_13-src.tar.gz VISUALVM_13_SHA256SUM = 18105c1e05347caac04830a8ee940219c573a5447d3cd9b084d6883c9ff07353 +VISUALVM_131_URL = https://visualvm.dev.java.net/files/documents/7163/153046/ +VISUALVM_131_SRC_ZIP = visualvm_131-src.tar.gz +VISUALVM_131_SHA256SUM = 910a47e62a48c3fe576752d2d877360a2324d01814702cda5b5c4c8e2df2197a + +if VVVERSION_131 + NETBEANS_PROFILER_URL=$(NETBEANS_691_PROFILER_URL) + NETBEANS_PROFILER_SRC_ZIP=$(NETBEANS_691_PROFILER_SRC_ZIP) + NETBEANS_PROFILER_SHA256SUM=$(NETBEANS_691_PROFILER_SHA256SUM) + VISUALVM_URL=$(VISUALVM_131_URL) + VISUALVM_SRC_ZIP=$(VISUALVM_131_SRC_ZIP) + VISUALVM_SHA256SUM=$(VISUALVM_131_SHA256SUM) + NBPLATFORM_DIR=netbeans/nbbuild/netbeans_visualvm/platform + NBPLATFORM_DIR_COPY=$(NBPLATFORM_DIR) + ADDITIONAL_DIRS=profiler.oql + PROFILER=profiler +else if VVVERSION_13 NETBEANS_PROFILER_URL=$(NETBEANS_69_PROFILER_URL) NETBEANS_PROFILER_SRC_ZIP=$(NETBEANS_69_PROFILER_SRC_ZIP) @@ -36,6 +56,7 @@ else NBPLATFORM_DIR_COPY=$(NBPLATFORM_DIR)/$(NB_PLATFORM) NBBUILD_PROPERTIES=-Dpermit.jdk6.builds=true -Dbuildnumber=091221-4fc006d17cb1 PROFILER=profiler3 +endif endif all: visualvm diff -r 12011c66e520 -r ba2ccec163d0 acinclude.m4 --- a/acinclude.m4 Thu Sep 09 12:59:32 2010 +0100 +++ b/acinclude.m4 Thu Oct 14 22:40:23 2010 +0100 @@ -127,6 +127,7 @@ AC_DEFUN_ONCE([VV_CHECK_WITH_VISUALVM_VE fi AC_MSG_RESULT([${VVVERSION}]) AM_CONDITIONAL([VVVERSION_13], [test "$VVVERSION" = "1.3"]) + AM_CONDITIONAL([VVVERSION_131], [test "$VVVERSION" = "1.3.1"]) ]) AC_DEFUN_ONCE([VV_CHECK_FOR_NETBEANS], @@ -149,10 +150,13 @@ AC_ARG_WITH([netbeans-home], ]) AC_MSG_RESULT([${SYSTEM_NETBEANS_DIR}]) AC_SUBST(SYSTEM_NETBEANS_DIR) -if test "$VVVERSION" = "1.3"; then +if test "$VVVERSION" = "1.3.1"; then + NB_PLATFORM=platform12; +else if test "$VVVERSION" = "1.3"; then NB_PLATFORM=platform12; else NB_PLATFORM=platform11; +fi fi if ! test -d ${SYSTEM_NETBEANS_DIR}/${NB_PLATFORM} ; then AC_MSG_ERROR([Couldn't find NetBeans platform directory: ${SYSTEM_NETBEANS_DIR}/${NB_PLATFORM}]) From bugzilla-daemon at icedtea.classpath.org Thu Oct 14 14:57:14 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 14 Oct 2010 21:57:14 +0000 Subject: [Bug 564] NetX depends on sun.misc.BASE64Encoder Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=564 ------- Comment #5 from gnu_andrew at member.fsf.org 2010-10-14 21:57 ------- It is a bug. This is even backed up by Oracle: $ javac Test.java Test.java:1: warning: sun.misc.BASE64Encoder is internal proprietary API and may be removed in a future release import sun.misc.BASE64Encoder; The fact that other such offending code also exists is not a good reason for us to do it. The motivation for this bug (and others filed under 562) is that we intend to split out NetX and the plugin into a separate project (icedtea-web for want of a better name). For NetX, this will effectively be returning it to its roots as a standalone project. Such a project shouldn't require only IcedTea to build. Omair, there's no reason we can't use apache-commons, though it's probably best to wait until the split before adding such a dependency. VisualVM depends on big chunks of NetBeans already. I'd rather that than we copy chunks of code into our code base. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From ptisnovs at redhat.com Fri Oct 15 05:33:35 2010 From: ptisnovs at redhat.com (Pavel Tisnovsky) Date: Fri, 15 Oct 2010 14:33:35 +0200 Subject: Patch which fixes bug #6853592 Message-ID: <4CB84A1F.4020202@redhat.com> Hi all, I'd like to add new patch to IcedTea6 HEAD and then backport it to previous IcedTea versions (beginning IcedTea6-1.6). This patch fixes bug #6853592 mentioned here: http://bugs.sun.com/view_bug.do?bug_id=6853592 which was introduced to IcedTea6 by another patch 6678385-window_movement_crasher.patch Reproducer(s): - it's possible to reproduce this bug by repeatedly starting & closing test harness GUI (test harness is bundled with IcedTea itself): cd path_to_icedtea6/test/jtreg path_to_tested_jdk/bin/java -jar jtreg.jar -gui path_to_icedtea6/openjdk/hotspot/test Attachments in this mail: hg_export_openjdk7.diff - original export from OpenJDK7, the patch is based on this export 6853592-BadWindow-warning-fix.patch - the patch itself hg_export_icedtea6.diff - changes I would like to do in IcedTea Any comments? Cheers Pavel -------------- next part -------------- A non-text attachment was scrubbed... Name: 6853592-BadWindow-warning-fix.patch Type: text/x-patch Size: 580 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101015/ab301841/6853592-BadWindow-warning-fix.patch -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: hg_export_icedtea6.diff Url: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101015/ab301841/hg_export_icedtea6.diff -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: hg_export_openjdk7.diff Url: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101015/ab301841/hg_export_openjdk7.diff From omajid at redhat.com Fri Oct 15 07:01:31 2010 From: omajid at redhat.com (Omair Majid) Date: Fri, 15 Oct 2010 10:01:31 -0400 Subject: Patch which fixes bug #6853592 In-Reply-To: <4CB84A1F.4020202@redhat.com> References: <4CB84A1F.4020202@redhat.com> Message-ID: <4CB85EBB.3030507@redhat.com> Hi Pavel, On 10/15/2010 08:33 AM, Pavel Tisnovsky wrote: > Hi all, > > I'd like to add new patch to IcedTea6 HEAD and then backport it to > previous IcedTea versions (beginning IcedTea6-1.6). This patch fixes bug > #6853592 mentioned here: > http://bugs.sun.com/view_bug.do?bug_id=6853592 > which was introduced to IcedTea6 by another patch > 6678385-window_movement_crasher.patch > Ah, nice catch! I had seen the error myself a few times, but could never find out what was causing it. Could you please backport it to openjdk6 too? > > Reproducer(s): > - it's possible to reproduce this bug by repeatedly starting& closing > test harness GUI (test harness is bundled with IcedTea itself): > > cd path_to_icedtea6/test/jtreg > path_to_tested_jdk/bin/java -jar jtreg.jar -gui > path_to_icedtea6/openjdk/hotspot/test > > > > Attachments in this mail: > > hg_export_openjdk7.diff - original export from OpenJDK7, the patch is > based on this export > > 6853592-BadWindow-warning-fix.patch - the patch itself > This may be me being a little pedantic, but all other patches have file names in all lower case. Could you please rename the patch to something like 6853592-badwindow-warning-fix.patch when you add it to IcedTea6? > hg_export_icedtea6.diff - changes I would like to do in IcedTea > Can you please ensure that the additions to ChangeLog are based on a line width of 80 chars? Everything else looks good to me. Cheers, Omair From ptisnovs at redhat.com Fri Oct 15 07:14:11 2010 From: ptisnovs at redhat.com (Pavel Tisnovsky) Date: Fri, 15 Oct 2010 16:14:11 +0200 Subject: Patch which fixes bug #6853592 In-Reply-To: <4CB85EBB.3030507@redhat.com> References: <4CB84A1F.4020202@redhat.com> <4CB85EBB.3030507@redhat.com> Message-ID: <4CB861B3.7020301@redhat.com> Hi Omair, thank you for your comments! Omair Majid wrote: > Hi Pavel, > > On 10/15/2010 08:33 AM, Pavel Tisnovsky wrote: >> Hi all, >> >> I'd like to add new patch to IcedTea6 HEAD and then backport it to >> previous IcedTea versions (beginning IcedTea6-1.6). This patch fixes bug >> #6853592 mentioned here: >> http://bugs.sun.com/view_bug.do?bug_id=6853592 >> which was introduced to IcedTea6 by another patch >> 6678385-window_movement_crasher.patch >> > > Ah, nice catch! I had seen the error myself a few times, but could never > find out what was causing it. yeah it tooks me some time figure out what causes this error ;-) >Could you please backport it to openjdk6 too? Yes, I'm going to do it. > >> >> Reproducer(s): >> - it's possible to reproduce this bug by repeatedly starting& closing >> test harness GUI (test harness is bundled with IcedTea itself): >> >> cd path_to_icedtea6/test/jtreg >> path_to_tested_jdk/bin/java -jar jtreg.jar -gui >> path_to_icedtea6/openjdk/hotspot/test >> >> >> >> Attachments in this mail: >> >> hg_export_openjdk7.diff - original export from OpenJDK7, the patch is >> based on this export >> >> 6853592-BadWindow-warning-fix.patch - the patch itself >> > > This may be me being a little pedantic, but all other patches have file > names in all lower case. Could you please rename the patch to something > like 6853592-badwindow-warning-fix.patch when you add it to IcedTea6? yes, of course > >> hg_export_icedtea6.diff - changes I would like to do in IcedTea >> > > Can you please ensure that the additions to ChangeLog are based on a > line width of 80 chars? ah sorry, I forgot to gq this line, will fix it. > > Everything else looks good to me. > > Cheers, > Omair From omajid at redhat.com Fri Oct 15 07:18:37 2010 From: omajid at redhat.com (Omair Majid) Date: Fri, 15 Oct 2010 10:18:37 -0400 Subject: [RFC] plugin: use an AppContext to support applets running with different look and feels In-Reply-To: <20101014183452.GC23588@redhat.com> References: <4CAE3CAA.3050704@redhat.com> <4CB7478A.8010407@redhat.com> <20101014183452.GC23588@redhat.com> Message-ID: <4CB862BD.2060102@redhat.com> On 10/14/2010 02:34 PM, Deepak Bhole wrote: > * Omair Majid [2010-10-14 14:17]: >> On 10/07/2010 05:33 PM, Omair Majid wrote: >>> Hi, >>> >>> The attached patch is an (updated) attempt to fix PR565 [1]. The patch >>> does two things: >>> >>> 1. It creates a ThreadGroup for the applet earlier in the initialization >>> phase. >>> >>> The applet's intialization code (currently) creates 3 threads (most of >>> this code is in NetxPanel, AppletPanel and Launcher). The first thread >>> is what calls applet.init(), applet.start() etc. It creates the second >>> thread to load the applet (so loading can be interrupted). This second >>> thread is what calls Launcher.launch() which ends up creating the third >>> thread to actually load the applet. This third thread is created in a >>> new ThreadGroup and has the JNLPClassLoader set as the >>> ContextClassLoader. The patch makes sure that all three threads are >>> created in the same ThreadGroup and the appropriate context class loader >>> is set for all of them. This part of the patch is attached to the bug >>> report. With this patch, all the threads of an applet can load the >>> classes for the custom look and feel. >>> >>> 2. Allows different applets to use different look and feels. >>> >>> The patch creates a new AppContext for each applet ThreadGroup. This >>> means that each applet instance can set its own look and feel and not >>> affect any other applet (which might lead to visual inconsistency as >>> well as errors in loading custom look and feels). The AppContext class >>> (part of sun.awt package) contains a map from ThreadGroup to AppContext >>> that Swing and AWT can use to make sure they have the AppContext, which >>> they can then use to index ThreadGroup-specific things like EventQueues >>> and LookAndFeels. ApplicationInstance stores the AppContext for each >>> applet instance, so the correct type of AppContext can be returned by >>> JNLPSecuritymanager when AppContext.getAppContext() calls it to find the >>> current AppContext. >>> >>> I would greatly appreciate it if people can try this patch out. While I >>> have tested with a large number of jnlp files and many applets, it could >>> certainly use more testing. >>> >>> Any and all feedback is welcome! >>> >>> Thanks, >>> Omair >>> >>> [1] http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=565 >> >> Anyone? Any comments? >> > > Looks okay to me. The changes look extensive though, and need a bit of > testing. Ok for commit to HEAD. We'll hold off on backporting this one > for now. > I have pushed a slightly modified version of this patch to HEAD. I am perfectly fine with not backporting until it has been tested a little more. Thanks for the review. Cheers, Omair From ptisnovs at icedtea.classpath.org Fri Oct 15 07:28:21 2010 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Fri, 15 Oct 2010 14:28:21 +0000 Subject: /hg/icedtea6: Added patch which fixes bug #6853592 Message-ID: changeset 12902038b45b in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=12902038b45b author: ptisnovs date: Fri Oct 15 15:32:50 2010 +0200 Added patch which fixes bug #6853592 diffstat: 3 files changed, 24 insertions(+), 1 deletion(-) ChangeLog | 6 ++++++ Makefile.am | 3 ++- patches/openjdk/6853592-badwindow-warning-fix.patch | 16 ++++++++++++++++ diffs (46 lines): diff -r 519a6f970eba -r 12902038b45b ChangeLog --- a/ChangeLog Thu Oct 14 15:59:52 2010 -0400 +++ b/ChangeLog Fri Oct 15 15:32:50 2010 +0200 @@ -1,3 +1,9 @@ 2010-10-14 Omair Majid + + * patches/openjdk/6853592-BadWindow-warning-fix.patch: + Added patch which fixes bug #6853592 introduced by another patch + 6678385-window_movement_crasher.patch + 2010-10-14 Omair Majid Fixes PR565 diff -r 519a6f970eba -r 12902038b45b Makefile.am --- a/Makefile.am Thu Oct 14 15:59:52 2010 -0400 +++ b/Makefile.am Fri Oct 15 15:32:50 2010 +0200 @@ -324,7 +324,8 @@ ICEDTEA_PATCHES += \ patches/shark-debug-option.patch \ patches/icedtea-shark.patch \ patches/icedtea-linux-separate-debuginfo.patch \ - patches/openjdk/6951319-sparc_build_fixes.patch + patches/openjdk/6951319-sparc_build_fixes.patch \ + patches/openjdk/6853592-badwindow-warning-fix.patch endif if WITH_RHINO diff -r 519a6f970eba -r 12902038b45b patches/openjdk/6853592-badwindow-warning-fix.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/6853592-badwindow-warning-fix.patch Fri Oct 15 15:32:50 2010 +0200 @@ -0,0 +1,16 @@ +--- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java 2010-07-15 10:28:21.896105637 -0400 ++++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java 2010-07-15 10:30:45.039232001 -0400 +@@ -298,13 +298,6 @@ + if (log.isLoggable(Level.FINE)) { + dumpPeers(); + } +- +- awtLock(); +- try { +- XlibWrapper.XSetErrorHandler(saved_error_handler); +- } finally { +- awtUnlock(); +- } + } + }); + } From ahughes at redhat.com Fri Oct 15 07:39:15 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Fri, 15 Oct 2010 15:39:15 +0100 Subject: Patch which fixes bug #6853592 In-Reply-To: <4CB861B3.7020301@redhat.com> References: <4CB84A1F.4020202@redhat.com> <4CB85EBB.3030507@redhat.com> <4CB861B3.7020301@redhat.com> Message-ID: <20101015143915.GA16871@rivendell.middle-earth.co.uk> On 16:14 Fri 15 Oct , Pavel Tisnovsky wrote: > Hi Omair, > > thank you for your comments! > > Omair Majid wrote: > > Hi Pavel, > > > > On 10/15/2010 08:33 AM, Pavel Tisnovsky wrote: > >> Hi all, > >> > >> I'd like to add new patch to IcedTea6 HEAD and then backport it to > >> previous IcedTea versions (beginning IcedTea6-1.6). This patch fixes bug > >> #6853592 mentioned here: > >> http://bugs.sun.com/view_bug.do?bug_id=6853592 > >> which was introduced to IcedTea6 by another patch > >> 6678385-window_movement_crasher.patch > >> > > > > Ah, nice catch! I had seen the error myself a few times, but could never > > find out what was causing it. > > yeah it tooks me some time figure out what causes this error ;-) > > >Could you please backport it to openjdk6 too? > > Yes, I'm going to do it. > > > > >> > >> Reproducer(s): > >> - it's possible to reproduce this bug by repeatedly starting& closing > >> test harness GUI (test harness is bundled with IcedTea itself): > >> > >> cd path_to_icedtea6/test/jtreg > >> path_to_tested_jdk/bin/java -jar jtreg.jar -gui > >> path_to_icedtea6/openjdk/hotspot/test > >> > >> > >> > >> Attachments in this mail: > >> > >> hg_export_openjdk7.diff - original export from OpenJDK7, the patch is > >> based on this export > >> > >> 6853592-BadWindow-warning-fix.patch - the patch itself > >> > > > > This may be me being a little pedantic, but all other patches have file > > names in all lower case. Could you please rename the patch to something > > like 6853592-badwindow-warning-fix.patch when you add it to IcedTea6? > > yes, of course > > > > >> hg_export_icedtea6.diff - changes I would like to do in IcedTea > >> > > > > Can you please ensure that the additions to ChangeLog are based on a > > line width of 80 chars? > > ah sorry, I forgot to gq this line, will fix it. > > > > > Everything else looks good to me. > > > > Cheers, > > Omair > I approve this for 1.7, 1.8, 1.9 and HEAD with Omair's changes. 1.6 is a dead branch so don't apply it there. 6678385 is also in OpenJDK6 so please backport to OpenJDK6 too via jdk6-dev. -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From ptisnovs at redhat.com Fri Oct 15 08:07:24 2010 From: ptisnovs at redhat.com (Pavel Tisnovsky) Date: Fri, 15 Oct 2010 17:07:24 +0200 Subject: Patch which fixes bug #6703377 (font outline transformation) Message-ID: <4CB86E2C.7000102@redhat.com> Hi all, I prepared yet another patch for IcedTea6 HEAD. This patch refine computation of x and y coordinates during font outline transformation when negative values are used (see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6703377) Attached files: 6703377-freetypescaler.patch - the patch itself hg_export_icedtea6.diff - changes I would like to make in IcedTea Correct behaviour of outline transformation is (partially) checked by regression test: java/awt/font/Rotate/TranslatedOutlineTest.java Can anyone please review this patch? Thank you in advance, Pavel -------------- next part -------------- A non-text attachment was scrubbed... Name: 6703377-freetypescaler.patch Type: text/x-patch Size: 444 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101015/509ff8d9/6703377-freetypescaler.patch -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: hg_export_icedtea6.diff Url: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101015/509ff8d9/hg_export_icedtea6.diff From ahughes at redhat.com Fri Oct 15 08:28:20 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Fri, 15 Oct 2010 16:28:20 +0100 Subject: Patch which fixes bug #6703377 (font outline transformation) In-Reply-To: <4CB86E2C.7000102@redhat.com> References: <4CB86E2C.7000102@redhat.com> Message-ID: <20101015152820.GB16871@rivendell.middle-earth.co.uk> On 17:07 Fri 15 Oct , Pavel Tisnovsky wrote: > Hi all, > > I prepared yet another patch for IcedTea6 HEAD. This patch refine > computation of x and y coordinates during font outline transformation > when negative values are used > (see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6703377) > > Attached files: > > 6703377-freetypescaler.patch - the patch itself > hg_export_icedtea6.diff - changes I would like to make in IcedTea > > Correct behaviour of outline transformation is (partially) checked by > regression test: > java/awt/font/Rotate/TranslatedOutlineTest.java > > Can anyone please review this patch? > Looks good. Please apply to HEAD and 1.9. (From what you said on IRC, I presume it depends on the DirectX backport in 1.9). > Thank you in advance, > Pavel > --- openjdk.orig/jdk/src/share/native/sun/font/freetypeScaler.c 2010-10-15 15:19:35.000000000 +0200 > +++ openjdk/jdk/src/share/native/sun/font/freetypeScaler.c 2010-10-15 15:19:35.000000000 +0200 > @@ -979,7 +979,7 @@ > } > > > -#define FloatToF26Dot6(x) ((unsigned int) ((x)*64)) > +#define FloatToF26Dot6(x) ((int) ((x)*64)) > > static FT_Outline* getFTOutline(JNIEnv* env, jobject font2D, > FTScalerContext *context, FTScalerInfo* scalerInfo, > # HG changeset patch > # User ptisnovs > # Date 1287150573 -7200 > # Node ID eae703fb6d8eb18bdd8cd0c17f674f8409b70a56 > # Parent 12902038b45bf361824ceb6c9506f1c6eb3dcdad > Added patch which fixes bug #6703377. > > diff -r 12902038b45b -r eae703fb6d8e ChangeLog > --- a/ChangeLog Fri Oct 15 15:32:50 2010 +0200 > +++ b/ChangeLog Fri Oct 15 15:49:33 2010 +0200 > @@ -1,3 +1,8 @@ > +2010-10-15 Pavel Tisnovsky > + > + * patches/openjdk/6703377-freetypescaler.patch: > + Added patch which fixes bug #6703377. > + > 2010-10-15 Pavel Tisnovsky > > * patches/openjdk/6853592-BadWindow-warning-fix.patch: > diff -r 12902038b45b -r eae703fb6d8e Makefile.am > --- a/Makefile.am Fri Oct 15 15:32:50 2010 +0200 > +++ b/Makefile.am Fri Oct 15 15:49:33 2010 +0200 > @@ -325,7 +325,8 @@ > patches/icedtea-shark.patch \ > patches/icedtea-linux-separate-debuginfo.patch \ > patches/openjdk/6951319-sparc_build_fixes.patch \ > - patches/openjdk/6853592-badwindow-warning-fix.patch > + patches/openjdk/6853592-badwindow-warning-fix.patch \ > + patches/openjdk/6703377-freetypescaler.patch > endif > > if WITH_RHINO > diff -r 12902038b45b -r eae703fb6d8e patches/openjdk/6703377-freetypescaler.patch > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/patches/openjdk/6703377-freetypescaler.patch Fri Oct 15 15:49:33 2010 +0200 > @@ -0,0 +1,11 @@ > +--- openjdk.orig/jdk/src/share/native/sun/font/freetypeScaler.c 2010-10-15 15:19:35.000000000 +0200 > ++++ openjdk/jdk/src/share/native/sun/font/freetypeScaler.c 2010-10-15 15:19:35.000000000 +0200 > +@@ -979,7 +979,7 @@ > + } > + > + > +-#define FloatToF26Dot6(x) ((unsigned int) ((x)*64)) > ++#define FloatToF26Dot6(x) ((int) ((x)*64)) > + > + static FT_Outline* getFTOutline(JNIEnv* env, jobject font2D, > + FTScalerContext *context, FTScalerInfo* scalerInfo, -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From ptisnovs at icedtea.classpath.org Mon Oct 18 02:25:38 2010 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Mon, 18 Oct 2010 09:25:38 +0000 Subject: /hg/release/icedtea6-1.9: Added patch which fixes bug #6853592 i... Message-ID: changeset 66e3c18bd585 in /hg/release/icedtea6-1.9 details: http://icedtea.classpath.org/hg/release/icedtea6-1.9?cmd=changeset;node=66e3c18bd585 author: ptisnovs date: Mon Oct 18 11:29:08 2010 +0200 Added patch which fixes bug #6853592 introduced by another patch 6678385-window_movement_crasher.patch diffstat: 3 files changed, 24 insertions(+), 1 deletion(-) ChangeLog | 6 ++++++ Makefile.am | 3 ++- patches/openjdk/6853592-badwindow-warning-fix.patch | 16 ++++++++++++++++ diffs (46 lines): diff -r f087888f1785 -r 66e3c18bd585 ChangeLog --- a/ChangeLog Wed Oct 13 01:29:59 2010 +0100 +++ b/ChangeLog Mon Oct 18 11:29:08 2010 +0200 @@ -1,3 +1,9 @@ 2010-10-13 Andrew John Hughes + + * patches/openjdk/6853592-badwindow-warning-fix.patch: + Added patch which fixes bug #6853592 introduced by another patch + 6678385-window_movement_crasher.patch + 2010-10-13 Andrew John Hughes * NEWS: diff -r f087888f1785 -r 66e3c18bd585 Makefile.am --- a/Makefile.am Wed Oct 13 01:29:59 2010 +0100 +++ b/Makefile.am Mon Oct 18 11:29:08 2010 +0200 @@ -321,7 +321,8 @@ ICEDTEA_PATCHES += \ patches/shark-debug-option.patch \ patches/icedtea-shark.patch \ patches/icedtea-linux-separate-debuginfo.patch \ - patches/openjdk/6951319-sparc_build_fixes.patch + patches/openjdk/6951319-sparc_build_fixes.patch \ + patches/openjdk/6853592-badwindow-warning-fix.patch endif if WITH_RHINO diff -r f087888f1785 -r 66e3c18bd585 patches/openjdk/6853592-badwindow-warning-fix.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/6853592-badwindow-warning-fix.patch Mon Oct 18 11:29:08 2010 +0200 @@ -0,0 +1,16 @@ +--- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java 2010-07-15 10:28:21.896105637 -0400 ++++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java 2010-07-15 10:30:45.039232001 -0400 +@@ -298,13 +298,6 @@ + if (log.isLoggable(Level.FINE)) { + dumpPeers(); + } +- +- awtLock(); +- try { +- XlibWrapper.XSetErrorHandler(saved_error_handler); +- } finally { +- awtUnlock(); +- } + } + }); + } From ptisnovs at icedtea.classpath.org Mon Oct 18 02:39:38 2010 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Mon, 18 Oct 2010 09:39:38 +0000 Subject: /hg/release/icedtea6-1.8: Added patch which fixes bug #6853592 i... Message-ID: changeset e7546eadcbe4 in /hg/release/icedtea6-1.8 details: http://icedtea.classpath.org/hg/release/icedtea6-1.8?cmd=changeset;node=e7546eadcbe4 author: ptisnovs date: Mon Oct 18 11:43:53 2010 +0200 Added patch which fixes bug #6853592 introduced by another patch 6678385-window_movement_crasher.patch diffstat: 2 files changed, 8 insertions(+), 1 deletion(-) ChangeLog | 6 ++++++ Makefile.am | 3 ++- diffs (26 lines): diff -r 5022d1680b70 -r e7546eadcbe4 ChangeLog --- a/ChangeLog Wed Oct 13 01:28:37 2010 +0100 +++ b/ChangeLog Mon Oct 18 11:43:53 2010 +0200 @@ -1,3 +1,9 @@ 2010-10-13 Andrew John Hughes + + * patches/openjdk/6853592-BadWindow-warning-fix.patch: + Added patch which fixes bug #6853592 introduced by another patch + 6678385-window_movement_crasher.patch + 2010-10-13 Andrew John Hughes * NEWS: diff -r 5022d1680b70 -r e7546eadcbe4 Makefile.am --- a/Makefile.am Wed Oct 13 01:28:37 2010 +0100 +++ b/Makefile.am Mon Oct 18 11:43:53 2010 +0200 @@ -355,7 +355,8 @@ ICEDTEA_PATCHES = \ patches/icedtea-too-many-args.patch \ patches/openjdk/6638712-wildcard_types.patch \ patches/openjdk/6650759-missing_inference.patch \ - patches/numa_on_early_glibc.patch + patches/numa_on_early_glibc.patch \ + patches/openjdk/6853592-badwindow-warning-fix.patch if WITH_ALT_HSBUILD ICEDTEA_PATCHES += patches/hotspot/$(HSBUILD)/openjdk-6886353-ignore_deoptimizealot.patch \ From ptisnovs at icedtea.classpath.org Mon Oct 18 02:50:13 2010 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Mon, 18 Oct 2010 09:50:13 +0000 Subject: /hg/release/icedtea6-1.8: Added missed patch (unfortunately hg a... Message-ID: changeset 666f6453befc in /hg/release/icedtea6-1.8 details: http://icedtea.classpath.org/hg/release/icedtea6-1.8?cmd=changeset;node=666f6453befc author: ptisnovs date: Mon Oct 18 11:54:21 2010 +0200 Added missed patch (unfortunately hg addremove didn't work as I expected). diffstat: 1 file changed, 16 insertions(+) patches/openjdk/6853592-badwindow-warning-fix.patch | 16 ++++++++++++++++ diffs (20 lines): diff -r e7546eadcbe4 -r 666f6453befc patches/openjdk/6853592-badwindow-warning-fix.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/6853592-badwindow-warning-fix.patch Mon Oct 18 11:54:21 2010 +0200 @@ -0,0 +1,16 @@ +--- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java 2010-07-15 10:28:21.896105637 -0400 ++++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java 2010-07-15 10:30:45.039232001 -0400 +@@ -298,13 +298,6 @@ + if (log.isLoggable(Level.FINE)) { + dumpPeers(); + } +- +- awtLock(); +- try { +- XlibWrapper.XSetErrorHandler(saved_error_handler); +- } finally { +- awtUnlock(); +- } + } + }); + } From ptisnovs at icedtea.classpath.org Mon Oct 18 02:53:20 2010 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Mon, 18 Oct 2010 09:53:20 +0000 Subject: /hg/release/icedtea6-1.7: Added patch which fixes bug #6853592 i... Message-ID: changeset 35325772e106 in /hg/release/icedtea6-1.7 details: http://icedtea.classpath.org/hg/release/icedtea6-1.7?cmd=changeset;node=35325772e106 author: ptisnovs date: Mon Oct 18 11:57:40 2010 +0200 Added patch which fixes bug #6853592 introduced by another patch 6678385.patch diffstat: 3 files changed, 24 insertions(+), 1 deletion(-) ChangeLog | 6 ++++++ Makefile.am | 3 ++- patches/openjdk/6853592-badwindow-warning-fix.patch | 16 ++++++++++++++++ diffs (46 lines): diff -r 11ee55e1c9b4 -r 35325772e106 ChangeLog --- a/ChangeLog Wed Oct 13 01:27:29 2010 +0100 +++ b/ChangeLog Mon Oct 18 11:57:40 2010 +0200 @@ -1,3 +1,9 @@ 2010-10-13 Andrew John Hughes + + * patches/openjdk/6853592-BadWindow-warning-fix.patch: + Added patch which fixes bug #6853592 introduced by another patch + 6678385-window_movement_crasher.patch + 2010-10-13 Andrew John Hughes * NEWS: diff -r 11ee55e1c9b4 -r 35325772e106 Makefile.am --- a/Makefile.am Wed Oct 13 01:27:29 2010 +0100 +++ b/Makefile.am Mon Oct 18 11:57:40 2010 +0200 @@ -369,7 +369,8 @@ ICEDTEA_PATCHES = \ patches/fonts-rhel.patch \ patches/openjdk/6638712-wildcard_types.patch \ patches/openjdk/6650759-missing_inference.patch \ - patches/numa_on_early_glibc.patch + patches/numa_on_early_glibc.patch \ + patches/openjdk/6853592-badwindow-warning-fix.patch if WITH_ALT_HSBUILD ICEDTEA_PATCHES += patches/hotspot/$(HSBUILD)/openjdk-6886353-ignore_deoptimizealot.patch \ diff -r 11ee55e1c9b4 -r 35325772e106 patches/openjdk/6853592-badwindow-warning-fix.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/6853592-badwindow-warning-fix.patch Mon Oct 18 11:57:40 2010 +0200 @@ -0,0 +1,16 @@ +--- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java 2010-07-15 10:28:21.896105637 -0400 ++++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java 2010-07-15 10:30:45.039232001 -0400 +@@ -298,13 +298,6 @@ + if (log.isLoggable(Level.FINE)) { + dumpPeers(); + } +- +- awtLock(); +- try { +- XlibWrapper.XSetErrorHandler(saved_error_handler); +- } finally { +- awtUnlock(); +- } + } + }); + } From ptisnovs at redhat.com Mon Oct 18 05:24:24 2010 From: ptisnovs at redhat.com (Pavel Tisnovsky) Date: Mon, 18 Oct 2010 14:24:24 +0200 Subject: Unable to build IcedTea6-1.7, probably due to javaws man page(s) generation patch Message-ID: <4CBC3C78.4000206@redhat.com> Hi, I'm unable to build IcedTea6-1.7 which is IMHO caused by javaws patch (generation of man page(s)). I tried to run build on RHEL 5 x86_64, output of configure is included as attachment (config.log). The build itself fails with this message: make[1]: Leaving directory `/jck/icedtea6-1.7/openjdk' mkdir -p openjdk/build/linux-amd64/j2sdk-image/jre/lib/amd64 mkdir -p openjdk/build/linux-amd64/j2re-image/lib/amd64 mkdir -p openjdk/build/linux-amd64/j2sdk-image/jre/lib/ext mkdir -p openjdk/build/linux-amd64/j2re-image/lib/ext cp /jck/icedtea6-1.7/rt/net/sourceforge/jnlp/resources/about.jnlp \ extra-lib/about.jar \ openjdk/build/linux-amd64/j2re-image/lib ; \ cp /jck/icedtea6-1.7/rt/net/sourceforge/jnlp/resources/about.jnlp \ extra-lib/about.jar \ openjdk/build/linux-amd64/j2sdk-image/jre/lib if [ -d openjdk/build/linux-amd64/j2sdk-image/man/man1 ] ; then \ cp /jck/icedtea6-1.7/rt/javaws.1 \ openjdk/build/linux-amd64/j2sdk-image/man/man1 ; \ fi cp: cannot stat `/jck/icedtea6-1.7/rt/javaws.1': No such file or directory make: *** [stamps/icedtea.stamp] Error 1 Actual content of rt/ subdirectory: drwxr-xr-x 7 ptisnovs ptisnovs 4096 Oct 18 13:47 . drwxr-xr-x 24 ptisnovs ptisnovs 4096 Oct 18 13:47 .. drwxr-xr-x 3 ptisnovs ptisnovs 4096 Oct 18 13:14 com drwxr-xr-x 5 ptisnovs ptisnovs 4096 Oct 18 13:47 java drwxr-xr-x 5 ptisnovs ptisnovs 4096 Oct 18 13:47 javax drwxr-xr-x 3 ptisnovs ptisnovs 4096 Oct 18 13:14 net drwxr-xr-x 3 ptisnovs ptisnovs 4096 Oct 18 13:47 sun Does anyone have any idea what's wrong (maybe incorrect parameters)? Thanks in advance Pavel T. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: config.log Url: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101018/7fe54804/config.log From ahughes at redhat.com Mon Oct 18 06:16:47 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Mon, 18 Oct 2010 14:16:47 +0100 Subject: Unable to build IcedTea6-1.7, probably due to javaws man page(s) generation patch In-Reply-To: <4CBC3C78.4000206@redhat.com> References: <4CBC3C78.4000206@redhat.com> Message-ID: <20101018131646.GB31704@rivendell.middle-earth.co.uk> On 14:24 Mon 18 Oct , Pavel Tisnovsky wrote: > Hi, > > I'm unable to build IcedTea6-1.7 which is IMHO caused by javaws patch > (generation of man page(s)). I tried to run build on RHEL 5 x86_64, > output of configure is included as attachment (config.log). The build > itself fails with this message: > > make[1]: Leaving directory `/jck/icedtea6-1.7/openjdk' > mkdir -p openjdk/build/linux-amd64/j2sdk-image/jre/lib/amd64 > mkdir -p openjdk/build/linux-amd64/j2re-image/lib/amd64 > mkdir -p openjdk/build/linux-amd64/j2sdk-image/jre/lib/ext > mkdir -p openjdk/build/linux-amd64/j2re-image/lib/ext > cp /jck/icedtea6-1.7/rt/net/sourceforge/jnlp/resources/about.jnlp \ > extra-lib/about.jar \ > openjdk/build/linux-amd64/j2re-image/lib ; \ > cp /jck/icedtea6-1.7/rt/net/sourceforge/jnlp/resources/about.jnlp \ > extra-lib/about.jar \ > openjdk/build/linux-amd64/j2sdk-image/jre/lib > if [ -d openjdk/build/linux-amd64/j2sdk-image/man/man1 ] ; then \ > cp /jck/icedtea6-1.7/rt/javaws.1 \ > openjdk/build/linux-amd64/j2sdk-image/man/man1 ; \ > fi > cp: cannot stat `/jck/icedtea6-1.7/rt/javaws.1': No such file or directory > make: *** [stamps/icedtea.stamp] Error 1 > > Actual content of rt/ subdirectory: > drwxr-xr-x 7 ptisnovs ptisnovs 4096 Oct 18 13:47 . > drwxr-xr-x 24 ptisnovs ptisnovs 4096 Oct 18 13:47 .. > drwxr-xr-x 3 ptisnovs ptisnovs 4096 Oct 18 13:14 com > drwxr-xr-x 5 ptisnovs ptisnovs 4096 Oct 18 13:47 java > drwxr-xr-x 5 ptisnovs ptisnovs 4096 Oct 18 13:47 javax > drwxr-xr-x 3 ptisnovs ptisnovs 4096 Oct 18 13:14 net > drwxr-xr-x 3 ptisnovs ptisnovs 4096 Oct 18 13:47 sun > > Does anyone have any idea what's wrong (maybe incorrect parameters)? > > Thanks in advance > Pavel T. It looks like it wasn't added in 1.7 due to the move to rt from netx. It is in the tarball. I've now added it to hg and moved the tag to better reflect the released tarball. > This file contains any messages produced by compilers while > running configure, to aid debugging if configure makes a mistake. > > It was created by icedtea6 configure 1.7.5, which was > generated by GNU Autoconf 2.59. Invocation command line was > > $ ./configure --with-openjdk --without-rhino --disable-plugin --disable-npplugin > > ## --------- ## > ## Platform. ## > ## --------- ## > > hostname = dell-r210-09.mw.lab.eng.brq.redhat.com > uname -m = x86_64 > uname -r = 2.6.18-164.9.1.el5 > uname -s = Linux > uname -v = #1 SMP Wed Dec 9 03:27:37 EST 2009 > > /usr/bin/uname -p = unknown > /bin/uname -X = unknown > > /bin/arch = x86_64 > /usr/bin/arch -k = unknown > /usr/convex/getsysinfo = unknown > hostinfo = unknown > /bin/machine = unknown > /usr/bin/oslevel = unknown > /bin/universe = unknown > > PATH: /usr/kerberos/bin > PATH: /usr/local/bin > PATH: /bin > PATH: /usr/bin > PATH: /home/brq/ptisnovs/bin > > > ## ----------- ## > ## Core tests. ## > ## ----------- ## > > configure:1611: checking for a BSD-compatible install > configure:1666: result: /usr/bin/install -c > configure:1677: checking whether build environment is sane > configure:1720: result: yes > configure:1785: checking for gawk > configure:1801: found /bin/gawk > configure:1811: result: gawk > configure:1821: checking whether make sets $(MAKE) > configure:1841: result: yes > configure:2004: checking how to create a pax tar archive > configure:2017: tar --version > tar (GNU tar) 1.15.1 > configure:2020: $? = 0 > configure:2060: tardir=conftest.dir && eval tar --format=posix -chf - "$tardir" >conftest.tar > configure:2063: $? = 0 > configure:2067: tar -xf - configure:2070: $? = 0 > configure:2083: result: gnutar > configure:2108: checking build system type > configure:2126: result: x86_64-unknown-linux-gnu > configure:2134: checking host system type > configure:2148: result: x86_64-unknown-linux-gnu > configure:2205: checking for gcc > configure:2221: found /usr/bin/gcc > configure:2231: result: gcc > configure:2475: checking for C compiler version > configure:2478: gcc --version &5 > gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46) > Copyright (C) 2006 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > > configure:2481: $? = 0 > configure:2483: gcc -v &5 > Using built-in specs. > Target: x86_64-redhat-linux > Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux > Thread model: posix > gcc version 4.1.2 20080704 (Red Hat 4.1.2-46) > configure:2486: $? = 0 > configure:2488: gcc -V &5 > gcc: '-V' option must have argument > configure:2491: $? = 1 > configure:2514: checking for C compiler default output file name > configure:2517: gcc conftest.c >&5 > configure:2520: $? = 0 > configure:2566: result: a.out > configure:2571: checking whether the C compiler works > configure:2577: ./a.out > configure:2580: $? = 0 > configure:2597: result: yes > configure:2604: checking whether we are cross compiling > configure:2606: result: no > configure:2609: checking for suffix of executables > configure:2611: gcc -o conftest conftest.c >&5 > configure:2614: $? = 0 > configure:2639: result: > configure:2645: checking for suffix of object files > configure:2666: gcc -c conftest.c >&5 > configure:2669: $? = 0 > configure:2691: result: o > configure:2695: checking whether we are using the GNU C compiler > configure:2719: gcc -c conftest.c >&5 > configure:2725: $? = 0 > configure:2729: test -z > || test ! -s conftest.err > configure:2732: $? = 0 > configure:2735: test -s conftest.o > configure:2738: $? = 0 > configure:2751: result: yes > configure:2757: checking whether gcc accepts -g > configure:2778: gcc -c -g conftest.c >&5 > configure:2784: $? = 0 > configure:2788: test -z > || test ! -s conftest.err > configure:2791: $? = 0 > configure:2794: test -s conftest.o > configure:2797: $? = 0 > configure:2808: result: yes > configure:2825: checking for gcc option to accept ANSI C > configure:2895: gcc -c -g -O2 conftest.c >&5 > configure:2901: $? = 0 > configure:2905: test -z > || test ! -s conftest.err > configure:2908: $? = 0 > configure:2911: test -s conftest.o > configure:2914: $? = 0 > configure:2932: result: none needed > configure:2950: gcc -c -g -O2 conftest.c >&5 > conftest.c:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'me' > configure:2956: $? = 1 > configure: failed program was: > | #ifndef __cplusplus > | choke me > | #endif > configure:3100: checking for style of include used by make > configure:3128: result: GNU > configure:3156: checking dependency style of gcc > configure:3246: result: none > configure:3315: checking for g++ > configure:3331: found /usr/bin/g++ > configure:3341: result: g++ > configure:3357: checking for C++ compiler version > configure:3360: g++ --version &5 > g++ (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46) > Copyright (C) 2006 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > > configure:3363: $? = 0 > configure:3365: g++ -v &5 > Using built-in specs. > Target: x86_64-redhat-linux > Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux > Thread model: posix > gcc version 4.1.2 20080704 (Red Hat 4.1.2-46) > configure:3368: $? = 0 > configure:3370: g++ -V &5 > g++: '-V' option must have argument > configure:3373: $? = 1 > configure:3376: checking whether we are using the GNU C++ compiler > configure:3400: g++ -c conftest.cc >&5 > configure:3406: $? = 0 > configure:3410: test -z > || test ! -s conftest.err > configure:3413: $? = 0 > configure:3416: test -s conftest.o > configure:3419: $? = 0 > configure:3432: result: yes > configure:3438: checking whether g++ accepts -g > configure:3459: g++ -c -g conftest.cc >&5 > configure:3465: $? = 0 > configure:3469: test -z > || test ! -s conftest.err > configure:3472: $? = 0 > configure:3475: test -s conftest.o > configure:3478: $? = 0 > configure:3489: result: yes > configure:3531: g++ -c -g -O2 conftest.cc >&5 > configure:3537: $? = 0 > configure:3541: test -z > || test ! -s conftest.err > configure:3544: $? = 0 > configure:3547: test -s conftest.o > configure:3550: $? = 0 > configure:3576: g++ -c -g -O2 conftest.cc >&5 > conftest.cc: In function 'int main()': > conftest.cc:15: error: 'exit' was not declared in this scope > configure:3582: $? = 1 > configure: failed program was: > | /* confdefs.h. */ > | > | #define PACKAGE_NAME "icedtea6" > | #define PACKAGE_TARNAME "icedtea6" > | #define PACKAGE_VERSION "1.7.5" > | #define PACKAGE_STRING "icedtea6 1.7.5" > | #define PACKAGE_BUGREPORT "distro-pkg-dev at openjdk.java.net" > | #define PACKAGE "icedtea6" > | #define VERSION "1.7.5" > | /* end confdefs.h. */ > | > | int > | main () > | { > | exit (42); > | ; > | return 0; > | } > configure:3531: g++ -c -g -O2 conftest.cc >&5 > configure:3537: $? = 0 > configure:3541: test -z > || test ! -s conftest.err > configure:3544: $? = 0 > configure:3547: test -s conftest.o > configure:3550: $? = 0 > configure:3576: g++ -c -g -O2 conftest.cc >&5 > configure:3582: $? = 0 > configure:3586: test -z > || test ! -s conftest.err > configure:3589: $? = 0 > configure:3592: test -s conftest.o > configure:3595: $? = 0 > configure:3620: checking dependency style of g++ > configure:3710: result: none > configure:3773: checking for make > configure:3791: found /usr/bin/make > configure:3803: result: /usr/bin/make > configure:3867: checking for gzip > configure:3885: found /bin/gzip > configure:3897: result: /bin/gzip > configure:3961: checking for ant > configure:3979: found /usr/bin/ant > configure:3991: result: /usr/bin/ant > configure:4055: checking for find > configure:4073: found /usr/bin/find > configure:4085: result: /usr/bin/find > configure:4149: checking for patch > configure:4167: found /usr/bin/patch > configure:4179: result: /usr/bin/patch > configure:4243: checking for tar > configure:4261: found /bin/tar > configure:4273: result: /bin/tar > configure:4337: checking for chmod > configure:4355: found /bin/chmod > configure:4367: result: /bin/chmod > configure:4431: checking for md5sum > configure:4449: found /usr/bin/md5sum > configure:4461: result: /usr/bin/md5sum > configure:4525: checking for wget > configure:4543: found /usr/bin/wget > configure:4555: result: /usr/bin/wget > configure:4619: checking for zip > configure:4637: found /usr/bin/zip > configure:4649: result: /usr/bin/zip > configure:4713: checking for unzip > configure:4731: found /usr/bin/unzip > configure:4743: result: /usr/bin/unzip > configure:4807: checking for cpio > configure:4825: found /bin/cpio > configure:4837: result: /bin/cpio > configure:4901: checking for file > configure:4919: found /usr/bin/file > configure:4931: result: /usr/bin/file > configure:4997: checking for fastjar > configure:5013: found /usr/bin/fastjar > configure:5023: result: fastjar > configure:5087: checking for gawk > configure:5105: found /bin/gawk > configure:5117: result: /bin/gawk > configure:5182: checking for hg > configure:5200: found /usr/bin/hg > configure:5212: result: /usr/bin/hg > configure:5227: checking for an OpenJDK source directory > configure:5243: result: /jck/icedtea6-1.7/openjdk > configure:5266: checking for IcedTea Mercurial revision ID > configure:5271: result: r11ee55e1c9b4 > configure:5274: checking for JDK Mercurial revision ID > configure:5279: result: none > configure:5282: checking for HotSpot Mercurial revision ID > configure:5287: result: none > configure:5367: checking for lsb_release > configure:5385: found /usr/bin/lsb_release > configure:5397: result: /usr/bin/lsb_release > configure:5410: checking whether to compile ecj natively > configure:5424: result: no > configure:5519: checking which HotSpot build to use > configure:5538: result: original > configure:5597: checking for linux32 > configure:5615: found /usr/bin/linux32 > configure:5627: result: /usr/bin/linux32 > configure:5640: checking version of GCC > configure:5655: result: 4.1.2 (major version 4, minor version 1) > configure:5659: checking for an existing OpenJDK installation > configure:5707: result: /usr/lib/jvm/java-openjdk > configure:5758: checking for getconf > configure:5776: found /usr/bin/getconf > configure:5788: result: /usr/bin/getconf > configure:5807: checking the number of online processors > configure:5820: result: 8 > configure:5826: checking how many parallel build jobs to execute > configure:5846: result: 2 > configure:5851: checking if a PaX-enabled kernel is running > configure:5864: result: no > configure:5878: checking for a NetBeans installation > configure:5897: result: /usr/share/netbeans > configure:5901: checking for an Ant home directory > configure:5921: result: /usr/share/ant > configure:5924: checking whether to build VisualVM > configure:5943: result: no > configure:5946: checking whether to include PulseAudio support > configure:5965: result: no > configure:5968: checking whether to build documentation > configure:5987: result: yes > configure:5991: checking whether to enable experimental OpenJDK cross-compilation support > configure:6010: result: no > configure:6013: checking whether to include the XRender pipeline > configure:6032: result: yes > configure:6035: checking whether to include NIO2 support > configure:6054: result: no > configure:6057: checking whether to include SystemTap tracing support > configure:6076: result: no > configure:6079: checking whether to include the NSS-based security provider > configure:6098: result: no > configure:6102: checking for distribution package version > configure:6118: result: none > configure:6134: checking build identification > configure:6148: result: Built on Red Hat Enterprise Linux Server release 5.4 (Tikanga) (Fri Oct 15 17:42:53 CEST 2010) > configure:8065: checking whether to include Javascript support via Rhino > configure:8113: result: no > configure:8131: checking for an OpenJDK source zip > configure:8165: result: not specified > configure:8170: checking for a HotSpot source zip > configure:8204: result: not specified > configure:8209: checking for an OpenJDK source directory > configure:8225: result: /jck/icedtea6-1.7/openjdk > configure:8242: checking for an alternate jar command > configure:8276: result: not specified > configure:8281: checking whether to use CACAO as VM > configure:8295: result: no > configure:8310: checking for a CACAO home directory > configure:8351: result: $(abs_top_builddir)/cacao/install > configure:8356: checking for a CACAO source zip > configure:8390: result: not specified > configure:8395: checking for a CACAO source directory > configure:8429: result: not specified > configure:8434: checking whether to disable optimizations and build with -O0 -g > configure:8454: result: no > configure:8468: checking whether to use the Shark JIT > configure:8489: result: no > configure:8509: checking how to run the C preprocessor > configure:8544: gcc -E conftest.c > configure:8550: $? = 0 > configure:8582: gcc -E conftest.c > conftest.c:14:28: error: ac_nonexistent.h: No such file or directory > configure:8588: $? = 1 > configure: failed program was: > | /* confdefs.h. */ > | > | #define PACKAGE_NAME "icedtea6" > | #define PACKAGE_TARNAME "icedtea6" > | #define PACKAGE_VERSION "1.7.5" > | #define PACKAGE_STRING "icedtea6 1.7.5" > | #define PACKAGE_BUGREPORT "distro-pkg-dev at openjdk.java.net" > | #define PACKAGE "icedtea6" > | #define VERSION "1.7.5" > | #ifdef __cplusplus > | extern "C" void std::exit (int) throw (); using std::exit; > | #endif > | /* end confdefs.h. */ > | #include > configure:8627: result: gcc -E > configure:8651: gcc -E conftest.c > configure:8657: $? = 0 > configure:8689: gcc -E conftest.c > conftest.c:14:28: error: ac_nonexistent.h: No such file or directory > configure:8695: $? = 1 > configure: failed program was: > | /* confdefs.h. */ > | > | #define PACKAGE_NAME "icedtea6" > | #define PACKAGE_TARNAME "icedtea6" > | #define PACKAGE_VERSION "1.7.5" > | #define PACKAGE_STRING "icedtea6 1.7.5" > | #define PACKAGE_BUGREPORT "distro-pkg-dev at openjdk.java.net" > | #define PACKAGE "icedtea6" > | #define VERSION "1.7.5" > | #ifdef __cplusplus > | extern "C" void std::exit (int) throw (); using std::exit; > | #endif > | /* end confdefs.h. */ > | #include > configure:8739: checking for egrep > configure:8749: result: grep -E > configure:8754: checking for ANSI C header files > configure:8779: gcc -c -g -O2 conftest.c >&5 > configure:8785: $? = 0 > configure:8789: test -z > || test ! -s conftest.err > configure:8792: $? = 0 > configure:8795: test -s conftest.o > configure:8798: $? = 0 > configure:8887: gcc -o conftest -g -O2 conftest.c >&5 > conftest.c: In function 'main': > conftest.c:31: warning: incompatible implicit declaration of built-in function 'exit' > configure:8890: $? = 0 > configure:8892: ./conftest > configure:8895: $? = 0 > configure:8910: result: yes > configure:8934: checking for sys/types.h > configure:8950: gcc -c -g -O2 conftest.c >&5 > configure:8956: $? = 0 > configure:8960: test -z > || test ! -s conftest.err > configure:8963: $? = 0 > configure:8966: test -s conftest.o > configure:8969: $? = 0 > configure:8980: result: yes > configure:8934: checking for sys/stat.h > configure:8950: gcc -c -g -O2 conftest.c >&5 > configure:8956: $? = 0 > configure:8960: test -z > || test ! -s conftest.err > configure:8963: $? = 0 > configure:8966: test -s conftest.o > configure:8969: $? = 0 > configure:8980: result: yes > configure:8934: checking for stdlib.h > configure:8950: gcc -c -g -O2 conftest.c >&5 > configure:8956: $? = 0 > configure:8960: test -z > || test ! -s conftest.err > configure:8963: $? = 0 > configure:8966: test -s conftest.o > configure:8969: $? = 0 > configure:8980: result: yes > configure:8934: checking for string.h > configure:8950: gcc -c -g -O2 conftest.c >&5 > configure:8956: $? = 0 > configure:8960: test -z > || test ! -s conftest.err > configure:8963: $? = 0 > configure:8966: test -s conftest.o > configure:8969: $? = 0 > configure:8980: result: yes > configure:8934: checking for memory.h > configure:8950: gcc -c -g -O2 conftest.c >&5 > configure:8956: $? = 0 > configure:8960: test -z > || test ! -s conftest.err > configure:8963: $? = 0 > configure:8966: test -s conftest.o > configure:8969: $? = 0 > configure:8980: result: yes > configure:8934: checking for strings.h > configure:8950: gcc -c -g -O2 conftest.c >&5 > configure:8956: $? = 0 > configure:8960: test -z > || test ! -s conftest.err > configure:8963: $? = 0 > configure:8966: test -s conftest.o > configure:8969: $? = 0 > configure:8980: result: yes > configure:8934: checking for inttypes.h > configure:8950: gcc -c -g -O2 conftest.c >&5 > configure:8956: $? = 0 > configure:8960: test -z > || test ! -s conftest.err > configure:8963: $? = 0 > configure:8966: test -s conftest.o > configure:8969: $? = 0 > configure:8980: result: yes > configure:8934: checking for stdint.h > configure:8950: gcc -c -g -O2 conftest.c >&5 > configure:8956: $? = 0 > configure:8960: test -z > || test ! -s conftest.err > configure:8963: $? = 0 > configure:8966: test -s conftest.o > configure:8969: $? = 0 > configure:8980: result: yes > configure:8934: checking for unistd.h > configure:8950: gcc -c -g -O2 conftest.c >&5 > configure:8956: $? = 0 > configure:8960: test -z > || test ! -s conftest.err > configure:8963: $? = 0 > configure:8966: test -s conftest.o > configure:8969: $? = 0 > configure:8980: result: yes > configure:8994: checking whether to use the zero-assembler port > configure:9030: result: no > configure:9468: checking whether byte ordering is bigendian > configure:9495: gcc -c -g -O2 conftest.c >&5 > configure:9501: $? = 0 > configure:9505: test -z > || test ! -s conftest.err > configure:9508: $? = 0 > configure:9511: test -s conftest.o > configure:9514: $? = 0 > configure:9538: gcc -c -g -O2 conftest.c >&5 > conftest.c: In function 'main': > conftest.c:31: error: 'not' undeclared (first use in this function) > conftest.c:31: error: (Each undeclared identifier is reported only once > conftest.c:31: error: for each function it appears in.) > conftest.c:31: error: expected ';' before 'big' > configure:9544: $? = 1 > configure: failed program was: > | /* confdefs.h. */ > | > | #define PACKAGE_NAME "icedtea6" > | #define PACKAGE_TARNAME "icedtea6" > | #define PACKAGE_VERSION "1.7.5" > | #define PACKAGE_STRING "icedtea6 1.7.5" > | #define PACKAGE_BUGREPORT "distro-pkg-dev at openjdk.java.net" > | #define PACKAGE "icedtea6" > | #define VERSION "1.7.5" > | #ifdef __cplusplus > | extern "C" void std::exit (int) throw (); using std::exit; > | #endif > | #define STDC_HEADERS 1 > | #define HAVE_SYS_TYPES_H 1 > | #define HAVE_SYS_STAT_H 1 > | #define HAVE_STDLIB_H 1 > | #define HAVE_STRING_H 1 > | #define HAVE_MEMORY_H 1 > | #define HAVE_STRINGS_H 1 > | #define HAVE_INTTYPES_H 1 > | #define HAVE_STDINT_H 1 > | #define HAVE_UNISTD_H 1 > | /* end confdefs.h. */ > | #include > | #include > | > | int > | main () > | { > | #if BYTE_ORDER != BIG_ENDIAN > | not big endian > | #endif > | > | ; > | return 0; > | } > configure:9679: result: no > configure:9732: checking for additional virtual machines to build > configure:9757: result: none > configure:9828: checking whether to retrieve the source code from Mercurial > configure:9848: result: no > configure:9862: checking which Mercurial revision to use > configure:9876: result: tip > configure:9893: checking whether to build the old browser plugin > configure:9902: result: no > configure:9910: checking whether to build the new browser plugin based on npruntime > configure:9919: result: no > configure:9970: checking for pkg-config > configure:9988: found /usr/bin/pkg-config > configure:10000: result: /usr/bin/pkg-config > configure:10015: checking pkg-config is at least version 0.9.0 > configure:10018: result: yes > configure:10562: checking which Java timezone data directory to use > configure:10589: result: /usr/share/javazi > configure:10740: checking cups/cups.h usability > configure:10752: gcc -c -g -O2 conftest.c >&5 > configure:10758: $? = 0 > configure:10762: test -z > || test ! -s conftest.err > configure:10765: $? = 0 > configure:10768: test -s conftest.o > configure:10771: $? = 0 > configure:10781: result: yes > configure:10785: checking cups/cups.h presence > configure:10795: gcc -E conftest.c > configure:10801: $? = 0 > configure:10821: result: yes > configure:10856: checking for cups/cups.h > configure:10863: result: yes > configure:10740: checking cups/ppd.h usability > configure:10752: gcc -c -g -O2 conftest.c >&5 > configure:10758: $? = 0 > configure:10762: test -z > || test ! -s conftest.err > configure:10765: $? = 0 > configure:10768: test -s conftest.o > configure:10771: $? = 0 > configure:10781: result: yes > configure:10785: checking cups/ppd.h presence > configure:10795: gcc -E conftest.c > configure:10801: $? = 0 > configure:10821: result: yes > configure:10856: checking for cups/ppd.h > configure:10863: result: yes > configure:10897: checking X11/X.h usability > configure:10909: gcc -c -g -O2 conftest.c >&5 > configure:10915: $? = 0 > configure:10919: test -z > || test ! -s conftest.err > configure:10922: $? = 0 > configure:10925: test -s conftest.o > configure:10928: $? = 0 > configure:10938: result: yes > configure:10942: checking X11/X.h presence > configure:10952: gcc -E conftest.c > configure:10958: $? = 0 > configure:10978: result: yes > configure:11013: checking for X11/X.h > configure:11020: result: yes > configure:11041: checking for main in -ljpeg > configure:11065: gcc -o conftest -g -O2 conftest.c -ljpeg >&5 > configure:11071: $? = 0 > configure:11075: test -z > || test ! -s conftest.err > configure:11078: $? = 0 > configure:11081: test -s conftest > configure:11084: $? = 0 > configure:11097: result: yes > configure:11113: checking for main in -lgif > configure:11137: gcc -o conftest -g -O2 conftest.c -lgif -ljpeg >&5 > configure:11143: $? = 0 > configure:11147: test -z > || test ! -s conftest.err > configure:11150: $? = 0 > configure:11153: test -s conftest > configure:11156: $? = 0 > configure:11169: result: yes > configure:11185: checking for main in -lz > configure:11209: gcc -o conftest -g -O2 conftest.c -lz -lgif -ljpeg >&5 > configure:11215: $? = 0 > configure:11219: test -z > || test ! -s conftest.err > configure:11222: $? = 0 > configure:11225: test -s conftest > configure:11228: $? = 0 > configure:11241: result: yes > configure:11259: checking for XPROTO > configure:11267: $PKG_CONFIG --exists --print-errors "xproto" > configure:11270: $? = 0 > configure:11285: $PKG_CONFIG --exists --print-errors "xproto" > configure:11288: $? = 0 > configure:11324: result: yes > configure:11341: checking for XT > configure:11349: $PKG_CONFIG --exists --print-errors "xt" > configure:11352: $? = 0 > configure:11367: $PKG_CONFIG --exists --print-errors "xt" > configure:11370: $? = 0 > configure:11406: result: yes > configure:11423: checking for XP > configure:11431: $PKG_CONFIG --exists --print-errors "xp" > configure:11434: $? = 0 > configure:11449: $PKG_CONFIG --exists --print-errors "xp" > configure:11452: $? = 0 > configure:11488: result: yes > configure:11505: checking for X11 > configure:11513: $PKG_CONFIG --exists --print-errors "x11" > configure:11516: $? = 0 > configure:11531: $PKG_CONFIG --exists --print-errors "x11" > configure:11534: $? = 0 > configure:11570: result: yes > configure:11587: checking for XINERAMA > configure:11595: $PKG_CONFIG --exists --print-errors "xinerama" > configure:11598: $? = 0 > configure:11613: $PKG_CONFIG --exists --print-errors "xinerama" > configure:11616: $? = 0 > configure:11652: result: yes > configure:11672: checking for XRENDER > configure:11680: $PKG_CONFIG --exists --print-errors "xrender" > configure:11683: $? = 0 > configure:11698: $PKG_CONFIG --exists --print-errors "xrender" > configure:11701: $? = 0 > configure:11737: result: yes > configure:12028: checking for LIBPNG > configure:12036: $PKG_CONFIG --exists --print-errors "libpng" > configure:12039: $? = 0 > configure:12054: $PKG_CONFIG --exists --print-errors "libpng" > configure:12057: $? = 0 > configure:12093: result: yes > configure:12111: checking for XTST > configure:12119: $PKG_CONFIG --exists --print-errors "xtst" > configure:12122: $? = 0 > configure:12137: $PKG_CONFIG --exists --print-errors "xtst" > configure:12140: $? = 0 > configure:12176: result: yes > configure:12193: checking for FREETYPE2 > configure:12201: $PKG_CONFIG --exists --print-errors "freetype2" > configure:12204: $? = 0 > configure:12219: $PKG_CONFIG --exists --print-errors "freetype2" > configure:12222: $? = 0 > configure:12258: result: yes > configure:12278: checking for ALSA > configure:12286: $PKG_CONFIG --exists --print-errors "alsa" > configure:12289: $? = 0 > configure:12304: $PKG_CONFIG --exists --print-errors "alsa" > configure:12307: $? = 0 > configure:12343: result: yes > configure:13480: creating ./config.status > > ## ---------------------- ## > ## Running config.status. ## > ## ---------------------- ## > > This file was extended by icedtea6 config.status 1.7.5, which was > generated by GNU Autoconf 2.59. Invocation command line was > > CONFIG_FILES = > CONFIG_HEADERS = > CONFIG_LINKS = > CONFIG_COMMANDS = > $ ./config.status > > on dell-r210-09.mw.lab.eng.brq.redhat.com > > config.status:915: creating Makefile > config.status:915: creating jvm.cfg > config.status:915: creating ergo.c > config.status:915: creating tz.properties > config.status:1103: executing depfiles commands > > ## ---------------- ## > ## Cache variables. ## > ## ---------------- ## > > ac_cv_build=x86_64-unknown-linux-gnu > ac_cv_build_alias=x86_64-unknown-linux-gnu > ac_cv_c_bigendian=no > ac_cv_c_compiler_gnu=yes > ac_cv_cxx_compiler_gnu=yes > ac_cv_env_ALSA_CFLAGS_set= > ac_cv_env_ALSA_CFLAGS_value= > ac_cv_env_ALSA_LIBS_set= > ac_cv_env_ALSA_LIBS_value= > ac_cv_env_CC_set= > ac_cv_env_CC_value= > ac_cv_env_CFLAGS_set= > ac_cv_env_CFLAGS_value= > ac_cv_env_CPPFLAGS_set= > ac_cv_env_CPPFLAGS_value= > ac_cv_env_CPP_set= > ac_cv_env_CPP_value= > ac_cv_env_CXXFLAGS_set= > ac_cv_env_CXXFLAGS_value= > ac_cv_env_CXX_set= > ac_cv_env_CXX_value= > ac_cv_env_FREETYPE2_CFLAGS_set= > ac_cv_env_FREETYPE2_CFLAGS_value= > ac_cv_env_FREETYPE2_LIBS_set= > ac_cv_env_FREETYPE2_LIBS_value= > ac_cv_env_GLIB_CFLAGS_set= > ac_cv_env_GLIB_CFLAGS_value= > ac_cv_env_GLIB_LIBS_set= > ac_cv_env_GLIB_LIBS_value= > ac_cv_env_GTK_CFLAGS_set= > ac_cv_env_GTK_CFLAGS_value= > ac_cv_env_GTK_LIBS_set= > ac_cv_env_GTK_LIBS_value= > ac_cv_env_LDFLAGS_set= > ac_cv_env_LDFLAGS_value= > ac_cv_env_LIBFFI_CFLAGS_set= > ac_cv_env_LIBFFI_CFLAGS_value= > ac_cv_env_LIBFFI_LIBS_set= > ac_cv_env_LIBFFI_LIBS_value= > ac_cv_env_LIBPNG_CFLAGS_set= > ac_cv_env_LIBPNG_CFLAGS_value= > ac_cv_env_LIBPNG_LIBS_set= > ac_cv_env_LIBPNG_LIBS_value= > ac_cv_env_LIBPULSE_CFLAGS_set= > ac_cv_env_LIBPULSE_CFLAGS_value= > ac_cv_env_LIBPULSE_LIBS_set= > ac_cv_env_LIBPULSE_LIBS_value= > ac_cv_env_MOZILLA_CFLAGS_set= > ac_cv_env_MOZILLA_CFLAGS_value= > ac_cv_env_MOZILLA_LIBS_set= > ac_cv_env_MOZILLA_LIBS_value= > ac_cv_env_NSS_CFLAGS_set= > ac_cv_env_NSS_CFLAGS_value= > ac_cv_env_NSS_LIBS_set= > ac_cv_env_NSS_LIBS_value= > ac_cv_env_PKG_CONFIG_set= > ac_cv_env_PKG_CONFIG_value= > ac_cv_env_X11_CFLAGS_set= > ac_cv_env_X11_CFLAGS_value= > ac_cv_env_X11_LIBS_set= > ac_cv_env_X11_LIBS_value= > ac_cv_env_XINERAMA_CFLAGS_set= > ac_cv_env_XINERAMA_CFLAGS_value= > ac_cv_env_XINERAMA_LIBS_set= > ac_cv_env_XINERAMA_LIBS_value= > ac_cv_env_XPROTO_CFLAGS_set= > ac_cv_env_XPROTO_CFLAGS_value= > ac_cv_env_XPROTO_LIBS_set= > ac_cv_env_XPROTO_LIBS_value= > ac_cv_env_XP_CFLAGS_set= > ac_cv_env_XP_CFLAGS_value= > ac_cv_env_XP_LIBS_set= > ac_cv_env_XP_LIBS_value= > ac_cv_env_XRENDER_CFLAGS_set= > ac_cv_env_XRENDER_CFLAGS_value= > ac_cv_env_XRENDER_LIBS_set= > ac_cv_env_XRENDER_LIBS_value= > ac_cv_env_XTST_CFLAGS_set= > ac_cv_env_XTST_CFLAGS_value= > ac_cv_env_XTST_LIBS_set= > ac_cv_env_XTST_LIBS_value= > ac_cv_env_XT_CFLAGS_set= > ac_cv_env_XT_CFLAGS_value= > ac_cv_env_XT_LIBS_set= > ac_cv_env_XT_LIBS_value= > ac_cv_env_build_alias_set= > ac_cv_env_build_alias_value= > ac_cv_env_host_alias_set= > ac_cv_env_host_alias_value= > ac_cv_env_target_alias_set= > ac_cv_env_target_alias_value= > ac_cv_exeext= > ac_cv_header_X11_X_h=yes > ac_cv_header_cups_cups_h=yes > ac_cv_header_cups_ppd_h=yes > ac_cv_header_inttypes_h=yes > ac_cv_header_memory_h=yes > ac_cv_header_stdc=yes > ac_cv_header_stdint_h=yes > ac_cv_header_stdlib_h=yes > ac_cv_header_string_h=yes > ac_cv_header_strings_h=yes > ac_cv_header_sys_stat_h=yes > ac_cv_header_sys_types_h=yes > ac_cv_header_unistd_h=yes > ac_cv_host=x86_64-unknown-linux-gnu > ac_cv_host_alias=x86_64-unknown-linux-gnu > ac_cv_lib_gif_main=yes > ac_cv_lib_jpeg_main=yes > ac_cv_lib_z_main=yes > ac_cv_objext=o > ac_cv_path_ac_pt_ANT=/usr/bin/ant > ac_cv_path_ac_pt_CHMOD=/bin/chmod > ac_cv_path_ac_pt_CPIO=/bin/cpio > ac_cv_path_ac_pt_FILE=/usr/bin/file > ac_cv_path_ac_pt_FIND=/usr/bin/find > ac_cv_path_ac_pt_GAWK=/bin/gawk > ac_cv_path_ac_pt_GETCONF=/usr/bin/getconf > ac_cv_path_ac_pt_GZIP=/bin/gzip > ac_cv_path_ac_pt_HG=/usr/bin/hg > ac_cv_path_ac_pt_LINUX32=/usr/bin/linux32 > ac_cv_path_ac_pt_LSB_RELEASE=/usr/bin/lsb_release > ac_cv_path_ac_pt_MAKE=/usr/bin/make > ac_cv_path_ac_pt_MD5SUM=/usr/bin/md5sum > ac_cv_path_ac_pt_PATCH=/usr/bin/patch > ac_cv_path_ac_pt_PKG_CONFIG=/usr/bin/pkg-config > ac_cv_path_ac_pt_TAR=/bin/tar > ac_cv_path_ac_pt_UNZIP=/usr/bin/unzip > ac_cv_path_ac_pt_WGET=/usr/bin/wget > ac_cv_path_ac_pt_ZIP=/usr/bin/zip > ac_cv_path_install='/usr/bin/install -c' > ac_cv_prog_AWK=gawk > ac_cv_prog_CPP='gcc -E' > ac_cv_prog_ac_ct_CC=gcc > ac_cv_prog_ac_ct_CXX=g++ > ac_cv_prog_ac_ct_FASTJAR=fastjar > ac_cv_prog_cc_g=yes > ac_cv_prog_cc_stdc= > ac_cv_prog_cxx_g=yes > ac_cv_prog_egrep='grep -E' > ac_cv_prog_make_make_set=yes > am_cv_CC_dependencies_compiler_type=none > am_cv_CXX_dependencies_compiler_type=none > am_cv_prog_tar_pax=gnutar > it_cv_pax=no > it_cv_proc=8 > pkg_cv_ALSA_CFLAGS='-I/usr/include/alsa ' > pkg_cv_ALSA_LIBS='-lasound ' > pkg_cv_FREETYPE2_CFLAGS='-I/usr/include/freetype2 ' > pkg_cv_FREETYPE2_LIBS='-lfreetype ' > pkg_cv_LIBPNG_CFLAGS='-I/usr/include/libpng12 ' > pkg_cv_LIBPNG_LIBS='-lpng12 ' > pkg_cv_X11_CFLAGS=' ' > pkg_cv_X11_LIBS='-lX11 ' > pkg_cv_XINERAMA_CFLAGS=' ' > pkg_cv_XINERAMA_LIBS='-lXinerama ' > pkg_cv_XPROTO_CFLAGS=' ' > pkg_cv_XPROTO_LIBS=' ' > pkg_cv_XP_CFLAGS=' ' > pkg_cv_XP_LIBS='-lXp -lXau ' > pkg_cv_XRENDER_CFLAGS=' ' > pkg_cv_XRENDER_LIBS='-lXrender -lX11 ' > pkg_cv_XTST_CFLAGS=' ' > pkg_cv_XTST_LIBS='-lXtst ' > pkg_cv_XT_CFLAGS=' ' > pkg_cv_XT_LIBS='-lXt -lX11 ' > > ## ----------------- ## > ## Output variables. ## > ## ----------------- ## > > ABS_CLIENT_LIBJVM_SO='' > ABS_JAVA_HOME_DIR='' > ABS_SERVER_LIBJVM_SO='' > ACLOCAL='${SHELL} /jck/icedtea6-1.7/missing --run aclocal-1.9' > ADD_CACAO_BUILD_FALSE='' > ADD_CACAO_BUILD_TRUE='#' > ADD_SHARK_BUILD_FALSE='' > ADD_SHARK_BUILD_TRUE='#' > ADD_ZERO_BUILD_FALSE='' > ADD_ZERO_BUILD_TRUE='#' > ALSA_CFLAGS='-I/usr/include/alsa ' > ALSA_LIBS='-lasound ' > ALT_CACAO_SRC_DIR='not specified' > ALT_CACAO_SRC_ZIP='not specified' > ALT_HOTSPOT_SRC_ZIP='not specified' > ALT_JAR_CMD='not specified' > ALT_OPENJDK_SRC_ZIP='not specified' > AMDEPBACKSLASH='\' > AMDEP_FALSE='#' > AMDEP_TRUE='' > AMTAR='${SHELL} /jck/icedtea6-1.7/missing --run tar' > ANT='/usr/bin/ant' > ARCH_PREFIX='' > AUTOCONF='${SHELL} /jck/icedtea6-1.7/missing --run autoconf' > AUTOHEADER='${SHELL} /jck/icedtea6-1.7/missing --run autoheader' > AUTOMAKE='${SHELL} /jck/icedtea6-1.7/missing --run automake-1.9' > AWK='gawk' > BUILD_ARCH_DIR='amd64' > BUILD_CACAO_FALSE='' > BUILD_CACAO_TRUE='#' > BUILD_OS_DIR='linux' > CACAO_IMPORT_PATH='$(abs_top_builddir)/cacao/install' > CC='gcc' > CCDEPMODE='depmode=none' > CFLAGS='-g -O2' > CHMOD='/bin/chmod' > CONFIGURE_ARGS=''--with-openjdk' '--without-rhino' '--disable-plugin' '--disable-npplugin'' > CPIO='/bin/cpio' > CPP='gcc -E' > CPPFLAGS='' > CROSS_TARGET_ARCH='x86_64' > CXX='g++' > CXXDEPMODE='depmode=none' > CXXFLAGS='-g -O2' > CYGPATH_W='echo' > DEFS='-DPACKAGE_NAME=\"icedtea6\" -DPACKAGE_TARNAME=\"icedtea6\" -DPACKAGE_VERSION=\"1.7.5\" -DPACKAGE_STRING=\"icedtea6\ 1.7.5\" -DPACKAGE_BUGREPORT=\"distro-pkg-dev at openjdk.java.net\" -DPACKAGE=\"icedtea6\" -DVERSION=\"1.7.5\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_CUPS_CUPS_H=1 -DHAVE_CUPS_PPD_H=1 -DHAVE_X11_X_H=1 -DHAVE_LIBJPEG=1 -DHAVE_LIBGIF=1 -DHAVE_LIBZ=1 ' > DEPDIR='.deps' > DISABLE_OPTIMIZATIONS_FALSE='' > DISABLE_OPTIMIZATIONS_TRUE='#' > DIST_ID='Built on Red Hat Enterprise Linux Server release 5.4 (Tikanga) (Fri Oct 15 17:42:53 CEST 2010)' > DIST_NAME='RedHatEnterpriseServer' > ECHO_C='' > ECHO_N='-n' > ECHO_T='' > ECJ='' > ECJ_JAR='' > EGREP='grep -E' > ENABLE_CROSS_COMPILATION_FALSE='' > ENABLE_CROSS_COMPILATION_TRUE='#' > ENABLE_DOCS_FALSE='#' > ENABLE_DOCS_TRUE='' > ENABLE_NIO2_FALSE='' > ENABLE_NIO2_TRUE='#' > ENABLE_NPPLUGIN_FALSE='' > ENABLE_NPPLUGIN_TRUE='#' > ENABLE_NSS_FALSE='' > ENABLE_NSS_TRUE='#' > ENABLE_PLUGIN_FALSE='' > ENABLE_PLUGIN_TRUE='#' > ENABLE_PULSE_JAVA_FALSE='' > ENABLE_PULSE_JAVA_TRUE='#' > ENABLE_SYSTEMTAP_FALSE='' > ENABLE_SYSTEMTAP_TRUE='#' > ENABLE_XRENDER_FALSE='#' > ENABLE_XRENDER_TRUE='' > EXEEXT='' > FASTJAR='fastjar' > FILE='/usr/bin/file' > FIND='/usr/bin/find' > FREETYPE2_CFLAGS='-I/usr/include/freetype2 ' > FREETYPE2_LIBS='-lfreetype ' > GAWK='/bin/gawk' > GCC_OLD_FALSE='' > GCC_OLD_TRUE='#' > GCJ='no' > GETCONF='/usr/bin/getconf' > GLIB_CFLAGS='' > GLIB_LIBS='' > GTK_CFLAGS='' > GTK_LIBS='' > GZIP='/bin/gzip' > HAS_HOTSPOT_REVISION_FALSE='' > HAS_HOTSPOT_REVISION_TRUE='#' > HAS_ICEDTEA_REVISION_FALSE='#' > HAS_ICEDTEA_REVISION_TRUE='' > HAS_JDK_REVISION_FALSE='' > HAS_JDK_REVISION_TRUE='#' > HAS_PAX_FALSE='' > HAS_PAX_TRUE='#' > HAS_PKGVERSION_FALSE='' > HAS_PKGVERSION_TRUE='#' > HG='/usr/bin/hg' > HGREV='' > HOTSPOT_REVISION='none' > HSBUILD='original' > ICEDTEA_REVISION='r11ee55e1c9b4' > INSTALL_ARCH_DIR='amd64' > INSTALL_DATA='${INSTALL} -m 644' > INSTALL_PROGRAM='${INSTALL}' > INSTALL_SCRIPT='${INSTALL}' > INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s' > JAR='/usr/lib/jvm/java-openjdk/bin/jar' > JAR_ACCEPTS_STDIN_LIST='' > JAR_KNOWS_ATFILE='' > JAR_KNOWS_J_OPTIONS='' > JAVA='/usr/lib/jvm/java-openjdk/bin/java' > JAVAC='/usr/lib/jvm/java-openjdk/bin/javac' > JAVAH='/usr/lib/jvm/java-openjdk/bin/javah' > JDK_REVISION='none' > JRE_ARCH_DIR='amd64' > LDFLAGS='' > LIBFFI_CFLAGS='' > LIBFFI_LIBS='' > LIBOBJS='' > LIBPNG_CFLAGS='-I/usr/include/libpng12 ' > LIBPNG_LIBS='-lpng12 ' > LIBPULSE_CFLAGS='' > LIBPULSE_LIBS='' > LIBS='-lz -lgif -ljpeg ' > LINUX32='/usr/bin/linux32' > LLVM_CFLAGS='' > LLVM_CONFIG='' > LLVM_LDFLAGS='' > LLVM_LIBS='' > LSB_RELEASE='/usr/bin/lsb_release' > LTLIBOBJS='' > MAKE='/usr/bin/make' > MAKEINFO='${SHELL} /jck/icedtea6-1.7/missing --run makeinfo' > MD5SUM='/usr/bin/md5sum' > MOZILLA_CFLAGS='' > MOZILLA_LIBS='' > MOZILLA_VERSION_COLLAPSED='' > NETBEANS='' > NSS_CFLAGS='' > NSS_LIBDIR='' > NSS_LIBS='' > OBJEXT='o' > OPENJDK_SRC_DIR='/jck/icedtea6-1.7/openjdk' > OPENJDK_SRC_DIR_FOUND_FALSE='' > OPENJDK_SRC_DIR_FOUND_TRUE='#' > OS_PATH='' > PACKAGE='icedtea6' > PACKAGE_BUGREPORT='distro-pkg-dev at openjdk.java.net' > PACKAGE_NAME='icedtea6' > PACKAGE_STRING='icedtea6 1.7.5' > PACKAGE_TARNAME='icedtea6' > PACKAGE_VERSION='1.7.5' > PARALLEL_JOBS='2' > PATCH='/usr/bin/patch' > PATH_SEPARATOR=':' > PKGVERSION='none' > PKG_CONFIG='/usr/bin/pkg-config' > RHINO_JAR='' > RMIC='/usr/lib/jvm/java-openjdk/bin/rmic' > SET_MAKE='' > SHARK_BUILD_FALSE='' > SHARK_BUILD_TRUE='#' > SHELL='/bin/sh' > STRIP='' > SYSTEM_ANT_DIR='/usr/share/ant' > SYSTEM_GCJ_DIR='' > SYSTEM_NETBEANS_DIR='/usr/share/netbeans' > SYSTEM_OPENJDK_DIR='/usr/lib/jvm/java-openjdk' > TAR='/bin/tar' > TZDATA_DIR='/usr/share/javazi' > UNZIP='/usr/bin/unzip' > USE_ALT_CACAO_SRC_DIR_FALSE='' > USE_ALT_CACAO_SRC_DIR_TRUE='#' > USE_ALT_CACAO_SRC_ZIP_FALSE='' > USE_ALT_CACAO_SRC_ZIP_TRUE='#' > USE_ALT_HOTSPOT_SRC_ZIP_FALSE='' > USE_ALT_HOTSPOT_SRC_ZIP_TRUE='#' > USE_ALT_JAR_FALSE='' > USE_ALT_JAR_TRUE='#' > USE_ALT_OPENJDK_SRC_ZIP_FALSE='' > USE_ALT_OPENJDK_SRC_ZIP_TRUE='#' > USE_HG_FALSE='' > USE_HG_TRUE='#' > USE_SYSTEM_CACAO_FALSE='' > USE_SYSTEM_CACAO_TRUE='#' > VERSION='1.7.5' > WGET='/usr/bin/wget' > WITH_ALT_HSBUILD_FALSE='' > WITH_ALT_HSBUILD_TRUE='#' > WITH_CACAO='no' > WITH_CACAO_FALSE='' > WITH_CACAO_TRUE='#' > WITH_HGREV_FALSE='' > WITH_HGREV_TRUE='#' > WITH_OPENJDK_FALSE='#' > WITH_OPENJDK_TRUE='' > WITH_RHINO_FALSE='' > WITH_RHINO_TRUE='#' > WITH_TZDATA_DIR_FALSE='#' > WITH_TZDATA_DIR_TRUE='' > WITH_VISUALVM_FALSE='' > WITH_VISUALVM_TRUE='#' > X11_CFLAGS=' ' > X11_LIBS='-lX11 ' > XALAN2_JAR='' > XALAN2_SERIALIZER_JAR='' > XERCES2_JAR='' > XINERAMA_CFLAGS=' ' > XINERAMA_LIBS='-lXinerama ' > XPROTO_CFLAGS=' ' > XPROTO_LIBS=' ' > XP_CFLAGS=' ' > XP_LIBS='-lXp -lXau ' > XRENDER_CFLAGS=' ' > XRENDER_LIBS='-lXrender -lX11 ' > XTST_CFLAGS=' ' > XTST_LIBS='-lXtst ' > XT_CFLAGS=' ' > XT_LIBS='-lXt -lX11 ' > ZERO_ARCHDEF='AMD64' > ZERO_ARCHFLAG='-m64' > ZERO_BITSPERWORD='64' > ZERO_BUILD_FALSE='' > ZERO_BUILD_TRUE='#' > ZERO_ENDIANNESS='little' > ZERO_LIBARCH='amd64' > ZIP='/usr/bin/zip' > abs_top_builddir='/jck/icedtea6-1.7' > abs_top_srcdir='/jck/icedtea6-1.7' > ac_ct_CC='gcc' > ac_ct_CXX='g++' > ac_ct_FASTJAR='fastjar' > ac_ct_STRIP='' > ac_pt_ANT='/usr/bin/ant' > ac_pt_CHMOD='/bin/chmod' > ac_pt_CPIO='/bin/cpio' > ac_pt_FILE='/usr/bin/file' > ac_pt_FIND='/usr/bin/find' > ac_pt_GAWK='/bin/gawk' > ac_pt_GCJ='' > ac_pt_GETCONF='/usr/bin/getconf' > ac_pt_GZIP='/bin/gzip' > ac_pt_HG='/usr/bin/hg' > ac_pt_LINUX32='/usr/bin/linux32' > ac_pt_LLVM_CONFIG='' > ac_pt_LSB_RELEASE='/usr/bin/lsb_release' > ac_pt_MAKE='/usr/bin/make' > ac_pt_MD5SUM='/usr/bin/md5sum' > ac_pt_PATCH='/usr/bin/patch' > ac_pt_PKG_CONFIG='/usr/bin/pkg-config' > ac_pt_TAR='/bin/tar' > ac_pt_UNZIP='/usr/bin/unzip' > ac_pt_WGET='/usr/bin/wget' > ac_pt_ZIP='/usr/bin/zip' > am__fastdepCC_FALSE='' > am__fastdepCC_TRUE='#' > am__fastdepCXX_FALSE='' > am__fastdepCXX_TRUE='#' > am__include='include' > am__leading_dot='.' > am__quote='' > am__tar='tar --format=posix -chf - "$$tardir"' > am__untar='tar -xf -' > bindir='${exec_prefix}/bin' > build='x86_64-unknown-linux-gnu' > build_alias='' > build_cpu='x86_64' > build_os='linux-gnu' > build_vendor='unknown' > datadir='${prefix}/share' > exec_prefix='${prefix}' > host='x86_64-unknown-linux-gnu' > host_alias='' > host_cpu='x86_64' > host_os='linux-gnu' > host_vendor='unknown' > includedir='${prefix}/include' > infodir='${prefix}/info' > install_sh='/jck/icedtea6-1.7/install-sh' > libdir='${exec_prefix}/lib' > libexecdir='${exec_prefix}/libexec' > localstatedir='${prefix}/var' > mandir='${prefix}/man' > mkdir_p='mkdir -p --' > oldincludedir='/usr/include' > prefix='bootstrap' > program_transform_name='s,x,x,' > sbindir='${exec_prefix}/sbin' > sharedstatedir='${prefix}/com' > sysconfdir='${prefix}/etc' > target_alias='' > with_openjdk='true' > > ## ----------- ## > ## confdefs.h. ## > ## ----------- ## > > #define HAVE_CUPS_CUPS_H 1 > #define HAVE_CUPS_PPD_H 1 > #define HAVE_INTTYPES_H 1 > #define HAVE_LIBGIF 1 > #define HAVE_LIBJPEG 1 > #define HAVE_LIBZ 1 > #define HAVE_MEMORY_H 1 > #define HAVE_STDINT_H 1 > #define HAVE_STDLIB_H 1 > #define HAVE_STRINGS_H 1 > #define HAVE_STRING_H 1 > #define HAVE_SYS_STAT_H 1 > #define HAVE_SYS_TYPES_H 1 > #define HAVE_UNISTD_H 1 > #define HAVE_X11_X_H 1 > #define PACKAGE "icedtea6" > #define PACKAGE_BUGREPORT "distro-pkg-dev at openjdk.java.net" > #define PACKAGE_NAME "icedtea6" > #define PACKAGE_STRING "icedtea6 1.7.5" > #define PACKAGE_TARNAME "icedtea6" > #define PACKAGE_VERSION "1.7.5" > #define STDC_HEADERS 1 > #define VERSION "1.7.5" > #endif > #ifdef __cplusplus > extern "C" void std::exit (int) throw (); using std::exit; > > configure: exit 0 -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From andrew at icedtea.classpath.org Mon Oct 18 06:18:47 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Mon, 18 Oct 2010 13:18:47 +0000 Subject: /hg/release/icedtea6-1.7: 4 new changesets Message-ID: changeset cddb729bb087 in /hg/release/icedtea6-1.7 details: http://icedtea.classpath.org/hg/release/icedtea6-1.7?cmd=changeset;node=cddb729bb087 author: Andrew John Hughes date: Mon Oct 18 14:13:29 2010 +0100 Add missing javaws man page. changeset 6282308dea74 in /hg/release/icedtea6-1.7 details: http://icedtea.classpath.org/hg/release/icedtea6-1.7?cmd=changeset;node=6282308dea74 author: Andrew John Hughes date: Mon Oct 18 14:13:47 2010 +0100 Removed tag icedtea6-1.7.5 changeset eb34904f4061 in /hg/release/icedtea6-1.7 details: http://icedtea.classpath.org/hg/release/icedtea6-1.7?cmd=changeset;node=eb34904f4061 author: Andrew John Hughes date: Mon Oct 18 14:13:53 2010 +0100 Added tag icedtea6-1.7.5 for changeset 6282308dea74 changeset 902c6f336008 in /hg/release/icedtea6-1.7 details: http://icedtea.classpath.org/hg/release/icedtea6-1.7?cmd=changeset;node=902c6f336008 author: Andrew John Hughes date: Mon Oct 18 14:18:22 2010 +0100 Merge diffstat: 5 files changed, 152 insertions(+), 2 deletions(-) .hgtags | 4 ChangeLog | 8 + Makefile.am | 3 patches/openjdk/6853592-badwindow-warning-fix.patch | 16 ++ rt/javaws.1 | 123 +++++++++++++++++++ diffs (193 lines): diff -r 11ee55e1c9b4 -r 902c6f336008 .hgtags --- a/.hgtags Wed Oct 13 01:27:29 2010 +0100 +++ b/.hgtags Mon Oct 18 14:18:22 2010 +0100 @@ -23,3 +23,7 @@ cf5e5cb5f1cd9aa7f3237e918504be6fa732fa26 cf5e5cb5f1cd9aa7f3237e918504be6fa732fa26 icedtea6-1.7.3 30dc9370bebaf7d7bed1f49ff220bcb75f3b2140 icedtea6-1.7.4 9f1417fbbb12374a1585da2c3265deb8c10d6ec6 icedtea6-1.7.5 +9f1417fbbb12374a1585da2c3265deb8c10d6ec6 icedtea6-1.7.5 +0000000000000000000000000000000000000000 icedtea6-1.7.5 +0000000000000000000000000000000000000000 icedtea6-1.7.5 +6282308dea7401c00bb779bd4ab2ff7f4d269114 icedtea6-1.7.5 diff -r 11ee55e1c9b4 -r 902c6f336008 ChangeLog --- a/ChangeLog Wed Oct 13 01:27:29 2010 +0100 +++ b/ChangeLog Mon Oct 18 14:18:22 2010 +0100 @@ -1,3 +1,9 @@ 2010-10-13 Andrew John Hughes + + * patches/openjdk/6853592-BadWindow-warning-fix.patch: + Added patch which fixes bug #6853592 introduced by another patch + 6678385-window_movement_crasher.patch + 2010-10-13 Andrew John Hughes * NEWS: @@ -17,7 +23,7 @@ 2010-09-13 Omair Majid diff -r 11ee55e1c9b4 -r 902c6f336008 Makefile.am --- a/Makefile.am Wed Oct 13 01:27:29 2010 +0100 +++ b/Makefile.am Mon Oct 18 14:18:22 2010 +0100 @@ -369,7 +369,8 @@ ICEDTEA_PATCHES = \ patches/fonts-rhel.patch \ patches/openjdk/6638712-wildcard_types.patch \ patches/openjdk/6650759-missing_inference.patch \ - patches/numa_on_early_glibc.patch + patches/numa_on_early_glibc.patch \ + patches/openjdk/6853592-badwindow-warning-fix.patch if WITH_ALT_HSBUILD ICEDTEA_PATCHES += patches/hotspot/$(HSBUILD)/openjdk-6886353-ignore_deoptimizealot.patch \ diff -r 11ee55e1c9b4 -r 902c6f336008 patches/openjdk/6853592-badwindow-warning-fix.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/6853592-badwindow-warning-fix.patch Mon Oct 18 14:18:22 2010 +0100 @@ -0,0 +1,16 @@ +--- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java 2010-07-15 10:28:21.896105637 -0400 ++++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java 2010-07-15 10:30:45.039232001 -0400 +@@ -298,13 +298,6 @@ + if (log.isLoggable(Level.FINE)) { + dumpPeers(); + } +- +- awtLock(); +- try { +- XlibWrapper.XSetErrorHandler(saved_error_handler); +- } finally { +- awtUnlock(); +- } + } + }); + } diff -r 11ee55e1c9b4 -r 902c6f336008 rt/javaws.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rt/javaws.1 Mon Oct 18 14:18:22 2010 +0100 @@ -0,0 +1,123 @@ +.TH javaws 1 "9 Sep 2010" +.SH NAME +javaws - a Java Web Start client +.SH SYNOPSYS +.B javaws +[-run-options] jnlp-file +.br +.B javaws +[-control-option] +.SH DESCRIPTION +.B javaws +is an implementation of a JNLP client. It uses a JNLP (Java Network +Launch Protocol) file to securely run a remote Java application or +a Java applet. This implementation of +.B javaws +is from the IcedTea project and is based on the NetX project. +.PP +A JNLP file is an xml file that describes how to securely run a +remote Java application or a Java applet. + +.SH OPTIONS +When specifying options, the name of the jnlp file must be the last +argument to +.B javaws +- all the options must preceede it. +.PP +The jnlp-file can either be a url or a local path. +.PP +.B Control Options +.PP +By default +.B javaws +will launch the jnlp file specified on the command line. The control +options can be used to change this behaviour. +.TP 12 +\-about +Shows a sample application that can be used to test the basic functionality +of this implementation. +.TP +\-viewer +Shows the trusted certificate viewer. This allows a user to list, examine, remove +or export trusted certificates. Note that this only reflects the certificates +trusted by +.B javaws +and not any other certificates or programs. + +.PP +.B Run Options +.PP +In the default mode, the following run-options can be used: +.TP 12 +\-basedir dir +Directory where the cache and certificates to be used are stored. +.TP +\-arg arg +Adds an application argument before launching. +.TP +\-param name=value +Adds an applet parameter before launching. +.TP +\-property name=value +Sets a system property before launching. +.TP +\-update seconds +Update check if seconds since last checked. +.TP +\-license +Display the GPL license and exit. +.TP +\-verbose +Enable verbose output. Very useful in debugging. +.TP +\-nosecurity +Disables the secure runtime environment. +.TP +\-noupdate +Disables checking for updates. +.TP +\-headless +Disables download window, other UIs. +.TP +\-strict +Enables strict checking of JNLP file format. Any deviations from +the JNLP DTD will cause +.B javaws +to abort. +.TP +\-umask=value +Sets the umask for files created by an application. +.TP +\-Xnofork +Do not create another JVM, even if the JNLP file asks for running in +a separate JVM. This is useful for debugging. +.TP +\-Jjava-option +This passes along java-option to the java binary that is running +javaws. For example, to make javaws run with a max heap size +of 80m, use -J-Xmx80m. +.TP +\-help +Print a help message and exit. + +.SH FILES +~/.netxrc specifies the location of the base directory + +.SH BUGS +There arent any known bugs. If you come across one, please file it at + http://icedtea.classpath.org/bugzilla/ +.br +Please run javaws in verbose mode and include that output along +with the jnlp file when filing out the bug report. + +.SH AUTHOR +Originally written by Jon. A. Maxwell. +.br +Currently maintained by the IcedTea contributors. + +.SH SEE ALSO +.BR java (1) +.br +http://icedtea.classpath.org/ +.br +http://jnlp.sourceforge.net/netx/ From bugzilla-daemon at icedtea.classpath.org Mon Oct 18 06:32:08 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 18 Oct 2010 13:32:08 +0000 Subject: [Bug 570] New: NetX depends on sun.applet.AppletViewPanel Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=570 Summary: NetX depends on sun.applet.AppletViewPanel Product: IcedTea Version: 6-hg Platform: all OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: NetX AssignedTo: unassigned at icedtea.classpath.org ReportedBy: gnu_andrew at member.fsf.org OtherBugsDependingO 562 nThis: 1. ERROR in /home/andrew/projects/openjdk/icedtea6/netx/net/sourceforge/jnlp/NetxPanel.java (at line 31) import sun.applet.AppletViewerPanel; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The import sun.applet.AppletViewerPanel cannot be resolved ---------- 2. ERROR in /home/andrew/projects/openjdk/icedtea6/netx/net/sourceforge/jnlp/NetxPanel.java (at line 39) public class NetxPanel extends AppletViewerPanel ^^^^^^^^^^^^^^^^^ AppletViewerPanel cannot be resolved to a type -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From ptisnovs at icedtea.classpath.org Mon Oct 18 06:34:27 2010 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Mon, 18 Oct 2010 13:34:27 +0000 Subject: /hg/icedtea6: Added patch which fixes bug #6703377, corrected lo... Message-ID: changeset d7e98386c764 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=d7e98386c764 author: ptisnovs date: Mon Oct 18 14:39:08 2010 +0200 Added patch which fixes bug #6703377, corrected location of patch patches/openjdk/6853592-badwindow-warning-fix.patch in Makefile.am diffstat: 3 files changed, 25 insertions(+), 4 deletions(-) ChangeLog | 11 ++++++++++- Makefile.am | 7 ++++--- patches/6703377-freetypescaler.patch | 11 +++++++++++ diffs (59 lines): diff -r 12902038b45b -r d7e98386c764 ChangeLog --- a/ChangeLog Fri Oct 15 15:32:50 2010 +0200 +++ b/ChangeLog Mon Oct 18 14:39:08 2010 +0200 @@ -1,6 +1,15 @@ 2010-10-15 Pavel Tisnovsky + + * Makefile.am: + Corrected location of patch + patches/openjdk/6853592-badwindow-warning-fix.patch + in Makefile.am + * patches/6703377-freetypescaler.patch: + Added patch which fixes bug #6703377 + 2010-10-15 Pavel Tisnovsky - * patches/openjdk/6853592-BadWindow-warning-fix.patch: + * patches/openjdk/6853592-badwindow-warning-fix.patch: Added patch which fixes bug #6853592 introduced by another patch 6678385-window_movement_crasher.patch diff -r 12902038b45b -r d7e98386c764 Makefile.am --- a/Makefile.am Fri Oct 15 15:32:50 2010 +0200 +++ b/Makefile.am Mon Oct 18 14:39:08 2010 +0200 @@ -314,7 +314,9 @@ ICEDTEA_PATCHES = \ patches/openjdk/6650759-missing_inference.patch \ patches/numa_on_early_glibc.patch \ patches/icedtea-shark-build.patch \ - patches/openjdk/6985992-test_6933784.patch + patches/openjdk/6985992-test_6933784.patch \ + patches/openjdk/6853592-badwindow-warning-fix.patch \ + patches/6703377-freetypescaler.patch if !WITH_ALT_HSBUILD ICEDTEA_PATCHES += \ @@ -324,8 +326,7 @@ ICEDTEA_PATCHES += \ patches/shark-debug-option.patch \ patches/icedtea-shark.patch \ patches/icedtea-linux-separate-debuginfo.patch \ - patches/openjdk/6951319-sparc_build_fixes.patch \ - patches/openjdk/6853592-badwindow-warning-fix.patch + patches/openjdk/6951319-sparc_build_fixes.patch endif if WITH_RHINO diff -r 12902038b45b -r d7e98386c764 patches/6703377-freetypescaler.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/6703377-freetypescaler.patch Mon Oct 18 14:39:08 2010 +0200 @@ -0,0 +1,11 @@ +--- openjdk.orig/jdk/src/share/native/sun/font/freetypeScaler.c 2010-10-15 15:19:35.000000000 +0200 ++++ openjdk/jdk/src/share/native/sun/font/freetypeScaler.c 2010-10-15 15:19:35.000000000 +0200 +@@ -979,7 +979,7 @@ + } + + +-#define FloatToF26Dot6(x) ((unsigned int) ((x)*64)) ++#define FloatToF26Dot6(x) ((int) ((x)*64)) + + static FT_Outline* getFTOutline(JNIEnv* env, jobject font2D, + FTScalerContext *context, FTScalerInfo* scalerInfo, From ptisnovs at icedtea.classpath.org Mon Oct 18 06:38:21 2010 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Mon, 18 Oct 2010 13:38:21 +0000 Subject: /hg/release/icedtea6-1.9: Added patch which fixes bug #6703377, ... Message-ID: changeset c1a198d6dec9 in /hg/release/icedtea6-1.9 details: http://icedtea.classpath.org/hg/release/icedtea6-1.9?cmd=changeset;node=c1a198d6dec9 author: ptisnovs date: Mon Oct 18 14:43:14 2010 +0200 Added patch which fixes bug #6703377, corrected location of patch patches/openjdk/6853592-badwindow-warning-fix.patch in Makefile.am diffstat: 3 files changed, 24 insertions(+), 3 deletions(-) ChangeLog | 9 +++++++++ Makefile.am | 7 ++++--- patches/6703377-freetypescaler.patch | 11 +++++++++++ diffs (55 lines): diff -r 66e3c18bd585 -r c1a198d6dec9 ChangeLog --- a/ChangeLog Mon Oct 18 11:29:08 2010 +0200 +++ b/ChangeLog Mon Oct 18 14:43:14 2010 +0200 @@ -1,3 +1,12 @@ 2010-10-15 Pavel Tisnovsky + + * Makefile.am: + Corrected location of patch + patches/openjdk/6853592-badwindow-warning-fix.patch + in Makefile.am + * patches/6703377-freetypescaler.patch: + Added patch which fixes bug #6703377 + 2010-10-15 Pavel Tisnovsky * patches/openjdk/6853592-badwindow-warning-fix.patch: diff -r 66e3c18bd585 -r c1a198d6dec9 Makefile.am --- a/Makefile.am Mon Oct 18 11:29:08 2010 +0200 +++ b/Makefile.am Mon Oct 18 14:43:14 2010 +0200 @@ -310,7 +310,9 @@ ICEDTEA_PATCHES = \ patches/icedtea-shark-build.patch \ patches/openjdk/6638712-wildcard_types.patch \ patches/openjdk/6650759-missing_inference.patch \ - patches/numa_on_early_glibc.patch + patches/numa_on_early_glibc.patch \ + patches/openjdk/6853592-badwindow-warning-fix.patch \ + patches/6703377-freetypescaler.patch if !WITH_ALT_HSBUILD @@ -321,8 +323,7 @@ ICEDTEA_PATCHES += \ patches/shark-debug-option.patch \ patches/icedtea-shark.patch \ patches/icedtea-linux-separate-debuginfo.patch \ - patches/openjdk/6951319-sparc_build_fixes.patch \ - patches/openjdk/6853592-badwindow-warning-fix.patch + patches/openjdk/6951319-sparc_build_fixes.patch endif if WITH_RHINO diff -r 66e3c18bd585 -r c1a198d6dec9 patches/6703377-freetypescaler.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/6703377-freetypescaler.patch Mon Oct 18 14:43:14 2010 +0200 @@ -0,0 +1,11 @@ +--- openjdk.orig/jdk/src/share/native/sun/font/freetypeScaler.c 2010-10-15 15:19:35.000000000 +0200 ++++ openjdk/jdk/src/share/native/sun/font/freetypeScaler.c 2010-10-15 15:19:35.000000000 +0200 +@@ -979,7 +979,7 @@ + } + + +-#define FloatToF26Dot6(x) ((unsigned int) ((x)*64)) ++#define FloatToF26Dot6(x) ((int) ((x)*64)) + + static FT_Outline* getFTOutline(JNIEnv* env, jobject font2D, + FTScalerContext *context, FTScalerInfo* scalerInfo, From bugzilla-daemon at icedtea.classpath.org Mon Oct 18 07:09:34 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 18 Oct 2010 14:09:34 +0000 Subject: [Bug 571] New: NetX depends on com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager.java Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=571 Summary: NetX depends on com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager.ja va Product: IcedTea Version: 6-hg Platform: all OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: NetX AssignedTo: unassigned at icedtea.classpath.org ReportedBy: gnu_andrew at member.fsf.org OtherBugsDependingO 562 nThis: -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From andrew at icedtea.classpath.org Mon Oct 18 08:04:10 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Mon, 18 Oct 2010 15:04:10 +0000 Subject: /hg/icedtea6: Build NetX normally without setting an empty bootc... Message-ID: changeset a944742cdfa9 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=a944742cdfa9 author: Andrew John Hughes date: Mon Oct 18 16:04:02 2010 +0100 Build NetX normally without setting an empty bootclasspath. 2010-10-18 Andrew John Hughes * Makefile.am: (NETX_SUN_CLASSES): List internal Sun class dependencies of NetX. (netx): Build normally without setting the bootclasspath empty. diffstat: 2 files changed, 28 insertions(+), 4 deletions(-) ChangeLog | 8 ++++++++ Makefile.am | 24 ++++++++++++++++++++---- diffs (65 lines): diff -r d7e98386c764 -r a944742cdfa9 ChangeLog --- a/ChangeLog Mon Oct 18 14:39:08 2010 +0200 +++ b/ChangeLog Mon Oct 18 16:04:02 2010 +0100 @@ -1,3 +1,11 @@ 2010-10-18 Pavel Tisnovsky + + * Makefile.am: + (NETX_SUN_CLASSES): List internal Sun class + dependencies of NetX. + (netx): Build normally without setting the + bootclasspath empty. + 2010-10-18 Pavel Tisnovsky * Makefile.am: diff -r d7e98386c764 -r a944742cdfa9 Makefile.am --- a/Makefile.am Mon Oct 18 14:39:08 2010 +0200 +++ b/Makefile.am Mon Oct 18 16:04:02 2010 +0100 @@ -86,13 +86,29 @@ NETX_BOOTSTRAP_CLASSES = \ $(SHARE)/javax/swing/JTable.java \ $(SHARE)/java/security/KeyStore.java +# IT563 - NetX uses sun.security code +# IT564 - NetX depends on sun.misc.BASE64Encoder +# IT570 - NetX depends on sun.applet.AppletViewPanel +# IT571 - NetX depends on com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager.java +NETX_SUN_CLASSES = \ + $(SHARE)/sun/security/provider/X509Factory.java \ + $(SHARE)/sun/security/util/SecurityConstants.java \ + $(SHARE)/sun/security/util/HostnameChecker.java \ + $(SHARE)/sun/security/util/DerValue.java \ + $(SHARE)/sun/security/x509/X500Name.java \ + $(SHARE)/sun/misc/BASE64Encoder.java \ + $(SHARE)/sun/applet/AppletViewerPanel.java \ + $(SHARE)/sun/security/validator/ValidatorException.java \ + $(SHARE)/com/sun/net/ssl/internal/ssl/X509ExtendedTrustManager.java + # PR42003 - javax.swing.plaf.basic.BasicDirectoryModel # PR43389 - javax.management.StandardMBean ICEDTEA_BOOTSTRAP_CLASSES = \ $(SHARE)/javax/swing/plaf/basic/BasicDirectoryModel.java \ $(SHARE)/javax/management/StandardMBean.java \ $(SHARE)/com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel.java \ - $(NETX_BOOTSTRAP_CLASSES) + $(NETX_BOOTSTRAP_CLASSES) \ + $(NETX_SUN_CLASSES) # Flags IT_CFLAGS=$(CFLAGS) $(ARCHFLAG) @@ -1868,12 +1884,12 @@ netx-source-files.txt: netx-source-files.txt: find $(NETX_SRCDIR) -name '*.java' | sort > $@ -stamps/netx.stamp: netx-source-files.txt stamps/rt-class-files.stamp +stamps/netx.stamp: netx-source-files.txt stamps/rt.stamp mkdir -p $(abs_top_builddir)/netx.build $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(abs_top_builddir)/netx.build \ - -sourcepath $(NETX_SRCDIR):$(SOURCEPATH_DIRS) \ - -classpath $(RUNTIME) -bootclasspath \'\' \ + -sourcepath $(NETX_SRCDIR) \ + -bootclasspath $(RUNTIME) \ @netx-source-files.txt cp -r $(NETX_RESOURCE_DIR) $(abs_top_builddir)/netx.build/net/sourceforge/jnlp mkdir -p stamps From omajid at redhat.com Mon Oct 18 08:47:35 2010 From: omajid at redhat.com (Omair Majid) Date: Mon, 18 Oct 2010 11:47:35 -0400 Subject: [RFC] netx: add support for parsing and saving deployment.config files Message-ID: <4CBC6C17.6090602@redhat.com> Hi, As described on [1], The Java Plug-in and Java Web Start support using various deployment.properties and deployment.config files to set behaviour of these tools. The patch adds support for parsing and saving these files to netx. This patch does not actually use any of these settings; it just adds support so other parts of netx can start using them. This was filed as a bug by someone against the original netx project [2]. Any comments or concerns? Thanks, Omair [1] http://download.oracle.com/javase/1.5.0/docs/guide/deployment/deployment-guide/properties.html [2] http://sourceforge.net/tracker/?func=detail&aid=2832947&group_id=72541&atid=534854 -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea6-netx-deployment-config-01.patch Type: text/x-patch Size: 26151 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101018/1d0e102f/icedtea6-netx-deployment-config-01.patch From omajid at redhat.com Mon Oct 18 09:19:50 2010 From: omajid at redhat.com (Omair Majid) Date: Mon, 18 Oct 2010 12:19:50 -0400 Subject: [rfc] netx: do not create unnecessary native directories In-Reply-To: <4CAF3CE2.2030907@redhat.com> References: <4CAF3CE2.2030907@redhat.com> Message-ID: <4CBC73A6.30505@redhat.com> On 10/08/2010 11:46 AM, Omair Majid wrote: > Hi, > > Netx currently creates one or more directories under /tmp/ to hold > native libraries any time it launches an application. The attached patch > tries to reduce the clutter caused by these directories. The patch > ensures that a directory for holding native files is only created if > there are native libraries. The patch also installs a shutdown hook to > delete the directory containing the native files. > This fixes http://sourceforge.net/tracker/?func=detail&aid=1085436&group_id=72541&atid=534854 Any concerns? Thanks, Omair From dbhole at redhat.com Mon Oct 18 09:29:34 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Mon, 18 Oct 2010 12:29:34 -0400 Subject: [rfc] netx: do not create unnecessary native directories In-Reply-To: <4CAF3CE2.2030907@redhat.com> References: <4CAF3CE2.2030907@redhat.com> Message-ID: <20101018162933.GB7818@redhat.com> * Omair Majid [2010-10-08 11:47]: > Hi, > > Netx currently creates one or more directories under /tmp/ to hold > native libraries any time it launches an application. The attached > patch tries to reduce the clutter caused by these directories. The > patch ensures that a directory for holding native files is only > created if there are native libraries. The patch also installs a > shutdown hook to delete the directory containing the native files. > > Any thoughts or comments? > > Cheers, > Omair > diff -r 4698e476b886 ChangeLog > --- a/ChangeLog Fri Oct 08 11:06:14 2010 -0400 > +++ b/ChangeLog Fri Oct 08 11:33:49 2010 -0400 > @@ -1,3 +1,11 @@ > +2010-10-08 Omair Majid > + > + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > + (JNLPClassLoader): Call installShutdownHooks. > + (installShutdownHooks): New method. Installs a shutdown hook to > + recursively delete the contents of nativeDir. > + (activateNative): Only create a nativeDir if there are native libraries. > + > 2010-10-08 Omair Majid > > * NEWS: Updated > diff -r 4698e476b886 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Fri Oct 08 11:06:14 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Fri Oct 08 11:33:49 2010 -0400 > @@ -59,6 +59,7 @@ > import net.sourceforge.jnlp.cache.UpdatePolicy; > import net.sourceforge.jnlp.security.SecurityWarningDialog; > import net.sourceforge.jnlp.tools.JarSigner; > +import net.sourceforge.jnlp.util.FileUtils; > import sun.misc.JarIndex; > > /** > @@ -169,6 +170,41 @@ > > setSecurity(); > > + installShutdownHooks(); > + > + } > + > + /** > + * Install JVM shutdown hooks to clean up resources allocated by this > + * ClassLoader. > + */ > + private void installShutdownHooks() { > + Runtime.getRuntime().addShutdownHook(new Thread() { > + @Override > + public void run() { > + if (JNLPRuntime.isDebug()) { > + System.out.println("Cleaing up native directory" + nativeDir.getAbsolutePath()); > + } > + Typo there in spelling of cleaning :) Rest looks fine to me. Assuming you have tested this, OK for commit to HEAD and all branches. Cheers, Deepak > + /* > + * Delete only the native dir created by this classloader (if > + * there is one). Other classloaders (parent, peers) will all > + * cleanup things they created > + */ > + if (nativeDir != null) { > + try { > + FileUtils.recursiveDelete(nativeDir, > + new File(System.getProperty("java.io.tmpdir"))); > + } catch (IOException e) { > + /* > + * failed to delete a file in tmpdir, no big deal (not > + * to mention that the VM is shutting down at this > + * point so no much we can do) > + */ > + } > + } > + } > + }); > } > > private void setSecurity() throws LaunchException { > @@ -741,9 +777,6 @@ > if (localFile == null) > return; > > - if (nativeDir == null) > - nativeDir = getNativeDir(); > - > String[] librarySuffixes = { ".so", ".dylib", ".jnilib", ".framework", ".dll" }; > > try { > @@ -770,10 +803,14 @@ > continue; > } > > + if (nativeDir == null) > + nativeDir = getNativeDir(); > + > File outFile = new File(nativeDir, name); > > CacheUtil.streamCopy(jarFile.getInputStream(e), > new FileOutputStream(outFile)); > + > } > } > catch (IOException ex) { From omajid at icedtea.classpath.org Mon Oct 18 09:32:11 2010 From: omajid at icedtea.classpath.org (omajid at icedtea.classpath.org) Date: Mon, 18 Oct 2010 16:32:11 +0000 Subject: /hg/icedtea6: netx: do not prompt user multiple times for the sa... Message-ID: changeset 40cb6a09efea in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=40cb6a09efea author: Omair Majid date: Mon Oct 18 12:31:46 2010 -0400 netx: do not prompt user multiple times for the same certificate 2010-10-18 Omair Majid * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java: Add temporarilyUntrusted. (checkServerTrusted): Only prompt user if the certificate was not untrusted. (temporarilyUntrust): New method. (isTemporarilyUntrusted): New method. diffstat: 2 files changed, 42 insertions(+), 5 deletions(-) ChangeLog | 9 ++ netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java | 38 ++++++++-- diffs (79 lines): diff -r a944742cdfa9 -r 40cb6a09efea ChangeLog --- a/ChangeLog Mon Oct 18 16:04:02 2010 +0100 +++ b/ChangeLog Mon Oct 18 12:31:46 2010 -0400 @@ -1,3 +1,12 @@ 2010-10-18 Andrew John Hughes + + * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java: + Add temporarilyUntrusted. + (checkServerTrusted): Only prompt user if the certificate was not + untrusted. + (temporarilyUntrust): New method. + (isTemporarilyUntrusted): New method. + 2010-10-18 Andrew John Hughes * Makefile.am: diff -r a944742cdfa9 -r 40cb6a09efea netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java --- a/netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java Mon Oct 18 16:04:02 2010 +0100 +++ b/netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java Mon Oct 18 12:31:46 2010 -0400 @@ -66,7 +66,8 @@ public class VariableX509TrustManager ex X509TrustManager userTrustManager = null; X509TrustManager caTrustManager = null; - ArrayList temporarilyTrusted = new ArrayList(); + ArrayList temporarilyTrusted = new ArrayList(); + ArrayList temporarilyUntrusted = new ArrayList(); static VariableX509TrustManager instance = null; @@ -192,11 +193,14 @@ public class VariableX509TrustManager ex if (checkOnly) { throw ce; } else { + if (!isTemporarilyUntrusted(chain[0])) { + boolean b = askUser(chain, authType, trusted, CNMatched, hostName); - boolean b = askUser(chain, authType, trusted, CNMatched, hostName); - - if (b) { - temporarilyTrust(chain[0]); + if (b) { + temporarilyTrust(chain[0]); + } else { + temporarilyUntrust(chain[0]); + } } checkAllManagers(chain, authType); @@ -247,6 +251,30 @@ public class VariableX509TrustManager ex } /** + * Temporarily untrust the given cert - do not ask the user to trust this + * certificate again + * + * @param c The certificate to trust + */ + private void temporarilyUntrust(Certificate c) { + temporarilyUntrusted.add(c); + } + + /** + * Was this certificate explicitly untrusted by user? + * + * @param c the certificate + * @return true if the user was presented with this certificate and chose + * not to trust it + */ + private boolean isTemporarilyUntrusted(Certificate c) { + if (temporarilyUntrusted.contains(c)) { + return true; + } + return false; + } + + /** * Temporarily trust the given cert (runtime) * * @param c The certificate to trust From omajid at icedtea.classpath.org Mon Oct 18 09:37:19 2010 From: omajid at icedtea.classpath.org (omajid at icedtea.classpath.org) Date: Mon, 18 Oct 2010 16:37:19 +0000 Subject: /hg/release/icedtea6-1.9: netx: do not prompt user multiple time... Message-ID: changeset 69b7e0c0a5c3 in /hg/release/icedtea6-1.9 details: http://icedtea.classpath.org/hg/release/icedtea6-1.9?cmd=changeset;node=69b7e0c0a5c3 author: Omair Majid date: Mon Oct 18 12:36:39 2010 -0400 netx: do not prompt user multiple times for the same certificate 2010-10-18 Omair Majid * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java: Add temporarilyUntrusted. (checkServerTrusted): Only prompt user if the certificate was not untrusted. (temporarilyUntrust): New method. (isTemporarilyUntrusted): New method. diffstat: 2 files changed, 42 insertions(+), 5 deletions(-) ChangeLog | 9 ++ netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java | 38 ++++++++-- diffs (79 lines): diff -r c1a198d6dec9 -r 69b7e0c0a5c3 ChangeLog --- a/ChangeLog Mon Oct 18 14:43:14 2010 +0200 +++ b/ChangeLog Mon Oct 18 12:36:39 2010 -0400 @@ -1,3 +1,12 @@ 2010-10-18 Pavel Tisnovsky + + * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java: + Add temporarilyUntrusted. + (checkServerTrusted): Only prompt user if the certificate was not + untrusted. + (temporarilyUntrust): New method. + (isTemporarilyUntrusted): New method. + 2010-10-18 Pavel Tisnovsky * Makefile.am: diff -r c1a198d6dec9 -r 69b7e0c0a5c3 netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java --- a/netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java Mon Oct 18 14:43:14 2010 +0200 +++ b/netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java Mon Oct 18 12:36:39 2010 -0400 @@ -66,7 +66,8 @@ public class VariableX509TrustManager ex X509TrustManager userTrustManager = null; X509TrustManager caTrustManager = null; - ArrayList temporarilyTrusted = new ArrayList(); + ArrayList temporarilyTrusted = new ArrayList(); + ArrayList temporarilyUntrusted = new ArrayList(); static VariableX509TrustManager instance = null; @@ -192,11 +193,14 @@ public class VariableX509TrustManager ex if (checkOnly) { throw ce; } else { + if (!isTemporarilyUntrusted(chain[0])) { + boolean b = askUser(chain, authType, trusted, CNMatched, hostName); - boolean b = askUser(chain, authType, trusted, CNMatched, hostName); - - if (b) { - temporarilyTrust(chain[0]); + if (b) { + temporarilyTrust(chain[0]); + } else { + temporarilyUntrust(chain[0]); + } } checkAllManagers(chain, authType); @@ -247,6 +251,30 @@ public class VariableX509TrustManager ex } /** + * Temporarily untrust the given cert - do not ask the user to trust this + * certificate again + * + * @param c The certificate to trust + */ + private void temporarilyUntrust(Certificate c) { + temporarilyUntrusted.add(c); + } + + /** + * Was this certificate explicitly untrusted by user? + * + * @param c the certificate + * @return true if the user was presented with this certificate and chose + * not to trust it + */ + private boolean isTemporarilyUntrusted(Certificate c) { + if (temporarilyUntrusted.contains(c)) { + return true; + } + return false; + } + + /** * Temporarily trust the given cert (runtime) * * @param c The certificate to trust From omajid at icedtea.classpath.org Mon Oct 18 09:47:41 2010 From: omajid at icedtea.classpath.org (omajid at icedtea.classpath.org) Date: Mon, 18 Oct 2010 16:47:41 +0000 Subject: /hg/release/icedtea6-1.8: netx: do not prompt user multiple time... Message-ID: changeset 78de2d8168d8 in /hg/release/icedtea6-1.8 details: http://icedtea.classpath.org/hg/release/icedtea6-1.8?cmd=changeset;node=78de2d8168d8 author: Omair Majid date: Mon Oct 18 12:47:36 2010 -0400 netx: do not prompt user multiple times for the same certificate 2010-10-18 Omair Majid * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java: Add temporarilyUntrusted. (checkServerTrusted): Only prompt user if the certificate was not untrusted. (temporarilyUntrust): New method. (isTemporarilyUntrusted): New method. diffstat: 2 files changed, 42 insertions(+), 5 deletions(-) ChangeLog | 9 ++ netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java | 38 ++++++++-- diffs (79 lines): diff -r 666f6453befc -r 78de2d8168d8 ChangeLog --- a/ChangeLog Mon Oct 18 11:54:21 2010 +0200 +++ b/ChangeLog Mon Oct 18 12:47:36 2010 -0400 @@ -1,3 +1,12 @@ 2010-10-15 Pavel Tisnovsky + + * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java: + Add temporarilyUntrusted. + (checkServerTrusted): Only prompt user if the certificate was not + untrusted. + (temporarilyUntrust): New method. + (isTemporarilyUntrusted): New method. + 2010-10-15 Pavel Tisnovsky * patches/openjdk/6853592-BadWindow-warning-fix.patch: diff -r 666f6453befc -r 78de2d8168d8 netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java --- a/netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java Mon Oct 18 11:54:21 2010 +0200 +++ b/netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java Mon Oct 18 12:47:36 2010 -0400 @@ -66,7 +66,8 @@ public class VariableX509TrustManager ex X509TrustManager userTrustManager = null; X509TrustManager caTrustManager = null; - ArrayList temporarilyTrusted = new ArrayList(); + ArrayList temporarilyTrusted = new ArrayList(); + ArrayList temporarilyUntrusted = new ArrayList(); static VariableX509TrustManager instance = null; @@ -192,11 +193,14 @@ public class VariableX509TrustManager ex if (checkOnly) { throw ce; } else { + if (!isTemporarilyUntrusted(chain[0])) { + boolean b = askUser(chain, authType, trusted, CNMatched, hostName); - boolean b = askUser(chain, authType, trusted, CNMatched, hostName); - - if (b) { - temporarilyTrust(chain[0]); + if (b) { + temporarilyTrust(chain[0]); + } else { + temporarilyUntrust(chain[0]); + } } checkAllManagers(chain, authType); @@ -247,6 +251,30 @@ public class VariableX509TrustManager ex } /** + * Temporarily untrust the given cert - do not ask the user to trust this + * certificate again + * + * @param c The certificate to trust + */ + private void temporarilyUntrust(Certificate c) { + temporarilyUntrusted.add(c); + } + + /** + * Was this certificate explicitly untrusted by user? + * + * @param c the certificate + * @return true if the user was presented with this certificate and chose + * not to trust it + */ + private boolean isTemporarilyUntrusted(Certificate c) { + if (temporarilyUntrusted.contains(c)) { + return true; + } + return false; + } + + /** * Temporarily trust the given cert (runtime) * * @param c The certificate to trust From omajid at icedtea.classpath.org Mon Oct 18 09:52:27 2010 From: omajid at icedtea.classpath.org (omajid at icedtea.classpath.org) Date: Mon, 18 Oct 2010 16:52:27 +0000 Subject: /hg/release/icedtea6-1.7: netx: do not prompt user multiple time... Message-ID: changeset fcc8fa217369 in /hg/release/icedtea6-1.7 details: http://icedtea.classpath.org/hg/release/icedtea6-1.7?cmd=changeset;node=fcc8fa217369 author: Omair Majid date: Mon Oct 18 12:52:22 2010 -0400 netx: do not prompt user multiple times for the same certificate 2010-10-18 Omair Majid * rt/net/sourceforge/jnlp/security/VariableX509TrustManager.java: Add temporarilyUntrusted. (checkServerTrusted): Only prompt user if the certificate was not untrusted. (temporarilyUntrust): New method. (isTemporarilyUntrusted): New method. diffstat: 2 files changed, 42 insertions(+), 5 deletions(-) ChangeLog | 9 ++ rt/net/sourceforge/jnlp/security/VariableX509TrustManager.java | 38 ++++++++-- diffs (79 lines): diff -r 902c6f336008 -r fcc8fa217369 ChangeLog --- a/ChangeLog Mon Oct 18 14:18:22 2010 +0100 +++ b/ChangeLog Mon Oct 18 12:52:22 2010 -0400 @@ -1,3 +1,12 @@ 2010-10-15 Pavel Tisnovsky + + * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java: + Add temporarilyUntrusted. + (checkServerTrusted): Only prompt user if the certificate was not + untrusted. + (temporarilyUntrust): New method. + (isTemporarilyUntrusted): New method. + 2010-10-15 Pavel Tisnovsky * patches/openjdk/6853592-BadWindow-warning-fix.patch: diff -r 902c6f336008 -r fcc8fa217369 rt/net/sourceforge/jnlp/security/VariableX509TrustManager.java --- a/rt/net/sourceforge/jnlp/security/VariableX509TrustManager.java Mon Oct 18 14:18:22 2010 +0100 +++ b/rt/net/sourceforge/jnlp/security/VariableX509TrustManager.java Mon Oct 18 12:52:22 2010 -0400 @@ -66,7 +66,8 @@ public class VariableX509TrustManager ex X509TrustManager userTrustManager = null; X509TrustManager caTrustManager = null; - ArrayList temporarilyTrusted = new ArrayList(); + ArrayList temporarilyTrusted = new ArrayList(); + ArrayList temporarilyUntrusted = new ArrayList(); static VariableX509TrustManager instance = null; @@ -192,11 +193,14 @@ public class VariableX509TrustManager ex if (checkOnly) { throw ce; } else { + if (!isTemporarilyUntrusted(chain[0])) { + boolean b = askUser(chain, authType, trusted, CNMatched, hostName); - boolean b = askUser(chain, authType, trusted, CNMatched, hostName); - - if (b) { - temporarilyTrust(chain[0]); + if (b) { + temporarilyTrust(chain[0]); + } else { + temporarilyUntrust(chain[0]); + } } checkAllManagers(chain, authType); @@ -247,6 +251,30 @@ public class VariableX509TrustManager ex } /** + * Temporarily untrust the given cert - do not ask the user to trust this + * certificate again + * + * @param c The certificate to trust + */ + private void temporarilyUntrust(Certificate c) { + temporarilyUntrusted.add(c); + } + + /** + * Was this certificate explicitly untrusted by user? + * + * @param c the certificate + * @return true if the user was presented with this certificate and chose + * not to trust it + */ + private boolean isTemporarilyUntrusted(Certificate c) { + if (temporarilyUntrusted.contains(c)) { + return true; + } + return false; + } + + /** * Temporarily trust the given cert (runtime) * * @param c The certificate to trust From omajid at redhat.com Mon Oct 18 09:53:14 2010 From: omajid at redhat.com (Omair Majid) Date: Mon, 18 Oct 2010 12:53:14 -0400 Subject: [RFC] netx/plugin: do not prompt user multiple times for the same Certificate In-Reply-To: <20101014210354.GE23588@redhat.com> References: <4CB769F9.7010202@redhat.com> <20101014210354.GE23588@redhat.com> Message-ID: <4CBC7B7A.7080506@redhat.com> On 10/14/2010 05:03 PM, Deepak Bhole wrote: > * Omair Majid [2010-10-14 16:37]: >> Hi, >> >> In the current implementation of the plugin, when the user rejects a >> https certificate, the next time the https connection is attempted, >> another certificate warning is shown. >> >> The attached patch makes it so that if the user does not accept a >> certificate, he is not prompted again for accepting it. The patch >> keeps a list of certificates that the user has not accepted and >> skips the user prompt if it is for one of those certificates. >> >> Any comments or suggestions? >> > > > Looks fine to me. Okay for commit to all active branches. > Thanks. Pushed to IcedTea6 HEAD, 1.9, 1.8 and 1.7. Cheers, Omair From ahughes at redhat.com Mon Oct 18 10:35:01 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Mon, 18 Oct 2010 18:35:01 +0100 Subject: [RFC] netx/plugin: do not prompt user multiple times for the same Certificate In-Reply-To: <4CBC7B7A.7080506@redhat.com> References: <4CB769F9.7010202@redhat.com> <20101014210354.GE23588@redhat.com> <4CBC7B7A.7080506@redhat.com> Message-ID: <20101018173501.GD31704@rivendell.middle-earth.co.uk> On 12:53 Mon 18 Oct , Omair Majid wrote: > On 10/14/2010 05:03 PM, Deepak Bhole wrote: > > * Omair Majid [2010-10-14 16:37]: > >> Hi, > >> > >> In the current implementation of the plugin, when the user rejects a > >> https certificate, the next time the https connection is attempted, > >> another certificate warning is shown. > >> > >> The attached patch makes it so that if the user does not accept a > >> certificate, he is not prompted again for accepting it. The patch > >> keeps a list of certificates that the user has not accepted and > >> skips the user prompt if it is for one of those certificates. > >> > >> Any comments or suggestions? > >> > > > > > > Looks fine to me. Okay for commit to all active branches. > > > > Thanks. Pushed to IcedTea6 HEAD, 1.9, 1.8 and 1.7. > > Cheers, > Omair > Can the user remove the certificate from the list, should they wish to accept it at some point in the future? Same vice versa I guess (stop accepting a previously accepted certificate). -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From dbhole at redhat.com Mon Oct 18 10:49:45 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Mon, 18 Oct 2010 13:49:45 -0400 Subject: [RFC] netx/plugin: do not prompt user multiple times for the same Certificate In-Reply-To: <20101018173501.GD31704@rivendell.middle-earth.co.uk> References: <4CB769F9.7010202@redhat.com> <20101014210354.GE23588@redhat.com> <4CBC7B7A.7080506@redhat.com> <20101018173501.GD31704@rivendell.middle-earth.co.uk> Message-ID: <20101018174945.GC7818@redhat.com> * Dr Andrew John Hughes [2010-10-18 13:35]: > On 12:53 Mon 18 Oct , Omair Majid wrote: > > On 10/14/2010 05:03 PM, Deepak Bhole wrote: > > > * Omair Majid [2010-10-14 16:37]: > > >> Hi, > > >> > > >> In the current implementation of the plugin, when the user rejects a > > >> https certificate, the next time the https connection is attempted, > > >> another certificate warning is shown. > > >> > > >> The attached patch makes it so that if the user does not accept a > > >> certificate, he is not prompted again for accepting it. The patch > > >> keeps a list of certificates that the user has not accepted and > > >> skips the user prompt if it is for one of those certificates. > > >> > > >> Any comments or suggestions? > > >> > > > > > > > > > Looks fine to me. Okay for commit to all active branches. > > > > > > > Thanks. Pushed to IcedTea6 HEAD, 1.9, 1.8 and 1.7. > > > > Cheers, > > Omair > > > > Can the user remove the certificate from the list, should they wish to accept it at some point in the future? > Same vice versa I guess (stop accepting a previously accepted certificate). The untrusted list is temporary and gets destroyed when the vm shuts down. As for removing certs previously trusted -- that list can be manipulated with keytool. The keystore is .netx/security/trusted.certs Cheers, Deepak > -- > Andrew :) > > Free Java Software Engineer > Red Hat, Inc. (http://www.redhat.com) > > Support Free Java! > Contribute to GNU Classpath and the OpenJDK > http://www.gnu.org/software/classpath > http://openjdk.java.net > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From omajid at icedtea.classpath.org Mon Oct 18 11:10:44 2010 From: omajid at icedtea.classpath.org (omajid at icedtea.classpath.org) Date: Mon, 18 Oct 2010 18:10:44 +0000 Subject: /hg/icedtea6: add jsse.jar to RUNTIME to allow netx to build Message-ID: changeset 003328ca1070 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=003328ca1070 author: Omair Majid date: Mon Oct 18 14:10:30 2010 -0400 add jsse.jar to RUNTIME to allow netx to build diffstat: 2 files changed, 6 insertions(+), 1 deletion(-) ChangeLog | 5 +++++ Makefile.am | 2 +- diffs (24 lines): diff -r 40cb6a09efea -r 003328ca1070 ChangeLog --- a/ChangeLog Mon Oct 18 12:31:46 2010 -0400 +++ b/ChangeLog Mon Oct 18 14:10:30 2010 -0400 @@ -1,3 +1,8 @@ 2010-10-18 Omair Majid + + * Makefile.am (RUNTIME): Add jsse.jar to classpath. It is required + for building netx. + 2010-10-18 Omair Majid * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java: diff -r 40cb6a09efea -r 003328ca1070 Makefile.am --- a/Makefile.am Mon Oct 18 12:31:46 2010 -0400 +++ b/Makefile.am Mon Oct 18 14:10:30 2010 -0400 @@ -34,7 +34,7 @@ ICEDTEA_CLS_DIR = $(BUILD_OUTPUT_DIR)/cl ICEDTEA_CLS_DIR = $(BUILD_OUTPUT_DIR)/classes ICEDTEA_CLS_DIR_ECJ = $(ECJ_BUILD_OUTPUT_DIR)/classes BOOT_DIR = $(abs_top_builddir)/bootstrap/jdk1.6.0 -RUNTIME = $(BOOT_DIR)/jre/lib/rt.jar +RUNTIME = $(BOOT_DIR)/jre/lib/rt.jar:$(BOOT_DIR)/jre/lib/jsse.jar ENDORSED_DIR = $(BOOT_DIR)/lib/endorsed ECJ_BOOT_DIR = $(abs_top_builddir)/bootstrap/ecj ICEDTEA_BOOT_DIR = $(abs_top_builddir)/bootstrap/icedtea From omajid at redhat.com Mon Oct 18 11:34:56 2010 From: omajid at redhat.com (Omair Majid) Date: Mon, 18 Oct 2010 14:34:56 -0400 Subject: [RFC] netx/plugin: do not prompt user multiple times for the same Certificate In-Reply-To: <20101018174945.GC7818@redhat.com> References: <4CB769F9.7010202@redhat.com> <20101014210354.GE23588@redhat.com> <4CBC7B7A.7080506@redhat.com> <20101018173501.GD31704@rivendell.middle-earth.co.uk> <20101018174945.GC7818@redhat.com> Message-ID: <4CBC9350.7040608@redhat.com> On 10/18/2010 01:49 PM, Deepak Bhole wrote: > * Dr Andrew John Hughes [2010-10-18 13:35]: >> On 12:53 Mon 18 Oct , Omair Majid wrote: >>> On 10/14/2010 05:03 PM, Deepak Bhole wrote: >>>> * Omair Majid [2010-10-14 16:37]: >>>>> Hi, >>>>> >>>>> In the current implementation of the plugin, when the user rejects a >>>>> https certificate, the next time the https connection is attempted, >>>>> another certificate warning is shown. >>>>> >>>>> The attached patch makes it so that if the user does not accept a >>>>> certificate, he is not prompted again for accepting it. The patch >>>>> keeps a list of certificates that the user has not accepted and >>>>> skips the user prompt if it is for one of those certificates. >>>>> >>>>> Any comments or suggestions? >>>>> >>>> >>>> >>>> Looks fine to me. Okay for commit to all active branches. >>>> >>> >>> Thanks. Pushed to IcedTea6 HEAD, 1.9, 1.8 and 1.7. >>> >>> Cheers, >>> Omair >>> >> >> Can the user remove the certificate from the list, should they wish to accept it at some point in the future? >> Same vice versa I guess (stop accepting a previously accepted certificate). > > > The untrusted list is temporary and gets destroyed when the vm shuts > down. > I was wondering whether it would make more sense to keep a list of trusted/untrusted certificates per applet/application instead of per VM. > As for removing certs previously trusted -- that list can be manipulated > with keytool. The keystore is .netx/security/trusted.certs > Another way of manipulating the keystore is by using "javaws -viewer" > Cheers, > Deepak > >> -- >> Andrew :) >> >> Free Java Software Engineer >> Red Hat, Inc. (http://www.redhat.com) >> >> Support Free Java! >> Contribute to GNU Classpath and the OpenJDK >> http://www.gnu.org/software/classpath >> http://openjdk.java.net >> PGP Key: 94EFD9D8 (http://subkeys.pgp.net) >> Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From dbhole at redhat.com Mon Oct 18 11:49:23 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Mon, 18 Oct 2010 14:49:23 -0400 Subject: [RFC] netx/plugin: do not prompt user multiple times for the same Certificate In-Reply-To: <4CBC9350.7040608@redhat.com> References: <4CB769F9.7010202@redhat.com> <20101014210354.GE23588@redhat.com> <4CBC7B7A.7080506@redhat.com> <20101018173501.GD31704@rivendell.middle-earth.co.uk> <20101018174945.GC7818@redhat.com> <4CBC9350.7040608@redhat.com> Message-ID: <20101018184923.GA10030@redhat.com> * Omair Majid [2010-10-18 14:34]: > On 10/18/2010 01:49 PM, Deepak Bhole wrote: > >* Dr Andrew John Hughes [2010-10-18 13:35]: > >>On 12:53 Mon 18 Oct , Omair Majid wrote: > >>>On 10/14/2010 05:03 PM, Deepak Bhole wrote: > >>>>* Omair Majid [2010-10-14 16:37]: > >>>>>Hi, > >>>>> > >>>>>In the current implementation of the plugin, when the user rejects a > >>>>>https certificate, the next time the https connection is attempted, > >>>>>another certificate warning is shown. > >>>>> > >>>>>The attached patch makes it so that if the user does not accept a > >>>>>certificate, he is not prompted again for accepting it. The patch > >>>>>keeps a list of certificates that the user has not accepted and > >>>>>skips the user prompt if it is for one of those certificates. > >>>>> > >>>>>Any comments or suggestions? > >>>>> > >>>> > >>>> > >>>>Looks fine to me. Okay for commit to all active branches. > >>>> > >>> > >>>Thanks. Pushed to IcedTea6 HEAD, 1.9, 1.8 and 1.7. > >>> > >>>Cheers, > >>>Omair > >>> > >> > >>Can the user remove the certificate from the list, should they wish to accept it at some point in the future? > >>Same vice versa I guess (stop accepting a previously accepted certificate). > > > > > >The untrusted list is temporary and gets destroyed when the vm shuts > >down. > > > > I was wondering whether it would make more sense to keep a list of > trusted/untrusted certificates per applet/application instead of per > VM. > It should be per VM. Otherwise if this were being used within a company environment that had their own root cert for example, users would have to accept the certs for each applet/http server which would be quite tedious. > >As for removing certs previously trusted -- that list can be manipulated > >with keytool. The keystore is .netx/security/trusted.certs > > > > Another way of manipulating the keystore is by using "javaws -viewer" > Nice! I didn't know NetX supported viewer. Deepak > >Cheers, > >Deepak > > > >>-- > >>Andrew :) > >> > >>Free Java Software Engineer > >>Red Hat, Inc. (http://www.redhat.com) > >> > >>Support Free Java! > >>Contribute to GNU Classpath and the OpenJDK > >>http://www.gnu.org/software/classpath > >>http://openjdk.java.net > >>PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > >>Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 > From omajid at redhat.com Mon Oct 18 11:56:27 2010 From: omajid at redhat.com (Omair Majid) Date: Mon, 18 Oct 2010 14:56:27 -0400 Subject: [RFC] netx/plugin: do not prompt user multiple times for the same Certificate In-Reply-To: <20101018184923.GA10030@redhat.com> References: <4CB769F9.7010202@redhat.com> <20101014210354.GE23588@redhat.com> <4CBC7B7A.7080506@redhat.com> <20101018173501.GD31704@rivendell.middle-earth.co.uk> <20101018174945.GC7818@redhat.com> <4CBC9350.7040608@redhat.com> <20101018184923.GA10030@redhat.com> Message-ID: <4CBC985B.4010709@redhat.com> On 10/18/2010 02:49 PM, Deepak Bhole wrote: > * Omair Majid [2010-10-18 14:34]: >> On 10/18/2010 01:49 PM, Deepak Bhole wrote: >>> * Dr Andrew John Hughes [2010-10-18 13:35]: >>>> On 12:53 Mon 18 Oct , Omair Majid wrote: >>>>> On 10/14/2010 05:03 PM, Deepak Bhole wrote: >>>>>> * Omair Majid [2010-10-14 16:37]: >>>>>>> Hi, >>>>>>> >>>>>>> In the current implementation of the plugin, when the user rejects a >>>>>>> https certificate, the next time the https connection is attempted, >>>>>>> another certificate warning is shown. >>>>>>> >>>>>>> The attached patch makes it so that if the user does not accept a >>>>>>> certificate, he is not prompted again for accepting it. The patch >>>>>>> keeps a list of certificates that the user has not accepted and >>>>>>> skips the user prompt if it is for one of those certificates. >>>>>>> >>>>>>> Any comments or suggestions? >>>>>>> >>>>>> >>>>>> >>>>>> Looks fine to me. Okay for commit to all active branches. >>>>>> >>>>> >>>>> Thanks. Pushed to IcedTea6 HEAD, 1.9, 1.8 and 1.7. >>>>> >>>>> Cheers, >>>>> Omair >>>>> >>>> >>>> Can the user remove the certificate from the list, should they wish to accept it at some point in the future? >>>> Same vice versa I guess (stop accepting a previously accepted certificate). >>> >>> >>> The untrusted list is temporary and gets destroyed when the vm shuts >>> down. >>> >> >> I was wondering whether it would make more sense to keep a list of >> trusted/untrusted certificates per applet/application instead of per >> VM. >> > > It should be per VM. Otherwise if this were being used within a company > environment that had their own root cert for example, users would have > to accept the certs for each applet/http server which would be quite > tedious. > >>> As for removing certs previously trusted -- that list can be manipulated >>> with keytool. The keystore is .netx/security/trusted.certs >>> >> >> Another way of manipulating the keystore is by using "javaws -viewer" >> > > Nice! I didn't know NetX supported viewer. Unfortunately, it is not quite the same thing as Java Web Start's javaws -viewer. Net'x javaws -viewer is more along the lines of the certificate viewer in the Java Control Panel. > > Deepak > >>> Cheers, >>> Deepak >>> >>>> -- >>>> Andrew :) >>>> >>>> Free Java Software Engineer >>>> Red Hat, Inc. (http://www.redhat.com) >>>> >>>> Support Free Java! >>>> Contribute to GNU Classpath and the OpenJDK >>>> http://www.gnu.org/software/classpath >>>> http://openjdk.java.net >>>> PGP Key: 94EFD9D8 (http://subkeys.pgp.net) >>>> Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 >> From andrew at icedtea.classpath.org Mon Oct 18 12:14:57 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Mon, 18 Oct 2010 19:14:57 +0000 Subject: /hg/icedtea6: Build plugin without setting bootclasspath to empt... Message-ID: changeset b2629d02d55f in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=b2629d02d55f author: Andrew John Hughes date: Mon Oct 18 20:14:50 2010 +0100 Build plugin without setting bootclasspath to empty. Fix build breakage. 2010-10-18 Andrew John Hughes * Makefile.am: (RUNTIME): Revert Omair's change which breaks the standard build. (PLUGIN_BOOTSTRAP_CLASSES): Add java.net dependencies not yet in gcj. (PLUGIN_SUN_CLASSES): Add bad internal class dependencies of plugin. (liveconnect): Build without setting bootclasspath to empty. diffstat: 2 files changed, 33 insertions(+), 5 deletions(-) ChangeLog | 13 ++++++++++++- Makefile.am | 25 +++++++++++++++++++++---- diffs (86 lines): diff -r 003328ca1070 -r b2629d02d55f ChangeLog --- a/ChangeLog Mon Oct 18 14:10:30 2010 -0400 +++ b/ChangeLog Mon Oct 18 20:14:50 2010 +0100 @@ -1,7 +1,18 @@ 2010-10-18 Omair Majid + + * Makefile.am: + (RUNTIME): Revert Omair's change which breaks + the standard build. + (PLUGIN_BOOTSTRAP_CLASSES): Add java.net dependencies + not yet in gcj. + (PLUGIN_SUN_CLASSES): Add bad internal class dependencies + of plugin. + (liveconnect): Build without setting bootclasspath to empty. + 2010-10-18 Omair Majid * Makefile.am (RUNTIME): Add jsse.jar to classpath. It is required - for building netx. + for building netx with --disable-bootstrap. 2010-10-18 Omair Majid diff -r 003328ca1070 -r b2629d02d55f Makefile.am --- a/Makefile.am Mon Oct 18 14:10:30 2010 -0400 +++ b/Makefile.am Mon Oct 18 20:14:50 2010 +0100 @@ -34,7 +34,7 @@ ICEDTEA_CLS_DIR = $(BUILD_OUTPUT_DIR)/cl ICEDTEA_CLS_DIR = $(BUILD_OUTPUT_DIR)/classes ICEDTEA_CLS_DIR_ECJ = $(ECJ_BUILD_OUTPUT_DIR)/classes BOOT_DIR = $(abs_top_builddir)/bootstrap/jdk1.6.0 -RUNTIME = $(BOOT_DIR)/jre/lib/rt.jar:$(BOOT_DIR)/jre/lib/jsse.jar +RUNTIME = $(BOOT_DIR)/jre/lib/rt.jar ENDORSED_DIR = $(BOOT_DIR)/lib/endorsed ECJ_BOOT_DIR = $(abs_top_builddir)/bootstrap/ecj ICEDTEA_BOOT_DIR = $(abs_top_builddir)/bootstrap/icedtea @@ -86,6 +86,12 @@ NETX_BOOTSTRAP_CLASSES = \ $(SHARE)/javax/swing/JTable.java \ $(SHARE)/java/security/KeyStore.java +# PR46074 - Missing java.net cookie code required by IcedTea plugin +PLUGIN_BOOTSTRAP_CLASSES = \ + $(SHARE)/java/net/CookieManager.java \ + $(SHARE)/java/net/HttpCookie.java \ + $(SHARE)/java/net/CookieHandler.java + # IT563 - NetX uses sun.security code # IT564 - NetX depends on sun.misc.BASE64Encoder # IT570 - NetX depends on sun.applet.AppletViewPanel @@ -101,6 +107,16 @@ NETX_SUN_CLASSES = \ $(SHARE)/sun/security/validator/ValidatorException.java \ $(SHARE)/com/sun/net/ssl/internal/ssl/X509ExtendedTrustManager.java +# IT573 - Plugin depends on sun.awt,X11.XEmbeddedFrame.java +# IT574 - Plugin depends on sun.misc.Ref +# IT575 - Plugin depends on com.sun/jndi.toolkit.url.UrlUtil +# IT576 - Plugin depends on sun.applet.AppletImageRef +PLUGIN_SUN_CLASSES = \ + $(SOLARIS)/sun/awt/X11/XEmbeddedFrame.java \ + $(SHARE)/sun/misc/Ref.java \ + $(SHARE)/com/sun/jndi/toolkit/url/UrlUtil.java \ + $(SHARE)/sun/applet/AppletImageRef.java + # PR42003 - javax.swing.plaf.basic.BasicDirectoryModel # PR43389 - javax.management.StandardMBean ICEDTEA_BOOTSTRAP_CLASSES = \ @@ -108,7 +124,9 @@ ICEDTEA_BOOTSTRAP_CLASSES = \ $(SHARE)/javax/management/StandardMBean.java \ $(SHARE)/com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel.java \ $(NETX_BOOTSTRAP_CLASSES) \ - $(NETX_SUN_CLASSES) + $(NETX_SUN_CLASSES) \ + $(PLUGIN_BOOTSTRAP_CLASSES) \ + $(PLUGIN_SUN_CLASSES) # Flags IT_CFLAGS=$(CFLAGS) $(ARCHFLAG) @@ -1851,8 +1869,7 @@ stamps/liveconnect.stamp: liveconnect-so $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(abs_top_builddir)/liveconnect \ -classpath $(abs_top_builddir)/netx.build:$(RUNTIME) \ - -sourcepath $(SOURCEPATH_DIRS) \ - -bootclasspath \'\' \ + -sourcepath $(LIVECONNECT_SRCS) \ @liveconnect-source-files.txt ; \ fi mkdir -p stamps From andrew at icedtea.classpath.org Mon Oct 18 13:29:17 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Mon, 18 Oct 2010 20:29:17 +0000 Subject: /hg/icedtea6: Define RUNTIME conditionally to handle jsse.jar co... Message-ID: changeset afdd3f284524 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=afdd3f284524 author: Andrew John Hughes date: Mon Oct 18 21:29:09 2010 +0100 Define RUNTIME conditionally to handle jsse.jar correctly. 2010-10-18 Andrew John Hughes * Makefile.am: (RUNTIME): Define conditionally, so that jsse.jar is added when not bootstrapping. diffstat: 2 files changed, 8 insertions(+), 1 deletion(-) ChangeLog | 6 ++++++ Makefile.am | 3 ++- diffs (37 lines): diff -r b2629d02d55f -r afdd3f284524 ChangeLog --- a/ChangeLog Mon Oct 18 20:14:50 2010 +0100 +++ b/ChangeLog Mon Oct 18 21:29:09 2010 +0100 @@ -1,3 +1,9 @@ 2010-10-18 Andrew John Hughes + + * Makefile.am: + (RUNTIME): Define conditionally, so that + jsse.jar is added when not bootstrapping. + 2010-10-18 Andrew John Hughes * Makefile.am: diff -r b2629d02d55f -r afdd3f284524 Makefile.am --- a/Makefile.am Mon Oct 18 20:14:50 2010 +0100 +++ b/Makefile.am Mon Oct 18 21:29:09 2010 +0100 @@ -34,7 +34,6 @@ ICEDTEA_CLS_DIR = $(BUILD_OUTPUT_DIR)/cl ICEDTEA_CLS_DIR = $(BUILD_OUTPUT_DIR)/classes ICEDTEA_CLS_DIR_ECJ = $(ECJ_BUILD_OUTPUT_DIR)/classes BOOT_DIR = $(abs_top_builddir)/bootstrap/jdk1.6.0 -RUNTIME = $(BOOT_DIR)/jre/lib/rt.jar ENDORSED_DIR = $(BOOT_DIR)/lib/endorsed ECJ_BOOT_DIR = $(abs_top_builddir)/bootstrap/ecj ICEDTEA_BOOT_DIR = $(abs_top_builddir)/bootstrap/icedtea @@ -190,10 +189,12 @@ if BOOTSTRAPPING BOOTSTRAP_DIRECTORY_STAMP = stamps/bootstrap-directory.stamp ICEDTEA_HOME = $(ICEDTEA_BOOT_DIR) INITIAL_BOOTSTRAP_LINK_STAMP = stamps/bootstrap-directory-symlink-ecj.stamp + RUNTIME = $(BOOT_DIR)/jre/lib/rt.jar else BOOTSTRAP_DIRECTORY_STAMP = ICEDTEA_HOME = $(SYSTEM_JDK_DIR) INITIAL_BOOTSTRAP_LINK_STAMP = stamps/bootstrap-directory-symlink.stamp + RUNTIME = $(BOOT_DIR)/jre/lib/rt.jar:$(BOOT_DIR)/jre/lib/jsse.jar endif if CP_SUPPORTS_REFLINK From chrisjones at comcen.com.au Mon Oct 18 15:33:29 2010 From: chrisjones at comcen.com.au (Chris Jones) Date: Tue, 19 Oct 2010 08:33:29 +1000 Subject: openjdk, icedtea and keepvid.com Message-ID: <1287441209.2636.2.camel@foxbox> I just thought it might be worth pointing out that I've recently had to dump openjdk and icedtea plugin in favor of the proper sun-java packages due to openjdk not working with www.keepvid.com I don't know whether it's a problem that could be fixed or not. -- Chris Jones PHOTO RESOLUTIONS - Photo - Graphic - Web www: http://photoresolutions.freehostia.com @: chrisjones at comcen.com.au ABN: 98 317 740 240 From andrew at icedtea.classpath.org Mon Oct 18 16:15:19 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Mon, 18 Oct 2010 23:15:19 +0000 Subject: /hg/icedtea6-hg: 24 new changesets Message-ID: changeset 94f30c67c2f9 in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=94f30c67c2f9 author: Andrew Su date: Fri Oct 01 11:39:33 2010 -0400 Set handle when creating panel, and remove the redundant reframe called afterwards. changeset 748a45decac0 in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=748a45decac0 author: Omair Majid date: Mon Oct 04 11:05:17 2010 -0400 netx: show the filename when an untrusted program requests opening a file 2010-10-04 Omair Majid * netx/net/sourceforge/jnlp/resources/Messages.properties: Add AFileOnTheMachine, change SFileReadAccess and SFileWriteAccess. * netx/net/sourceforge/jnlp/security/AccessWarningPane.java: (addComponents): Add the filename to the message. * netx/net/sourceforge/jnlp/services/XExtendedService.java: (openFile): Pass along the filename to ServiceUtil.checkAccess. * netx/net/sourceforge/jnlp/util/FileUtils.java: (displayablePath): New method. (displayablePath): Likewise. changeset 145255946142 in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=145255946142 author: Omair Majid date: Mon Oct 04 11:13:32 2010 -0400 plugin: do not shadow specVersion and fileVersion 2010-10-04 Omair Majid * /netx/net/sourceforge/jnlp/PluginBridge.java Do not shadow specVersion and fileVersion variables by redeclaring them. (PluginBridge): Initialize specVersion and fileVersion. changeset f41b0a7fbd70 in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=f41b0a7fbd70 author: Omair Majid date: Mon Oct 04 18:13:02 2010 -0400 PR554: System.err writes content two times 2010-10-04 Paul Ebermann Omair Majid Fixes PR554. * plugin/icedteanp/java/sun/applet/PluginMain.java (write): Remove method. changeset 4698e476b886 in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=4698e476b886 author: Omair Majid date: Fri Oct 08 11:06:14 2010 -0400 netx: add -Xclearcache to clear the cache 2010-10-08 Omair Majid * NEWS: Updated * net/sourceforge/jnlp/Launcher.java: Add fileLock. (launchApplication): Call markNetxRunning and install a shutdown hook for markNetxStopped. (markNetxRunning): New method. (markNetxStopped): New method. * net/sourceforge/jnlp/cache/CacheUtil.java (R): New method. (clearCache): New method. (okToClearCache): New method. * net/sourceforge/jnlp/resources/Messages.properties: Add BXclearcache and CCannotClearCache. * net/sourceforge/jnlp/runtime/Boot.java (run): Clear the cache. * net/sourceforge/jnlp/runtime/JNLPRuntime.java: Add NETX_RUNNING_FILE. * net/sourceforge/jnlp/util/FileUtils.java (recursiveDelete): New method. changeset a18694f7c8fa in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=a18694f7c8fa author: doko at ubuntu.com date: Tue Oct 12 13:32:46 2010 +0200 Makefile.am (stamps/add-netx.stamp): Create target directories. This fails otherwise, when BUILD_* and ALT_*_DIST environment vars are used as with --with-additional-vms=zero. 2010-10-12 Matthias Klose * Makefile.am (stamps/add-netx.stamp): Create target directories. changeset 0e69fee3cd86 in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=0e69fee3cd86 author: doko at ubuntu.com date: Tue Oct 12 22:13:50 2010 +0200 Fix build failures --with-additional-vms=zero/shark - Revert the last change - Robustify installation of files into directories, which might not exist - Work around assumptions made by several icedtea components 2010-10-12 Matthias Klose * Makefile.am (stamps/add-plugin.stamp, stamps/add-plugin- debug.stamp, stamps/add-pulseaudio-debug.stamp, stamps/add- plugin-ecj.stamp): Robustify. (ADD_ZERO_CONFIGURE_ARGS): Adjust to new configure flags. (stamps/add-zero.stamp): Explicitly create directories that icedtea components assume to be created by the jdk build (not built in zerovm). changeset d8115f447e6f in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=d8115f447e6f author: andrew date: Tue Oct 05 13:56:11 2010 +0100 Security updates for 2010/10/12. 2010-10-05 Andrew John Hughes * patches/security/20100330/hotspot/original/6626217.patch: Remove dead security patch. * Makefile.am: Add new patches. * NEWS: List security updates. * patches/security/20101012/6559775.patch, * patches/security/20101012/6891766.patch, * patches/security/20101012/6914943.patch, * patches/security/20101012/6925710.patch, * patches/security/20101012/6938813.patch, * patches/security/20101012/6957564.patch, * patches/security/20101012/6958060.patch, * patches/security/20101012/6963023.patch, * patches/security/20101012/6963489.patch, * patches/security/20101012/6966692.patch: New security patches. changeset 420a4eede08d in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=420a4eede08d author: andrew date: Mon Oct 11 21:05:13 2010 +0100 Second batch of security updates. 2010-10-11 Andrew John Hughes * patches/icedtea-timerqueue.patch: Dropped; superceded by 6623943. * Makefile.am: Add new security patches. * NEWS: List new security patches. * patches/security/20101012/6622002.patch, * patches/security/20101012/6623943.patch, * patches/security/20101012/6952017.patch, * patches/security/20101012/6952603.patch, * patches/security/20101012/6961084.patch, * patches/security/20101012/6963285.patch, * patches/security/20101012/6981426.patch, * patches/security/20101012/6990437.patch: Added. changeset f4f7b88ae02c in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=f4f7b88ae02c author: andrew date: Mon Oct 11 21:06:13 2010 +0100 Merge changeset 2c5c2c6f314a in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=2c5c2c6f314a author: andrew date: Mon Oct 11 22:31:47 2010 +0100 Add CVE numbers. 2010-10-11 Andrew John Hughes * NEWS: Add CVE numbers and list 6925672 which is covered by the 6891766 fix. changeset c66cf32a25db in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=c66cf32a25db author: andrew date: Wed Oct 13 00:25:56 2010 +0100 Merge changeset 01c094e27afd in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=01c094e27afd author: andrew date: Wed Oct 13 01:31:53 2010 +0100 Add 1.7.5, 1.8.2 and 1.9.1 releases. 2010-10-13 Andrew John Hughes * NEWS: Add 1.7.5, 1.8.2 and 1.9.1 releases. changeset be9262040bbc in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=be9262040bbc author: doko at ubuntu.com date: Thu Oct 14 13:25:44 2010 +0200 New configure option --with-llvm-config 2010-10-14 Matthias Klose * configure.ac: New option --with-llvm-config. * INSTALL: Document it. changeset 519a6f970eba in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=519a6f970eba author: Omair Majid date: Thu Oct 14 15:59:52 2010 -0400 plugin: Fix PR565: allow applets to have their own look and feels 2010-10-14 Omair Majid Fixes PR565 * NEWS: Update with fix. * netx/net/sourceforge/jnlp/Launcher.java: Make mainGroup package- private so NetxPanel can access it. (createThreadGroup): Only create a new AppThreadGroup if not a plugin. (run): Update comments and make dependence on SunToolkit explicit. * netx/net/sourceforge/jnlp/NetxPanel.java (run): New method. Create a new AppContext for the applet. (createAppletThread): Create a new AppThreadGroup and start the applet thread in that ThreadGroup. * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: Add new private variable appContext. (ApplicationInstance): Initialize appContext. (getAppContext): New method. * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: Extend AWTSecurityManager. (JNLPSecurityManager): Save the AppContext. (getAppContext): New method. Traverse the stack to find the application and return its AppContext. changeset 12902038b45b in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=12902038b45b author: ptisnovs date: Fri Oct 15 15:32:50 2010 +0200 Added patch which fixes bug #6853592 changeset d7e98386c764 in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=d7e98386c764 author: ptisnovs date: Mon Oct 18 14:39:08 2010 +0200 Added patch which fixes bug #6703377, corrected location of patch patches/openjdk/6853592-badwindow-warning-fix.patch in Makefile.am changeset a944742cdfa9 in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=a944742cdfa9 author: Andrew John Hughes date: Mon Oct 18 16:04:02 2010 +0100 Build NetX normally without setting an empty bootclasspath. 2010-10-18 Andrew John Hughes * Makefile.am: (NETX_SUN_CLASSES): List internal Sun class dependencies of NetX. (netx): Build normally without setting the bootclasspath empty. changeset 40cb6a09efea in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=40cb6a09efea author: Omair Majid date: Mon Oct 18 12:31:46 2010 -0400 netx: do not prompt user multiple times for the same certificate 2010-10-18 Omair Majid * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java: Add temporarilyUntrusted. (checkServerTrusted): Only prompt user if the certificate was not untrusted. (temporarilyUntrust): New method. (isTemporarilyUntrusted): New method. changeset 003328ca1070 in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=003328ca1070 author: Omair Majid date: Mon Oct 18 14:10:30 2010 -0400 add jsse.jar to RUNTIME to allow netx to build changeset b2629d02d55f in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=b2629d02d55f author: Andrew John Hughes date: Mon Oct 18 20:14:50 2010 +0100 Build plugin without setting bootclasspath to empty. Fix build breakage. 2010-10-18 Andrew John Hughes * Makefile.am: (RUNTIME): Revert Omair's change which breaks the standard build. (PLUGIN_BOOTSTRAP_CLASSES): Add java.net dependencies not yet in gcj. (PLUGIN_SUN_CLASSES): Add bad internal class dependencies of plugin. (liveconnect): Build without setting bootclasspath to empty. changeset afdd3f284524 in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=afdd3f284524 author: Andrew John Hughes date: Mon Oct 18 21:29:09 2010 +0100 Define RUNTIME conditionally to handle jsse.jar correctly. 2010-10-18 Andrew John Hughes * Makefile.am: (RUNTIME): Define conditionally, so that jsse.jar is added when not bootstrapping. changeset da3370139f63 in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=da3370139f63 author: Andrew John Hughes date: Mon Oct 18 21:32:54 2010 +0100 Merge changeset 5bc57773f41d in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=5bc57773f41d author: Andrew John Hughes date: Tue Oct 19 00:15:10 2010 +0100 Handle move to hs19 upstream, dropping Shark. Drop TimerQueue patch applied upstream. 2010-10-18 Andrew John Hughes * patches/hotspot/hs19/alpha-fixes.patch, * patches/hotspot/hs19/gcc-suffix.patch, * patches/hotspot/hs19/params-cast-size_t.patch, * patches/hotspot/hs19/print_lsb_release.patch, * patches/hotspot/hs19/update-bootclasspath.patch: Move to patches. hs19 is now the only option. * patches/hotspot/original/alpha-fixes.patch, * patches/hotspot/original/gcc-suffix.patch, * patches/hotspot/original/params-cast-size_t.patch, * patches/hotspot/original/print_lsb_release.patch, * patches/hotspot/original/update-bootclasspath.patch: Dropped; upstream moved from hs17 to hs19. * patches/icedtea-shark-build.patch: Applied upstream by Gary Benson. * patches/security/20101012/6623943.patch: Applied upstream by Omair Majid. * shark/hotspot/make/linux/makefiles/shark.make, * shark/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp, * shark/hotspot/src/share/vm/includeDB_shark, * shark/hotspot/src/share/vm/shark/llvmHeaders.hpp, * shark/hotspot/src/share/vm/shark/llvmValue.hpp, * shark/hotspot/src/share/vm/shark/sharkBlock.cpp, * shark/hotspot/src/share/vm/shark/sharkBlock.hpp, * shark/hotspot/src/share/vm/shark/sharkBuilder.cpp, * shark/hotspot/src/share/vm/shark/sharkBuilder.hpp, * shark/hotspot/src/share/vm/shark/sharkCacheDecache.cpp, * shark/hotspot/src/share/vm/shark/sharkCacheDecache.hpp, * shark/hotspot/src/share/vm/shark/sharkCodeBuffer.hpp, * shark/hotspot/src/share/vm/shark/sharkCompiler.cpp, * shark/hotspot/src/share/vm/shark/sharkCompiler.hpp, * shark/hotspot/src/share/vm/shark/sharkConstant.cpp, * shark/hotspot/src/share/vm/shark/sharkConstant.hpp, * shark/hotspot/src/share/vm/shark/sharkContext.cpp, * shark/hotspot/src/share/vm/shark/sharkContext.hpp, * shark/hotspot/src/share/vm/shark/sharkEntry.hpp, * shark/hotspot/src/share/vm/shark/sharkFunction.cpp, * shark/hotspot/src/share/vm/shark/sharkFunction.hpp, * shark/hotspot/src/share/vm/shark/sharkInliner.cpp, * shark/hotspot/src/share/vm/shark/sharkInliner.hpp, * shark/hotspot/src/share/vm/shark/sharkIntrinsics.cpp, * shark/hotspot/src/share/vm/shark/sharkIntrinsics.hpp, * shark/hotspot/src/share/vm/shark/sharkInvariants.cpp, * shark/hotspot/src/share/vm/shark/sharkInvariants.hpp, * shark/hotspot/src/share/vm/shark/sharkMemoryManager.cpp, * shark/hotspot/src/share/vm/shark/sharkMemoryManager.hpp, * shark/hotspot/src/share/vm/shark/sharkNativeWrapper.cpp, * shark/hotspot/src/share/vm/shark/sharkNativeWrapper.hpp, * shark/hotspot/src/share/vm/shark/sharkRuntime.cpp, * shark/hotspot/src/share/vm/shark/sharkRuntime.hpp, * shark/hotspot/src/share/vm/shark/sharkStack.cpp, * shark/hotspot/src/share/vm/shark/sharkStack.hpp, * shark/hotspot/src/share/vm/shark/sharkState.cpp, * shark/hotspot/src/share/vm/shark/sharkState.hpp, * shark/hotspot/src/share/vm/shark/sharkStateScanner.cpp, * shark/hotspot/src/share/vm/shark/sharkStateScanner.hpp, * shark/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp, * shark/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp, * shark/hotspot/src/share/vm/shark/sharkType.hpp, * shark/hotspot/src/share/vm/shark/sharkValue.cpp, * shark/hotspot/src/share/vm/shark/sharkValue.hpp, * shark/hotspot/src/share/vm/shark/shark_globals.cpp, * shark/hotspot/src/share/vm/shark/shark_globals.hpp: Shark is in HotSpot 19. * Makefile.am: (ICEDTEA_PATCHES): Remove $(HSBUILD) special casing. Remove conditional !WITH_ALT_HSBUILD patches. (ports): Drop !WITH_ALT_HSBUILD block. (clean-ports): Likewise. * hotspot.map: Remove hs19. * patches/alpha-fixes.patch, * patches/gcc-suffix.patch, * patches/params-cast-size_t.patch, * patches/print_lsb_release.patch, * patches/update-bootclasspath.patch: The hs19 patches moved above. * acinclude.m4: (AC_CHECK_WITH_HOTSPOT_BUILD): Default to original. diffstat: 116 files changed, 6337 insertions(+), 15408 deletions(-) ChangeLog | 316 + INSTALL | 1 Makefile.am | 176 NEWS | 145 acinclude.m4 | 2 configure.ac | 17 hotspot.map | 1 netx/net/sourceforge/jnlp/Launcher.java | 100 netx/net/sourceforge/jnlp/NetxPanel.java | 24 netx/net/sourceforge/jnlp/PluginBridge.java | 4 netx/net/sourceforge/jnlp/cache/CacheUtil.java | 71 netx/net/sourceforge/jnlp/resources/Messages.properties | 7 netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java | 21 netx/net/sourceforge/jnlp/runtime/Boot.java | 13 netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java | 10 netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java | 39 netx/net/sourceforge/jnlp/security/AccessWarningPane.java | 15 netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java | 38 netx/net/sourceforge/jnlp/services/XExtendedService.java | 4 netx/net/sourceforge/jnlp/util/FileUtils.java | 88 patches/6703377-freetypescaler.patch | 11 patches/alpha-fixes.patch | 21 patches/gcc-suffix.patch | 31 patches/hotspot/hs19/alpha-fixes.patch | 21 patches/hotspot/hs19/gcc-suffix.patch | 31 patches/hotspot/hs19/params-cast-size_t.patch | 264 - patches/hotspot/hs19/print_lsb_release.patch | 49 patches/hotspot/hs19/update-bootclasspath.patch | 13 patches/hotspot/original/alpha-fixes.patch | 31 patches/hotspot/original/gcc-suffix.patch | 25 patches/hotspot/original/params-cast-size_t.patch | 274 - patches/hotspot/original/print_lsb_release.patch | 48 patches/hotspot/original/update-bootclasspath.patch | 13 patches/icedtea-jtreg-jrunscript.patch | 12 patches/icedtea-shark-build.patch | 16 patches/icedtea-timerqueue.patch | 18 patches/openjdk/4356282-opentype.patch | 227 - patches/openjdk/6438179-systray_check.patch | 92 patches/openjdk/6678385-window_movement_crasher.patch | 1241 ----- patches/openjdk/6721088-awt_window_size.patch | 67 patches/openjdk/6795060-icu_crash.patch | 95 patches/openjdk/6853592-badwindow-warning-fix.patch | 16 patches/openjdk/6951319-sparc_build_fixes.patch | 24 patches/openjdk/6954424-opentype_javadoc.patch | 23 patches/openjdk/6961732-negative_leading.patch | 45 patches/openjdk/6969395-net_bugs.patch | 461 -- patches/openjdk/6985992-test_6933784.patch | 43 patches/params-cast-size_t.patch | 264 + patches/print_lsb_release.patch | 49 patches/security/20100330/hotspot/original/6626217.patch | 180 patches/security/20101012/6559775.patch | 317 + patches/security/20101012/6622002.patch | 64 patches/security/20101012/6891766.patch | 1147 +++++ patches/security/20101012/6914943.patch | 2129 ++++++++++ patches/security/20101012/6925710.patch | 198 patches/security/20101012/6938813.patch | 196 patches/security/20101012/6952017.patch | 50 patches/security/20101012/6952603.patch | 38 patches/security/20101012/6957564.patch | 77 patches/security/20101012/6958060.patch | 15 patches/security/20101012/6961084.patch | 325 + patches/security/20101012/6963023.patch | 95 patches/security/20101012/6963285.patch | 20 patches/security/20101012/6963489.patch | 31 patches/security/20101012/6966692.patch | 91 patches/security/20101012/6981426.patch | 24 patches/security/20101012/6990437.patch | 116 patches/update-bootclasspath.patch | 13 plugin/icedteanp/java/sun/applet/PluginAppletViewer.java | 8 plugin/icedteanp/java/sun/applet/PluginMain.java | 8 shark/hotspot/make/linux/makefiles/shark.make | 32 shark/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp | 62 shark/hotspot/src/share/vm/includeDB_shark | 369 - shark/hotspot/src/share/vm/shark/llvmHeaders.hpp | 82 shark/hotspot/src/share/vm/shark/llvmValue.hpp | 62 shark/hotspot/src/share/vm/shark/sharkBlock.cpp | 1260 ----- shark/hotspot/src/share/vm/shark/sharkBlock.hpp | 281 - shark/hotspot/src/share/vm/shark/sharkBuilder.cpp | 591 -- shark/hotspot/src/share/vm/shark/sharkBuilder.hpp | 209 shark/hotspot/src/share/vm/shark/sharkCacheDecache.cpp | 259 - shark/hotspot/src/share/vm/shark/sharkCacheDecache.hpp | 417 - shark/hotspot/src/share/vm/shark/sharkCodeBuffer.hpp | 87 shark/hotspot/src/share/vm/shark/sharkCompiler.cpp | 340 - shark/hotspot/src/share/vm/shark/sharkCompiler.hpp | 119 shark/hotspot/src/share/vm/shark/sharkConstant.cpp | 128 shark/hotspot/src/share/vm/shark/sharkConstant.hpp | 64 shark/hotspot/src/share/vm/shark/sharkContext.cpp | 180 shark/hotspot/src/share/vm/shark/sharkContext.hpp | 187 shark/hotspot/src/share/vm/shark/sharkEntry.hpp | 58 shark/hotspot/src/share/vm/shark/sharkFunction.cpp | 188 shark/hotspot/src/share/vm/shark/sharkFunction.hpp | 111 shark/hotspot/src/share/vm/shark/sharkInliner.cpp | 749 --- shark/hotspot/src/share/vm/shark/sharkInliner.hpp | 32 shark/hotspot/src/share/vm/shark/sharkIntrinsics.cpp | 277 - shark/hotspot/src/share/vm/shark/sharkIntrinsics.hpp | 54 shark/hotspot/src/share/vm/shark/sharkInvariants.cpp | 37 shark/hotspot/src/share/vm/shark/sharkInvariants.hpp | 167 shark/hotspot/src/share/vm/shark/sharkMemoryManager.cpp | 116 shark/hotspot/src/share/vm/shark/sharkMemoryManager.hpp | 88 shark/hotspot/src/share/vm/shark/sharkNativeWrapper.cpp | 352 - shark/hotspot/src/share/vm/shark/sharkNativeWrapper.hpp | 182 shark/hotspot/src/share/vm/shark/sharkRuntime.cpp | 251 - shark/hotspot/src/share/vm/shark/sharkRuntime.hpp | 83 shark/hotspot/src/share/vm/shark/sharkStack.cpp | 263 - shark/hotspot/src/share/vm/shark/sharkStack.hpp | 290 - shark/hotspot/src/share/vm/shark/sharkState.cpp | 389 - shark/hotspot/src/share/vm/shark/sharkState.hpp | 188 shark/hotspot/src/share/vm/shark/sharkStateScanner.cpp | 99 shark/hotspot/src/share/vm/shark/sharkStateScanner.hpp | 75 shark/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp | 1991 --------- shark/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp | 430 -- shark/hotspot/src/share/vm/shark/sharkType.hpp | 112 shark/hotspot/src/share/vm/shark/sharkValue.cpp | 260 - shark/hotspot/src/share/vm/shark/sharkValue.hpp | 332 - shark/hotspot/src/share/vm/shark/shark_globals.cpp | 29 shark/hotspot/src/share/vm/shark/shark_globals.hpp | 54 diffs (truncated from 22870 to 500 lines): diff -r 14ed93e7ecc5 -r 5bc57773f41d ChangeLog --- a/ChangeLog Thu Sep 30 11:10:01 2010 +0100 +++ b/ChangeLog Tue Oct 19 00:15:10 2010 +0100 @@ -1,3 +1,268 @@ 2010-09-29 Andrew John Hughes + + * patches/hotspot/hs19/alpha-fixes.patch, + * patches/hotspot/hs19/gcc-suffix.patch, + * patches/hotspot/hs19/params-cast-size_t.patch, + * patches/hotspot/hs19/print_lsb_release.patch, + * patches/hotspot/hs19/update-bootclasspath.patch: + Move to patches. hs19 is now the only option. + * patches/hotspot/original/alpha-fixes.patch, + * patches/hotspot/original/gcc-suffix.patch, + * patches/hotspot/original/params-cast-size_t.patch, + * patches/hotspot/original/print_lsb_release.patch, + * patches/hotspot/original/update-bootclasspath.patch: + Dropped; upstream moved from hs17 to hs19. + * patches/icedtea-shark-build.patch: + Applied upstream by Gary Benson. + * patches/security/20101012/6623943.patch: + Applied upstream by Omair Majid. + * shark/hotspot/make/linux/makefiles/shark.make, + * shark/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp, + * shark/hotspot/src/share/vm/includeDB_shark, + * shark/hotspot/src/share/vm/shark/llvmHeaders.hpp, + * shark/hotspot/src/share/vm/shark/llvmValue.hpp, + * shark/hotspot/src/share/vm/shark/sharkBlock.cpp, + * shark/hotspot/src/share/vm/shark/sharkBlock.hpp, + * shark/hotspot/src/share/vm/shark/sharkBuilder.cpp, + * shark/hotspot/src/share/vm/shark/sharkBuilder.hpp, + * shark/hotspot/src/share/vm/shark/sharkCacheDecache.cpp, + * shark/hotspot/src/share/vm/shark/sharkCacheDecache.hpp, + * shark/hotspot/src/share/vm/shark/sharkCodeBuffer.hpp, + * shark/hotspot/src/share/vm/shark/sharkCompiler.cpp, + * shark/hotspot/src/share/vm/shark/sharkCompiler.hpp, + * shark/hotspot/src/share/vm/shark/sharkConstant.cpp, + * shark/hotspot/src/share/vm/shark/sharkConstant.hpp, + * shark/hotspot/src/share/vm/shark/sharkContext.cpp, + * shark/hotspot/src/share/vm/shark/sharkContext.hpp, + * shark/hotspot/src/share/vm/shark/sharkEntry.hpp, + * shark/hotspot/src/share/vm/shark/sharkFunction.cpp, + * shark/hotspot/src/share/vm/shark/sharkFunction.hpp, + * shark/hotspot/src/share/vm/shark/sharkInliner.cpp, + * shark/hotspot/src/share/vm/shark/sharkInliner.hpp, + * shark/hotspot/src/share/vm/shark/sharkIntrinsics.cpp, + * shark/hotspot/src/share/vm/shark/sharkIntrinsics.hpp, + * shark/hotspot/src/share/vm/shark/sharkInvariants.cpp, + * shark/hotspot/src/share/vm/shark/sharkInvariants.hpp, + * shark/hotspot/src/share/vm/shark/sharkMemoryManager.cpp, + * shark/hotspot/src/share/vm/shark/sharkMemoryManager.hpp, + * shark/hotspot/src/share/vm/shark/sharkNativeWrapper.cpp, + * shark/hotspot/src/share/vm/shark/sharkNativeWrapper.hpp, + * shark/hotspot/src/share/vm/shark/sharkRuntime.cpp, + * shark/hotspot/src/share/vm/shark/sharkRuntime.hpp, + * shark/hotspot/src/share/vm/shark/sharkStack.cpp, + * shark/hotspot/src/share/vm/shark/sharkStack.hpp, + * shark/hotspot/src/share/vm/shark/sharkState.cpp, + * shark/hotspot/src/share/vm/shark/sharkState.hpp, + * shark/hotspot/src/share/vm/shark/sharkStateScanner.cpp, + * shark/hotspot/src/share/vm/shark/sharkStateScanner.hpp, + * shark/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp, + * shark/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp, + * shark/hotspot/src/share/vm/shark/sharkType.hpp, + * shark/hotspot/src/share/vm/shark/sharkValue.cpp, + * shark/hotspot/src/share/vm/shark/sharkValue.hpp, + * shark/hotspot/src/share/vm/shark/shark_globals.cpp, + * shark/hotspot/src/share/vm/shark/shark_globals.hpp: + Shark is in HotSpot 19. + * Makefile.am: + (ICEDTEA_PATCHES): Remove $(HSBUILD) special casing. + Remove conditional !WITH_ALT_HSBUILD patches. + (ports): Drop !WITH_ALT_HSBUILD block. + (clean-ports): Likewise. + * hotspot.map: Remove hs19. + * patches/alpha-fixes.patch, + * patches/gcc-suffix.patch, + * patches/params-cast-size_t.patch, + * patches/print_lsb_release.patch, + * patches/update-bootclasspath.patch: + The hs19 patches moved above. + * acinclude.m4: + (AC_CHECK_WITH_HOTSPOT_BUILD): Default to original. + +2010-10-18 Andrew John Hughes + + * Makefile.am: + (RUNTIME): Define conditionally, so that + jsse.jar is added when not bootstrapping. + +2010-10-18 Andrew John Hughes + + * Makefile.am: + (RUNTIME): Revert Omair's change which breaks + the standard build. + (PLUGIN_BOOTSTRAP_CLASSES): Add java.net dependencies + not yet in gcj. + (PLUGIN_SUN_CLASSES): Add bad internal class dependencies + of plugin. + (liveconnect): Build without setting bootclasspath to empty. + +2010-10-18 Omair Majid + + * Makefile.am (RUNTIME): Add jsse.jar to classpath. It is required + for building netx with --disable-bootstrap. + +2010-10-18 Omair Majid + + * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java: + Add temporarilyUntrusted. + (checkServerTrusted): Only prompt user if the certificate was not + untrusted. + (temporarilyUntrust): New method. + (isTemporarilyUntrusted): New method. + +2010-10-18 Andrew John Hughes + + * Makefile.am: + (NETX_SUN_CLASSES): List internal Sun class + dependencies of NetX. + (netx): Build normally without setting the + bootclasspath empty. + +2010-10-18 Pavel Tisnovsky + + * Makefile.am: + Corrected location of patch + patches/openjdk/6853592-badwindow-warning-fix.patch + in Makefile.am + * patches/6703377-freetypescaler.patch: + Added patch which fixes bug #6703377 + +2010-10-15 Pavel Tisnovsky + + * patches/openjdk/6853592-badwindow-warning-fix.patch: + Added patch which fixes bug #6853592 introduced by another patch + 6678385-window_movement_crasher.patch + +2010-10-14 Omair Majid + + Fixes PR565 + * NEWS: Update with fix. + * netx/net/sourceforge/jnlp/Launcher.java: + Make mainGroup package-private so NetxPanel can access it. + (createThreadGroup): Only create a new AppThreadGroup if not a plugin. + (run): Update comments and make dependence on SunToolkit explicit. + * netx/net/sourceforge/jnlp/NetxPanel.java + (run): New method. Create a new AppContext for the applet. + (createAppletThread): Create a new AppThreadGroup and start the applet + thread in that ThreadGroup. + * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: + Add new private variable appContext. + (ApplicationInstance): Initialize appContext. + (getAppContext): New method. + * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: + Extend AWTSecurityManager. + (JNLPSecurityManager): Save the AppContext. + (getAppContext): New method. Traverse the stack to find the application + and return its AppContext. + +2010-10-14 Matthias Klose + + * configure.ac: New option --with-llvm-config. + * INSTALL: Document it. + +2010-10-13 Andrew John Hughes + + * NEWS: + Add 1.7.5, 1.8.2 and 1.9.1 releases. + +2010-10-12 Matthias Klose + + * Makefile.am (stamps/add-plugin.stamp, stamps/add-plugin-debug.stamp, + stamps/add-pulseaudio-debug.stamp, stamps/add-plugin-ecj.stamp): Robustify. + (ADD_ZERO_CONFIGURE_ARGS): Adjust to new configure flags. + (stamps/add-zero.stamp): Explicitly create directories that icedtea + components assume to be created by the jdk build (not built in zerovm). + +2010-10-11 Andrew John Hughes + + * NEWS: Add CVE numbers and list 6925672 + which is covered by the 6891766 fix. + +2010-10-11 Andrew John Hughes + + * patches/icedtea-timerqueue.patch: + Dropped; superceded by 6623943. + * Makefile.am: Add new security patches. + * NEWS: List new security patches. + * patches/security/20101012/6622002.patch, + * patches/security/20101012/6623943.patch, + * patches/security/20101012/6952017.patch, + * patches/security/20101012/6952603.patch, + * patches/security/20101012/6961084.patch, + * patches/security/20101012/6963285.patch, + * patches/security/20101012/6981426.patch, + * patches/security/20101012/6990437.patch: + Added. + +2010-10-08 Omair Majid + + * NEWS: Updated + * net/sourceforge/jnlp/Launcher.java: Add fileLock. + (launchApplication): Call markNetxRunning and install a shutdown hook for + markNetxStopped. + (markNetxRunning): New method. + (markNetxStopped): New method. + * net/sourceforge/jnlp/cache/CacheUtil.java + (R): New method. + (clearCache): New method. + (okToClearCache): New method. + * net/sourceforge/jnlp/resources/Messages.properties: Add BXclearcache and + CCannotClearCache. + * net/sourceforge/jnlp/runtime/Boot.java + (run): Clear the cache. + * net/sourceforge/jnlp/runtime/JNLPRuntime.java: Add NETX_RUNNING_FILE. + * net/sourceforge/jnlp/util/FileUtils.java + (recursiveDelete): New method. + +2010-10-05 Andrew John Hughes + + * patches/security/20100330/hotspot/original/6626217.patch: + Remove dead security patch. + * Makefile.am: Add new patches. + * NEWS: List security updates. + * patches/security/20101012/6559775.patch, + * patches/security/20101012/6891766.patch, + * patches/security/20101012/6914943.patch, + * patches/security/20101012/6925710.patch, + * patches/security/20101012/6938813.patch, + * patches/security/20101012/6957564.patch, + * patches/security/20101012/6958060.patch, + * patches/security/20101012/6963023.patch, + * patches/security/20101012/6963489.patch, + * patches/security/20101012/6966692.patch: + New security patches. + +2010-10-04 Paul Ebermann + Omair Majid + + Fixes PR554. + * plugin/icedteanp/java/sun/applet/PluginMain.java + (write): Remove method. + +2010-10-04 Omair Majid + + * /netx/net/sourceforge/jnlp/PluginBridge.java + Do not shadow specVersion and fileVersion variables by redeclaring them. + (PluginBridge): Initialize specVersion and fileVersion. + +2010-10-04 Omair Majid + + * netx/net/sourceforge/jnlp/resources/Messages.properties: + Add AFileOnTheMachine, change SFileReadAccess and SFileWriteAccess. + * netx/net/sourceforge/jnlp/security/AccessWarningPane.java: + (addComponents): Add the filename to the message. + * netx/net/sourceforge/jnlp/services/XExtendedService.java: + (openFile): Pass along the filename to ServiceUtil.checkAccess. + * netx/net/sourceforge/jnlp/util/FileUtils.java: + (displayablePath): New method. + (displayablePath): Likewise. + +2010-10-01 Andrew Su + + * PluginAppletViewer.java: + (createPanel): Changed call to reframe with handle 0 to the handle + passed in. + (handleMessage): Removed the redundant reframe from initialization. + 2010-09-29 Andrew John Hughes * Makefile.am: @@ -69,6 +334,14 @@ 2010-09-23 Andrew John Hughes + + * patches/icedtea-awt-window-size.patch, + * patches/openjdk/6969395-net_bugs.patch, + * patches/openjdk/6985992-test_6933784.patch: + Dropped; upstreamed. + * Makefile.am: Remove above patches. 2010-09-23 Andrew John Hughes @@ -409,6 +682,15 @@ 2010-09-07 Andrew John Hughes + + * patches/openjdk/6438179-systray_check.patch: + Dropped, applied upstream. + * Makefile.am: Drop above patch and those brought + back by merge. Update JAXP tarball. + * patches/openjdk/6951319-sparc_build_fixes.patch: + Remove upstreamed parts. + 2010-09-03 Pavel Tisnovsky * Makefile.am: Fixed indentation, changes spaces to tab. @@ -458,7 +740,7 @@ 2010-08-27 Deepak Bhole - * Makefile.am: + * Makefile.am: Add patch. * patches/opengl-jni-fix.patch: Fixed missing JNI link to native function OGLContext.getOGLIdString() which causes @@ -545,6 +827,22 @@ 2010-08-13 Andrew John Hughes + + * patches/openjdk/4356282-opentype.patch, + * patches/openjdk/6795060-icu_crash.patch, + * patches/openjdk/6954424-opentype_javadoc.patch: + Dropped, applied upstream. + * Makefile.am: + Remove above patches. + +2010-08-12 Andrew John Hughes + + * patches/openjdk/6678385-window_movement_crasher.patch: + Dropped, applied upstream. + * Makefile.am: + Remove above patch. 2010-08-09 Omair Majid @@ -586,7 +884,7 @@ 2010-08-09 Deepak Bhole @@ -898,6 +1196,12 @@ 2010-07-28 Matthias Klose * NEWS: Add 1.8.1 entry. + +2010-07-26 Andrew John Hughes + + * patches/icedtea-jtreg-jrunscript.patch: + Regenerate after 50002bfcff96 from dcubed being + added to OpenJDK6. 2010-07-26 Andrew John Hughes @@ -1347,6 +1651,12 @@ 2010-07-08 Andrew John Hughes + + * patches/openjdk/6961732.patch: + Dropped, applied upstream. + * Makefile.am: Remove above patch. 2010-07-06 Andrew John Hughes @@ -9640,7 +9950,7 @@ 2009-04-07 Omair Majid - * patches/icedtea-jtreg-jrunscript.patch: New patch. Replaces + * patches/icedtea-jtreg-jrunscript.patch: New patch. Replaces jrunscriptTest.sh with a java version that isnt picky about int vs double changes. * Makefile.am (ICEDTEA_PATCHES): Apply the above. diff -r 14ed93e7ecc5 -r 5bc57773f41d INSTALL --- a/INSTALL Thu Sep 30 11:10:01 2010 +0100 +++ b/INSTALL Tue Oct 19 00:15:10 2010 +0100 @@ -151,6 +151,7 @@ to configure: * --with-tzdata-dir: Specify the location of Java timezone data, defaulting to /usr/share/javazi. * --with-netbeans: Specify the location of NetBeans for VisualVM, defaulting to the netbeans on the path. * --with-abs-install-dir: The final install location of the j2sdk-image, for use in the SystemTap tapset. +* --with-llvm-config: Specify the location of the llvm-config binary. Other options may be supplied which enable or disable new features. These are documented fully in the relevant section below. diff -r 14ed93e7ecc5 -r 5bc57773f41d Makefile.am --- a/Makefile.am Thu Sep 30 11:10:01 2010 +0100 +++ b/Makefile.am Tue Oct 19 00:15:10 2010 +0100 @@ -17,9 +17,9 @@ JAF_DROP_URL = https://jax-ws.dev.java.n JAF_DROP_URL = https://jax-ws.dev.java.net/files/documents/4202/150725 JAF_DROP_ZIP = jdk6-jaf-b20.zip JAF_DROP_SHA256SUM = 78c7b5c9d6271e88ee46abadd018a61f1e9645f8936cc8df1617e5f4f5074012 -JAXP_DROP_URL = https://jaxp.dev.java.net/files/documents/913/150648 -JAXP_DROP_ZIP = jdk6-jaxp-b20.zip -JAXP_DROP_SHA256SUM = d097627d4059d488c5a09d4e33cec275a193d4d8bc0fea8ef4f1337170904156 +JAXP_DROP_URL = https://jaxp.dev.java.net/files/documents/913/152561 +JAXP_DROP_ZIP = jaxp-1_4_4.zip +JAXP_DROP_SHA256SUM = 10b203bec5b7d3dd8f515a9e098f80abc316faf977bcc220b56efe3dc6e9e5e9 OPENJDK_HG_URL = http://hg.openjdk.java.net/jdk6/jdk6 @@ -34,7 +34,6 @@ ICEDTEA_CLS_DIR = $(BUILD_OUTPUT_DIR)/cl ICEDTEA_CLS_DIR = $(BUILD_OUTPUT_DIR)/classes ICEDTEA_CLS_DIR_ECJ = $(ECJ_BUILD_OUTPUT_DIR)/classes BOOT_DIR = $(abs_top_builddir)/bootstrap/jdk1.6.0 -RUNTIME = $(BOOT_DIR)/jre/lib/rt.jar ENDORSED_DIR = $(BOOT_DIR)/lib/endorsed ECJ_BOOT_DIR = $(abs_top_builddir)/bootstrap/ecj ICEDTEA_BOOT_DIR = $(abs_top_builddir)/bootstrap/icedtea @@ -86,13 +85,47 @@ NETX_BOOTSTRAP_CLASSES = \ $(SHARE)/javax/swing/JTable.java \ $(SHARE)/java/security/KeyStore.java +# PR46074 - Missing java.net cookie code required by IcedTea plugin +PLUGIN_BOOTSTRAP_CLASSES = \ + $(SHARE)/java/net/CookieManager.java \ + $(SHARE)/java/net/HttpCookie.java \ + $(SHARE)/java/net/CookieHandler.java + +# IT563 - NetX uses sun.security code +# IT564 - NetX depends on sun.misc.BASE64Encoder +# IT570 - NetX depends on sun.applet.AppletViewPanel +# IT571 - NetX depends on com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager.java +NETX_SUN_CLASSES = \ + $(SHARE)/sun/security/provider/X509Factory.java \ + $(SHARE)/sun/security/util/SecurityConstants.java \ + $(SHARE)/sun/security/util/HostnameChecker.java \ + $(SHARE)/sun/security/util/DerValue.java \ + $(SHARE)/sun/security/x509/X500Name.java \ + $(SHARE)/sun/misc/BASE64Encoder.java \ + $(SHARE)/sun/applet/AppletViewerPanel.java \ + $(SHARE)/sun/security/validator/ValidatorException.java \ + $(SHARE)/com/sun/net/ssl/internal/ssl/X509ExtendedTrustManager.java + +# IT573 - Plugin depends on sun.awt,X11.XEmbeddedFrame.java +# IT574 - Plugin depends on sun.misc.Ref +# IT575 - Plugin depends on com.sun/jndi.toolkit.url.UrlUtil +# IT576 - Plugin depends on sun.applet.AppletImageRef +PLUGIN_SUN_CLASSES = \ + $(SOLARIS)/sun/awt/X11/XEmbeddedFrame.java \ + $(SHARE)/sun/misc/Ref.java \ + $(SHARE)/com/sun/jndi/toolkit/url/UrlUtil.java \ + $(SHARE)/sun/applet/AppletImageRef.java + # PR42003 - javax.swing.plaf.basic.BasicDirectoryModel # PR43389 - javax.management.StandardMBean ICEDTEA_BOOTSTRAP_CLASSES = \ $(SHARE)/javax/swing/plaf/basic/BasicDirectoryModel.java \ $(SHARE)/javax/management/StandardMBean.java \ $(SHARE)/com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel.java \ - $(NETX_BOOTSTRAP_CLASSES) + $(NETX_BOOTSTRAP_CLASSES) \ + $(NETX_SUN_CLASSES) \ + $(PLUGIN_BOOTSTRAP_CLASSES) \ + $(PLUGIN_SUN_CLASSES) # Flags IT_CFLAGS=$(CFLAGS) $(ARCHFLAG) @@ -156,10 +189,12 @@ if BOOTSTRAPPING BOOTSTRAP_DIRECTORY_STAMP = stamps/bootstrap-directory.stamp ICEDTEA_HOME = $(ICEDTEA_BOOT_DIR) INITIAL_BOOTSTRAP_LINK_STAMP = stamps/bootstrap-directory-symlink-ecj.stamp + RUNTIME = $(BOOT_DIR)/jre/lib/rt.jar else BOOTSTRAP_DIRECTORY_STAMP = ICEDTEA_HOME = $(SYSTEM_JDK_DIR) INITIAL_BOOTSTRAP_LINK_STAMP = stamps/bootstrap-directory-symlink.stamp + RUNTIME = $(BOOT_DIR)/jre/lib/rt.jar:$(BOOT_DIR)/jre/lib/jsse.jar endif if CP_SUPPORTS_REFLINK @@ -197,7 +232,29 @@ REWRITER_SRCS = $(abs_top_srcdir)/rewrit ICEDTEA_FSG_PATCHES = +BROKEN = + +SECURITY_PATCHES = \ + patches/security/20101012/6891766.patch \ + patches/security/20101012/6925710.patch \ + patches/security/20101012/6938813.patch \ + patches/security/20101012/6957564.patch \ + patches/security/20101012/6958060.patch \ + patches/security/20101012/6963023.patch \ + patches/security/20101012/6963489.patch \ + patches/security/20101012/6966692.patch \ + patches/security/20101012/6914943.patch \ + patches/security/20101012/6559775.patch \ + patches/security/20101012/6622002.patch \ + patches/security/20101012/6952017.patch \ + patches/security/20101012/6952603.patch \ + patches/security/20101012/6961084.patch \ + patches/security/20101012/6963285.patch \ + patches/security/20101012/6981426.patch \ + patches/security/20101012/6990437.patch From ahughes at redhat.com Mon Oct 18 16:27:52 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Tue, 19 Oct 2010 00:27:52 +0100 Subject: openjdk, icedtea and keepvid.com In-Reply-To: <1287441209.2636.2.camel@foxbox> References: <1287441209.2636.2.camel@foxbox> Message-ID: <20101018232752.GF31704@rivendell.middle-earth.co.uk> On 08:33 Tue 19 Oct , Chris Jones wrote: > I just thought it might be worth pointing out that I've recently had to > dump openjdk and icedtea plugin in favor of the proper sun-java packages > due to openjdk not working with www.keepvid.com > > I don't know whether it's a problem that could be fixed or not. > > > -- > > Chris Jones > > PHOTO RESOLUTIONS - Photo - Graphic - Web > www: http://photoresolutions.freehostia.com > @: chrisjones at comcen.com.au > ABN: 98 317 740 240 > Did you file a bug report at http://icedtea.classpath.org/bugzilla ? Nothing gets fixed if it's not reported. Doing so means issues can be fixed and it helps you, others and Free Software as a whole. In many cases, a lot of problems with the plugin are actually due to the applet itself doing something undocumented or making assumptions about running on the proprietary Oracle plugin. I'm not saying there aren't really bugs, but the problem with relying on a single solution (the Oracle proprietary plugin) is that these things do creep in. The same happened with websites and Internet Explorer at one time. -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From ahughes at redhat.com Mon Oct 18 16:29:15 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Tue, 19 Oct 2010 00:29:15 +0100 Subject: [RFC] netx/plugin: do not prompt user multiple times for the same Certificate In-Reply-To: <4CBC985B.4010709@redhat.com> References: <4CB769F9.7010202@redhat.com> <20101014210354.GE23588@redhat.com> <4CBC7B7A.7080506@redhat.com> <20101018173501.GD31704@rivendell.middle-earth.co.uk> <20101018174945.GC7818@redhat.com> <4CBC9350.7040608@redhat.com> <20101018184923.GA10030@redhat.com> <4CBC985B.4010709@redhat.com> Message-ID: <20101018232914.GG31704@rivendell.middle-earth.co.uk> On 14:56 Mon 18 Oct , Omair Majid wrote: > On 10/18/2010 02:49 PM, Deepak Bhole wrote: > > * Omair Majid [2010-10-18 14:34]: > >> On 10/18/2010 01:49 PM, Deepak Bhole wrote: > >>> * Dr Andrew John Hughes [2010-10-18 13:35]: > >>>> On 12:53 Mon 18 Oct , Omair Majid wrote: > >>>>> On 10/14/2010 05:03 PM, Deepak Bhole wrote: > >>>>>> * Omair Majid [2010-10-14 16:37]: > >>>>>>> Hi, > >>>>>>> > >>>>>>> In the current implementation of the plugin, when the user rejects a > >>>>>>> https certificate, the next time the https connection is attempted, > >>>>>>> another certificate warning is shown. > >>>>>>> > >>>>>>> The attached patch makes it so that if the user does not accept a > >>>>>>> certificate, he is not prompted again for accepting it. The patch > >>>>>>> keeps a list of certificates that the user has not accepted and > >>>>>>> skips the user prompt if it is for one of those certificates. > >>>>>>> > >>>>>>> Any comments or suggestions? > >>>>>>> > >>>>>> > >>>>>> > >>>>>> Looks fine to me. Okay for commit to all active branches. > >>>>>> > >>>>> > >>>>> Thanks. Pushed to IcedTea6 HEAD, 1.9, 1.8 and 1.7. > >>>>> > >>>>> Cheers, > >>>>> Omair > >>>>> > >>>> > >>>> Can the user remove the certificate from the list, should they wish to accept it at some point in the future? > >>>> Same vice versa I guess (stop accepting a previously accepted certificate). > >>> > >>> > >>> The untrusted list is temporary and gets destroyed when the vm shuts > >>> down. > >>> > >> > >> I was wondering whether it would make more sense to keep a list of > >> trusted/untrusted certificates per applet/application instead of per > >> VM. > >> > > > > It should be per VM. Otherwise if this were being used within a company > > environment that had their own root cert for example, users would have > > to accept the certs for each applet/http server which would be quite > > tedious. > > > >>> As for removing certs previously trusted -- that list can be manipulated > >>> with keytool. The keystore is .netx/security/trusted.certs > >>> > >> > >> Another way of manipulating the keystore is by using "javaws -viewer" > >> > > > > Nice! I didn't know NetX supported viewer. > > Unfortunately, it is not quite the same thing as Java Web Start's javaws > -viewer. Net'x javaws -viewer is more along the lines of the certificate > viewer in the Java Control Panel. > Then there's your challenge; make it as nice ;-P > > > > Deepak > > > >>> Cheers, > >>> Deepak > >>> > >>>> -- > >>>> Andrew :) > >>>> > >>>> Free Java Software Engineer > >>>> Red Hat, Inc. (http://www.redhat.com) > >>>> > >>>> Support Free Java! > >>>> Contribute to GNU Classpath and the OpenJDK > >>>> http://www.gnu.org/software/classpath > >>>> http://openjdk.java.net > >>>> PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > >>>> Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 > >> > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From chrisjones at comcen.com.au Mon Oct 18 17:30:54 2010 From: chrisjones at comcen.com.au (Chris Jones) Date: Tue, 19 Oct 2010 10:30:54 +1000 Subject: openjdk, icedtea and keepvid.com In-Reply-To: <20101018232752.GF31704@rivendell.middle-earth.co.uk> References: <1287441209.2636.2.camel@foxbox> <20101018232752.GF31704@rivendell.middle-earth.co.uk> Message-ID: <1287448254.2636.3.camel@foxbox> On Tue, 2010-10-19 at 00:27 +0100, Dr Andrew John Hughes wrote: > > Did you file a bug report at http://icedtea.classpath.org/bugzilla ? > > Nothing gets fixed if it's not reported. Doing so means issues can > be fixed and it helps you, others and Free Software as a whole. > > In many cases, a lot of problems with the plugin are actually due to > the applet itself doing something undocumented or making assumptions > about running on the proprietary Oracle plugin. I'm not saying there > aren't really bugs, but the problem with relying on a single solution > (the Oracle proprietary plugin) is that these things do creep in. The > same happened with websites and Internet Explorer at one time. > > -- > Andrew :) Thanks for the reply Andrew. I am in the process of registering and bug reporting now. Cheers for the link. -- Chris Jones PHOTO RESOLUTIONS - Photo - Graphic - Web www: http://photoresolutions.freehostia.com @: chrisjones at comcen.com.au ABN: 98 317 740 240 From bugzilla-daemon at icedtea.classpath.org Mon Oct 18 17:38:42 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 19 Oct 2010 00:38:42 +0000 Subject: [Bug 577] New: icedtea and keepvid.com Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=577 Summary: icedtea and keepvid.com Product: IcedTea Version: 6-1.9 Platform: x86_64 OS/Version: Linux Status: NEW Severity: minor Priority: P2 Component: IcedTea6 AssignedTo: unassigned at icedtea.classpath.org ReportedBy: chrisjones at comcen.com.au When using icedtea plugin and Firefox, I can't download YouTube videos using the KeepVid.com website. When I switch to the offical sun-java packages, it works perfect. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From ahughes at redhat.com Tue Oct 19 04:57:25 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Tue, 19 Oct 2010 12:57:25 +0100 Subject: [IMPORTANT] NetX & Plugin Move Message-ID: <20101019115725.GA5740@bree.middle-earth.co.uk> I'm working on creating the new repository for the plugin and NetX. Please don't commit any changes to NetX or the plugin until I announce the new repository. -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From andrew at icedtea.classpath.org Tue Oct 19 06:29:28 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 19 Oct 2010 13:29:28 +0000 Subject: /hg/icedtea6-hg: Drop security patches now they are available up... Message-ID: changeset 7d44885fc5aa in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=7d44885fc5aa author: Andrew John Hughes date: Tue Oct 19 14:28:59 2010 +0100 Drop security patches now they are available upstream. 2010-10-19 Andrew John Hughes * patches/security/20101012/6559775.patch, * patches/security/20101012/6622002.patch, * patches/security/20101012/6891766.patch, * patches/security/20101012/6914943.patch, * patches/security/20101012/6925710.patch, * patches/security/20101012/6938813.patch, * patches/security/20101012/6952017.patch, * patches/security/20101012/6952603.patch, * patches/security/20101012/6957564.patch, * patches/security/20101012/6958060.patch, * patches/security/20101012/6961084.patch, * patches/security/20101012/6963023.patch, * patches/security/20101012/6963285.patch, * patches/security/20101012/6963489.patch, * patches/security/20101012/6966692.patch, * patches/security/20101012/6981426.patch, * patches/security/20101012/6990437.patch: Dropped; available upstream. * Makefile.am: Drop above patches. * patches/icedtea-lcms.patch: Rejigged against upstream security patch. diffstat: 20 files changed, 37 insertions(+), 4966 deletions(-) ChangeLog | 24 Makefile.am | 21 patches/icedtea-lcms.patch | 25 patches/security/20101012/6559775.patch | 317 ---- patches/security/20101012/6622002.patch | 64 patches/security/20101012/6891766.patch | 1147 ---------------- patches/security/20101012/6914943.patch | 2129 ------------------------------- patches/security/20101012/6925710.patch | 198 -- patches/security/20101012/6938813.patch | 196 -- patches/security/20101012/6952017.patch | 50 patches/security/20101012/6952603.patch | 38 patches/security/20101012/6957564.patch | 77 - patches/security/20101012/6958060.patch | 15 patches/security/20101012/6961084.patch | 325 ---- patches/security/20101012/6963023.patch | 95 - patches/security/20101012/6963285.patch | 20 patches/security/20101012/6963489.patch | 31 patches/security/20101012/6966692.patch | 91 - patches/security/20101012/6981426.patch | 24 patches/security/20101012/6990437.patch | 116 - diffs (truncated from 5113 to 500 lines): diff -r 5bc57773f41d -r 7d44885fc5aa ChangeLog --- a/ChangeLog Tue Oct 19 00:15:10 2010 +0100 +++ b/ChangeLog Tue Oct 19 14:28:59 2010 +0100 @@ -1,3 +1,27 @@ 2010-10-18 Andrew John Hughes + + * patches/security/20101012/6559775.patch, + * patches/security/20101012/6622002.patch, + * patches/security/20101012/6891766.patch, + * patches/security/20101012/6914943.patch, + * patches/security/20101012/6925710.patch, + * patches/security/20101012/6938813.patch, + * patches/security/20101012/6952017.patch, + * patches/security/20101012/6952603.patch, + * patches/security/20101012/6957564.patch, + * patches/security/20101012/6958060.patch, + * patches/security/20101012/6961084.patch, + * patches/security/20101012/6963023.patch, + * patches/security/20101012/6963285.patch, + * patches/security/20101012/6963489.patch, + * patches/security/20101012/6966692.patch, + * patches/security/20101012/6981426.patch, + * patches/security/20101012/6990437.patch: + Dropped; available upstream. + * Makefile.am: Drop above patches. + * patches/icedtea-lcms.patch: Rejigged against + upstream security patch. + 2010-10-18 Andrew John Hughes * patches/hotspot/hs19/alpha-fixes.patch, diff -r 5bc57773f41d -r 7d44885fc5aa Makefile.am --- a/Makefile.am Tue Oct 19 00:15:10 2010 +0100 +++ b/Makefile.am Tue Oct 19 14:28:59 2010 +0100 @@ -232,26 +232,7 @@ REWRITER_SRCS = $(abs_top_srcdir)/rewrit ICEDTEA_FSG_PATCHES = -BROKEN = - -SECURITY_PATCHES = \ - patches/security/20101012/6891766.patch \ - patches/security/20101012/6925710.patch \ - patches/security/20101012/6938813.patch \ - patches/security/20101012/6957564.patch \ - patches/security/20101012/6958060.patch \ - patches/security/20101012/6963023.patch \ - patches/security/20101012/6963489.patch \ - patches/security/20101012/6966692.patch \ - patches/security/20101012/6914943.patch \ - patches/security/20101012/6559775.patch \ - patches/security/20101012/6622002.patch \ - patches/security/20101012/6952017.patch \ - patches/security/20101012/6952603.patch \ - patches/security/20101012/6961084.patch \ - patches/security/20101012/6963285.patch \ - patches/security/20101012/6981426.patch \ - patches/security/20101012/6990437.patch +SECURITY_PATCHES = ICEDTEA_PATCHES = \ $(SECURITY_PATCHES) \ diff -r 5bc57773f41d -r 7d44885fc5aa patches/icedtea-lcms.patch --- a/patches/icedtea-lcms.patch Tue Oct 19 00:15:10 2010 +0100 +++ b/patches/icedtea-lcms.patch Tue Oct 19 14:28:59 2010 +0100 @@ -1,8 +1,8 @@ diff -Nru openjdk.orig/jdk/src/share/nat diff -Nru openjdk.orig/jdk/src/share/native/sun/java2d/cmm/lcms/cmsxform.c openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/cmsxform.c ---- openjdk.orig/jdk/src/share/native/sun/java2d/cmm/lcms/cmsxform.c 2010-04-06 11:57:21.000000000 +0100 -+++ openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/cmsxform.c 2010-04-06 17:35:02.000000000 +0100 -@@ -689,6 +689,9 @@ - GrayTRC = cmsReadICCGamma(hProfile, icSigGrayTRCTag); +--- openjdk.orig/jdk/src/share/native/sun/java2d/cmm/lcms/cmsxform.c 2010-10-19 10:19:13.000000000 +0100 ++++ openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/cmsxform.c 2010-10-19 13:02:07.580264578 +0100 +@@ -692,6 +692,9 @@ + } FromLstarToXYZ(GrayTRC, Shapes1); + if (GrayTRC == NULL) @@ -11,17 +11,16 @@ diff -Nru openjdk.orig/jdk/src/share/nat // Reversing must be done after curve translation Shapes[0] = cmsReverseGamma(Shapes1[0]->nEntries, Shapes1[0]); -@@ -704,6 +707,9 @@ +@@ -706,7 +709,7 @@ + // Normal case GrayTRC = cmsReadICCGammaReversed(hProfile, icSigGrayTRCTag); // Y - -+ if (GrayTRC == NULL) -+ return NULL; -+ +- if (!GrayTRC) { ++ if (GrayTRC == NULL) { + return NULL; + } Shapes[0] = cmsDupGamma(GrayTRC); - Shapes[1] = cmsDupGamma(GrayTRC); - Shapes[2] = cmsDupGamma(GrayTRC); -@@ -1343,7 +1349,7 @@ +@@ -1348,7 +1351,7 @@ p -> ToDevice = PCStoShaperMatrix; p -> OutMatShaper = cmsBuildOutputMatrixShaper(p->OutputProfile); @@ -30,7 +29,7 @@ diff -Nru openjdk.orig/jdk/src/share/nat cmsSignalError(LCMS_ERRC_ABORTED, "profile is unsuitable for output"); return NULL; } -@@ -1920,6 +1926,8 @@ +@@ -1925,6 +1928,8 @@ ColorSpace = ColorSpaceIn; diff -r 5bc57773f41d -r 7d44885fc5aa patches/security/20101012/6559775.patch --- a/patches/security/20101012/6559775.patch Tue Oct 19 00:15:10 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,317 +0,0 @@ -# HG changeset patch -# User skoppar -# Date 1285671517 25200 -# Node ID 57681551c11efbec9906bdf321554aabcac25228 -# Parent bb1c74cae929a5903c0aca64b9e5a7f67726b02a -6559775: Race allows defaultReadObject to be invoked instead of readFields during deserialization -Reviewed-by: hawtin - -diff --git a/make/java/java/FILES_java.gmk b/make/java/java/FILES_java.gmk ---- openjdk.orig/jdk/make/java/java/FILES_java.gmk -+++ openjdk/jdk/make/java/java/FILES_java.gmk -@@ -384,6 +384,7 @@ JAVA_JAVA_java = \ - java/io/FilePermission.java \ - java/io/Serializable.java \ - java/io/Externalizable.java \ -+ java/io/SerialCallbackContext.java \ - java/io/Bits.java \ - java/io/ObjectInput.java \ - java/io/ObjectInputStream.java \ -diff --git a/src/share/classes/java/io/ObjectInputStream.java b/src/share/classes/java/io/ObjectInputStream.java ---- openjdk.orig/jdk/src/share/classes/java/io/ObjectInputStream.java -+++ openjdk/jdk/src/share/classes/java/io/ObjectInputStream.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it -@@ -264,7 +264,7 @@ public class ObjectInputStream - * object currently being deserialized and descriptor for current class. - * Null when not during readObject upcall. - */ -- private CallbackContext curContext; -+ private SerialCallbackContext curContext; - - /** - * Creates an ObjectInputStream that reads from the specified InputStream. -@@ -1797,7 +1797,7 @@ public class ObjectInputStream - private void readExternalData(Externalizable obj, ObjectStreamClass desc) - throws IOException - { -- CallbackContext oldContext = curContext; -+ SerialCallbackContext oldContext = curContext; - curContext = null; - try { - boolean blocked = desc.hasBlockExternalData(); -@@ -1856,10 +1856,10 @@ public class ObjectInputStream - slotDesc.hasReadObjectMethod() && - handles.lookupException(passHandle) == null) - { -- CallbackContext oldContext = curContext; -+ SerialCallbackContext oldContext = curContext; - - try { -- curContext = new CallbackContext(obj, slotDesc); -+ curContext = new SerialCallbackContext(obj, slotDesc); - - bin.setBlockDataMode(true); - slotDesc.invokeReadObject(obj, this); -@@ -3504,42 +3504,4 @@ public class ObjectInputStream - } - } - -- /** -- * Context that during upcalls to class-defined readObject methods; holds -- * object currently being deserialized and descriptor for current class. -- * This context keeps a boolean state to indicate that defaultReadObject -- * or readFields has already been invoked with this context or the class's -- * readObject method has returned; if true, the getObj method throws -- * NotActiveException. -- */ -- private static class CallbackContext { -- private final Object obj; -- private final ObjectStreamClass desc; -- private final AtomicBoolean used = new AtomicBoolean(); -- -- public CallbackContext(Object obj, ObjectStreamClass desc) { -- this.obj = obj; -- this.desc = desc; -- } -- -- public Object getObj() throws NotActiveException { -- checkAndSetUsed(); -- return obj; -- } -- -- public ObjectStreamClass getDesc() { -- return desc; -- } -- -- private void checkAndSetUsed() throws NotActiveException { -- if (!used.compareAndSet(false, true)) { -- throw new NotActiveException( -- "not in readObject invocation or fields already read"); -- } -- } -- -- public void setUsed() { -- used.set(true); -- } -- } - } -diff --git a/src/share/classes/java/io/ObjectOutputStream.java b/src/share/classes/java/io/ObjectOutputStream.java ---- openjdk.orig/jdk/src/share/classes/java/io/ObjectOutputStream.java -+++ openjdk/jdk/src/share/classes/java/io/ObjectOutputStream.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it -@@ -35,6 +35,7 @@ import java.util.concurrent.ConcurrentHa - import java.util.concurrent.ConcurrentHashMap; - import java.util.concurrent.ConcurrentMap; - import static java.io.ObjectStreamClass.processQueue; -+import java.io.SerialCallbackContext; - - /** - * An ObjectOutputStream writes primitive data types and graphs of Java objects -@@ -191,10 +192,12 @@ public class ObjectOutputStream - private boolean enableReplace; - - // values below valid only during upcalls to writeObject()/writeExternal() -- /** object currently being serialized */ -- private Object curObj; -- /** descriptor for current class (null if in writeExternal()) */ -- private ObjectStreamClass curDesc; -+ /** -+ * Context during upcalls to class-defined writeObject methods; holds -+ * object currently being serialized and descriptor for current class. -+ * Null when not during writeObject upcall. -+ */ -+ private SerialCallbackContext curContext; - /** current PutField object */ - private PutFieldImpl curPut; - -@@ -426,9 +429,11 @@ public class ObjectOutputStream - * OutputStream - */ - public void defaultWriteObject() throws IOException { -- if (curObj == null || curDesc == null) { -+ if ( curContext == null ) { - throw new NotActiveException("not in call to writeObject"); - } -+ Object curObj = curContext.getObj(); -+ ObjectStreamClass curDesc = curContext.getDesc(); - bout.setBlockDataMode(false); - defaultWriteFields(curObj, curDesc); - bout.setBlockDataMode(true); -@@ -446,9 +451,11 @@ public class ObjectOutputStream - */ - public ObjectOutputStream.PutField putFields() throws IOException { - if (curPut == null) { -- if (curObj == null || curDesc == null) { -+ if (curContext == null) { - throw new NotActiveException("not in call to writeObject"); - } -+ Object curObj = curContext.getObj(); -+ ObjectStreamClass curDesc = curContext.getDesc(); - curPut = new PutFieldImpl(curDesc); - } - return curPut; -@@ -1420,17 +1427,15 @@ public class ObjectOutputStream - * writeExternal() method. - */ - private void writeExternalData(Externalizable obj) throws IOException { -- Object oldObj = curObj; -- ObjectStreamClass oldDesc = curDesc; - PutFieldImpl oldPut = curPut; -- curObj = obj; -- curDesc = null; - curPut = null; -- -+ SerialCallbackContext oldContext = curContext; -+ - if (extendedDebugInfo) { - debugInfoStack.push("writeExternal data"); - } - try { -+ curContext = null; - if (protocol == PROTOCOL_VERSION_1) { - obj.writeExternal(this); - } else { -@@ -1440,13 +1445,12 @@ public class ObjectOutputStream - bout.writeByte(TC_ENDBLOCKDATA); - } - } finally { -+ curContext = oldContext; - if (extendedDebugInfo) { - debugInfoStack.pop(); - } - } - -- curObj = oldObj; -- curDesc = oldDesc; - curPut = oldPut; - } - -@@ -1461,12 +1465,9 @@ public class ObjectOutputStream - for (int i = 0; i < slots.length; i++) { - ObjectStreamClass slotDesc = slots[i].desc; - if (slotDesc.hasWriteObjectMethod()) { -- Object oldObj = curObj; -- ObjectStreamClass oldDesc = curDesc; - PutFieldImpl oldPut = curPut; -- curObj = obj; -- curDesc = slotDesc; - curPut = null; -+ SerialCallbackContext oldContext = curContext; - - if (extendedDebugInfo) { - debugInfoStack.push( -@@ -1474,18 +1475,19 @@ public class ObjectOutputStream - slotDesc.getName() + "\")"); - } - try { -+ curContext = new SerialCallbackContext(obj, slotDesc); - bout.setBlockDataMode(true); - slotDesc.invokeWriteObject(obj, this); - bout.setBlockDataMode(false); - bout.writeByte(TC_ENDBLOCKDATA); - } finally { -+ curContext.setUsed(); -+ curContext = oldContext; - if (extendedDebugInfo) { - debugInfoStack.pop(); - } - } - -- curObj = oldObj; -- curDesc = oldDesc; - curPut = oldPut; - } else { - defaultWriteFields(obj, slotDesc); -diff --git a/src/share/classes/java/io/SerialCallbackContext.java b/src/share/classes/java/io/SerialCallbackContext.java -new file mode 100644 ---- /dev/null -+++ openjdk/jdk/src/share/classes/java/io/SerialCallbackContext.java -@@ -0,0 +1,76 @@ -+/* -+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. Oracle designates this -+ * particular file as subject to the "Classpath" exception as provided -+ * by Oracle in the LICENSE file that accompanied this code. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+ package java.io; -+ -+ /** -+ * Context during upcalls from object stream to class-defined -+ * readObject/writeObject methods. -+ * Holds object currently being deserialized and descriptor for current class. -+ * -+ * This context keeps track of the thread it was constructed on, and allows -+ * only a single call of defaultReadObject, readFields, defaultWriteObject -+ * or writeFields which must be invoked on the same thread before the class's -+ * readObject/writeObject method has returned. -+ * If not set to the current thread, the getObj method throws NotActiveException. -+ */ -+ final class SerialCallbackContext { -+ private final Object obj; -+ private final ObjectStreamClass desc; -+ /** -+ * Thread this context is in use by. -+ * As this only works in one thread, we do not need to worry about thread-safety. -+ */ -+ private Thread thread; -+ -+ public SerialCallbackContext(Object obj, ObjectStreamClass desc) { -+ this.obj = obj; -+ this.desc = desc; -+ this.thread = Thread.currentThread(); -+ } -+ -+ public Object getObj() throws NotActiveException { -+ checkAndSetUsed(); -+ return obj; -+ } -+ -+ public ObjectStreamClass getDesc() { -+ return desc; -+ } -+ -+ private void checkAndSetUsed() throws NotActiveException { -+ if (thread != Thread.currentThread()) { -+ throw new NotActiveException( -+ "not in readObject invocation or fields already read"); -+ } -+ thread = null; -+ } -+ -+ public void setUsed() { -+ thread = null; -+ } -+ } -+ -+ diff -r 5bc57773f41d -r 7d44885fc5aa patches/security/20101012/6622002.patch --- a/patches/security/20101012/6622002.patch Tue Oct 19 00:15:10 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -# HG changeset patch -# User alexp -# Date 1285685944 -14400 -# Node ID bb1c74cae929a5903c0aca64b9e5a7f67726b02a -# Parent 1eaaf0f77762dfa6120921f1d2d6ce96e7086513 -6622002: UIDefault.ProxyLazyValue has unsafe reflection usage -Reviewed-by: malenkov - -diff --git a/src/share/classes/javax/swing/UIDefaults.java b/src/share/classes/javax/swing/UIDefaults.java ---- openjdk.orig/jdk/src/share/classes/javax/swing/UIDefaults.java -+++ openjdk/jdk/src/share/classes/javax/swing/UIDefaults.java -@@ -52,6 +52,7 @@ import java.security.PrivilegedAction; - import java.security.PrivilegedAction; - - import sun.reflect.misc.MethodUtil; -+import sun.reflect.misc.ReflectUtil; - import sun.util.CoreResourceBundleControl; - - /** -@@ -1079,6 +1080,9 @@ public class UIDefaults extends Hashtabl - // In order to pick up the security policy in effect at the - // time of creation we use a doPrivileged with the - // AccessControlContext that was in place when this was created. -+ if (acc == null && System.getSecurityManager() != null) { -+ throw new SecurityException("null AccessControlContext"); -+ } - return AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - try { -@@ -1094,7 +1098,9 @@ public class UIDefaults extends Hashtabl - cl = ClassLoader.getSystemClassLoader(); - } - } -+ ReflectUtil.checkPackageAccess(className); - c = Class.forName(className, true, (ClassLoader)cl); -+ checkAccess(c.getModifiers()); - if (methodName != null) { - Class[] types = getClassArray(args); - Method m = c.getMethod(methodName, types); -@@ -1102,6 +1108,7 @@ public class UIDefaults extends Hashtabl - } else { - Class[] types = getClassArray(args); - Constructor constructor = c.getConstructor(types); -+ checkAccess(constructor.getModifiers()); - return constructor.newInstance(args); - } - } catch(Exception e) { -@@ -1115,8 +1122,15 @@ public class UIDefaults extends Hashtabl - } - }, acc); - } -+ -+ private void checkAccess(int modifiers) { -+ if(System.getSecurityManager() != null && -+ !Modifier.isPublic(modifiers)) { -+ throw new SecurityException("Resource is not accessible"); -+ } -+ } - -- /* -+ /* - * Coerce the array of class types provided into one which - * looks the way the Reflection APIs expect. This is done From dbhole at redhat.com Tue Oct 19 07:11:08 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Tue, 19 Oct 2010 10:11:08 -0400 Subject: [IMPORTANT] NetX & Plugin Move In-Reply-To: <20101019115725.GA5740@bree.middle-earth.co.uk> References: <20101019115725.GA5740@bree.middle-earth.co.uk> Message-ID: <20101019141107.GC22251@redhat.com> * Dr Andrew John Hughes [2010-10-19 07:58]: > I'm working on creating the new repository for the plugin and NetX. > Please don't commit any changes to NetX or the plugin until I announce > the new repository. Nice! It will be great to have the Plugin and Web stuff out of main-line. For one, it will avoid double commits to icedtea and icedtea6 each time.. and it will be easier for distros to update just those specific parts. Please let me know if any help is need with the split/testing the split. Thanks, Deepak > -- > Andrew :) > > Free Java Software Engineer > Red Hat, Inc. (http://www.redhat.com) > > Support Free Java! > Contribute to GNU Classpath and the OpenJDK > http://www.gnu.org/software/classpath > http://openjdk.java.net > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From omajid at redhat.com Tue Oct 19 09:09:35 2010 From: omajid at redhat.com (Omair Majid) Date: Tue, 19 Oct 2010 12:09:35 -0400 Subject: [RFC] netx: show security dialogs in a separate AppContext Message-ID: <4CBDC2BF.5010605@redhat.com> Hi, The attached patch makes security prompts appear in a separate AppContext. This ensures that the applet's look and feel is not automatically set to the system look and feel. The patch is a superset of http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-October/010500.html This patch also implements a large part of the code necessary to allow applets to access their EventQueues. However, I still have to figure out how to use http://hg.openjdk.java.net/jdk7/awt/jdk/rev/8022709a306d to ensure allowing access to the EventQueue is safe. So for now, that code is disabled. The patch ensures that the JNLPRuntime is always initialized in the main AppContext. It starts a thread in this AppContext to listen for security dialog messages, and shows security dialogs when it receives an appropriate security message. The security dialogs block the client applet/application until the user responds. Any thoughts or comments? Thanks, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea6-jnlp-eventqueue-05.patch Type: text/x-patch Size: 53484 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101019/a9ec838d/icedtea6-jnlp-eventqueue-05.patch From bugzilla-daemon at icedtea.classpath.org Tue Oct 19 09:30:57 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 19 Oct 2010 16:30:57 +0000 Subject: [Bug 413] Crash with ibus and JOSM Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=413 ------- Comment #3 from omajid at redhat.com 2010-10-19 16:30 ------- The crash-on-ibus-restart bug has been fixed upstream: http://hg.openjdk.java.net/jdk7/swing/jdk/rev/bbadb9484f53 -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From andrew at icedtea.classpath.org Tue Oct 19 10:19:31 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 19 Oct 2010 17:19:31 +0000 Subject: /hg/icedtea-web: Revert to using foreign to avoid warnings about... Message-ID: changeset fc0b251243fb in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=fc0b251243fb author: Andrew John Hughes date: Tue Oct 19 18:19:19 2010 +0100 Revert to using foreign to avoid warnings about GNU make syntax. 2010-10-19 Andrew John Hughes * Makefile.am: (PLUGIN_LAUNCHER_OBJECTS): Do prefixing once. (NETX_LAUNCHER_OBJECTS): Likewise for NetX. (pluginappletviewer): Use PLUGIN_LAUNCHER_OBJECTS. (javaws): Use NETX_LAUNCHER_OBJECTS. * configure.ac: Re-enable foreign (I want to use GNU make!) * README: Use gmake not make. diffstat: 4 files changed, 20 insertions(+), 7 deletions(-) ChangeLog | 11 +++++++++++ Makefile.am | 10 ++++++---- README | 4 ++-- configure.ac | 2 +- diffs (76 lines): diff -r dbc6a336b087 -r fc0b251243fb ChangeLog --- a/ChangeLog Tue Oct 19 17:55:59 2010 +0100 +++ b/ChangeLog Tue Oct 19 18:19:19 2010 +0100 @@ -1,3 +1,14 @@ 2010-10-19 Andrew John Hughes + + * Makefile.am: + (PLUGIN_LAUNCHER_OBJECTS): Do prefixing once. + (NETX_LAUNCHER_OBJECTS): Likewise for NetX. + (pluginappletviewer): Use PLUGIN_LAUNCHER_OBJECTS. + (javaws): Use NETX_LAUNCHER_OBJECTS. + * configure.ac: Re-enable foreign (I want to use + GNU make!) + * README: Use gmake not make. + 2010-10-19 Andrew John Hughes * .hgignore, diff -r dbc6a336b087 -r fc0b251243fb Makefile.am --- a/Makefile.am Tue Oct 19 17:55:59 2010 +0100 +++ b/Makefile.am Tue Oct 19 18:19:19 2010 +0100 @@ -92,6 +92,8 @@ endif LAUNCHER_SRCDIR = $(abs_top_srcdir)/launcher LAUNCHER_OBJECTS = java.o java_md.o splashscreen_stubs.o +PLUGIN_LAUNCHER_OBJECTS = $(addprefix $(PLUGIN_DIR)/launcher/,$(LAUNCHER_OBJECTS)) +NETX_LAUNCHER_OBJECTS = $(addprefix $(abs_top_builddir)/launcher/,$(LAUNCHER_OBJECTS)) LAUNCHER_FLAGS = -O2 -fno-strict-aliasing -fPIC -W -Wall -Wno-unused -Wno-parentheses -pipe -fno-omit-frame-pointer \ -g -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT -DLAUNCHER_NAME='"java"' -I$(LAUNCHER_SRCDIR) \ -DJDK_MAJOR_VERSION='"1"' -DJDK_MINOR_VERSION='"6"' -DLIBARCHNAME='"$(JRE_ARCH_DIR)"' @@ -181,8 +183,8 @@ PLUGIN_OBJECTS=IcedTeaNPPlugin.o IcedTea mkdir -p $(PLUGIN_DIR)/launcher && \ $(CC) $(LAUNCHER_FLAGS) -DJAVA_ARGS='{ "sun.applet.PluginMain" }' -DPROGNAME='"pluginappletviewer"' -c -o $@ $< -$(PLUGIN_DIR)/launcher/pluginappletviewer: $(addprefix $(PLUGIN_DIR)/launcher/,$(LAUNCHER_OBJECTS)) - $(CC) $(LAUNCHER_LINK) $(addprefix $(PLUGIN_DIR)/launcher/,$(LAUNCHER_OBJECTS)) +$(PLUGIN_DIR)/launcher/pluginappletviewer: $(PLUGIN_LAUNCHER_OBJECTS) + $(CC) $(LAUNCHER_LINK) $(PLUGIN_LAUNCHER_OBJECTS) clean-IcedTeaPlugin: rm -f $(PLUGIN_DIR)/*.o @@ -302,8 +304,8 @@ launcher/%.o: $(LAUNCHER_SRCDIR)/%.c $(CC) $(LAUNCHER_FLAGS) -DJAVA_ARGS='{ "-J-ms8m", "net.sourceforge.jnlp.runtime.Boot", }' -DPROGNAME='"javaws"' \ -c -o $@ $< -launcher/javaws: $(addprefix launcher/,$(LAUNCHER_OBJECTS)) - $(CC) $(LAUNCHER_LINK) $(addprefix launcher/,$(LAUNCHER_OBJECTS)) +launcher/javaws: $(NETX_LAUNCHER_OBJECTS) + $(CC) $(LAUNCHER_LINK) $(NETX_LAUNCHER_OBJECTS) # plugin tests diff -r dbc6a336b087 -r fc0b251243fb README --- a/README Tue Oct 19 17:55:59 2010 +0100 +++ b/README Tue Oct 19 18:19:19 2010 +0100 @@ -48,8 +48,8 @@ IcedTea-Web is built using the standard: $ ./autogen.sh (if building from Mercurial rather than a tarball) $ ./configure -$ make -$ make install +$ gmake +$ gmake install incantation. The build requirements are as follows: diff -r dbc6a336b087 -r fc0b251243fb configure.ac --- a/configure.ac Tue Oct 19 17:55:59 2010 +0100 +++ b/configure.ac Tue Oct 19 18:19:19 2010 +0100 @@ -1,5 +1,5 @@ AC_INIT([icedtea-web],[1.0pre],[distro-p AC_INIT([icedtea-web],[1.0pre],[distro-pkg-dev at openjdk.java.net]) -AM_INIT_AUTOMAKE([1.9 tar-pax]) +AM_INIT_AUTOMAKE([1.9 tar-pax foreign]) AC_CONFIG_FILES([Makefile]) # Older automake doesn't generate these correctly From ahughes at redhat.com Tue Oct 19 10:21:29 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Tue, 19 Oct 2010 18:21:29 +0100 Subject: [IMPORTANT] NetX & Plugin Move In-Reply-To: <20101019141107.GC22251@redhat.com> References: <20101019115725.GA5740@bree.middle-earth.co.uk> <20101019141107.GC22251@redhat.com> Message-ID: <20101019172129.GA3392@rivendell.middle-earth.co.uk> On 10:11 Tue 19 Oct , Deepak Bhole wrote: > * Dr Andrew John Hughes [2010-10-19 07:58]: > > I'm working on creating the new repository for the plugin and NetX. > > Please don't commit any changes to NetX or the plugin until I announce > > the new repository. > > Nice! It will be great to have the Plugin and Web stuff out of > main-line. For one, it will avoid double commits to icedtea and > icedtea6 each time.. and it will be easier for distros to update just > those specific parts. > Not to mention all the branches... ;-) > Please let me know if any help is need with the split/testing the split. > The first hack is up: http://icedtea.classpath.org/hg/icedtea-web Thanks to Mark Wielaard for moving it to the main-level hg directory. I still need to add documentation support (we were using OpenJDK's) and check for all those nasty internal OpenJDK classes it uses... But you can start hacking again now :-) As to releases, I suggest a monthly release cycle for this, given the amount of activity NetX and the plugin have. Of course, the final choice on that is up to our new IcedTea-Web release manager, Deepak ;-) > Thanks, > Deepak > > > -- > > Andrew :) > > > > Free Java Software Engineer > > Red Hat, Inc. (http://www.redhat.com) > > > > Support Free Java! > > Contribute to GNU Classpath and the OpenJDK > > http://www.gnu.org/software/classpath > > http://openjdk.java.net > > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From dalibor.topic at oracle.com Tue Oct 19 10:32:22 2010 From: dalibor.topic at oracle.com (Dalibor Topic) Date: Tue, 19 Oct 2010 19:32:22 +0200 Subject: [IMPORTANT] NetX & Plugin Move In-Reply-To: <20101019172129.GA3392@rivendell.middle-earth.co.uk> References: <20101019115725.GA5740@bree.middle-earth.co.uk> <20101019141107.GC22251@redhat.com> <20101019172129.GA3392@rivendell.middle-earth.co.uk> Message-ID: <4CBDD626.7090109@oracle.com> On 10/19/10 7:21 PM, Dr Andrew John Hughes wrote: > The first hack is up: > > http://icedtea.classpath.org/hg/icedtea-web > > Thanks to Mark Wielaard for moving it to the main-level hg directory. > I still need to add documentation support (we were using OpenJDK's) and > check for all those nasty internal OpenJDK classes it uses... > > But you can start hacking again now :-) Nice! You may want to pop up on the freebsd-java list, the OpenJDK 6 packagers there were wondering about packaging it a while ago. cheers, dalibor topic -- Oracle Dalibor Topic | Java F/OSS Ambassador Phone: +494023646738 | | | Mobile: +491772664192 Oracle Java Platform Group ORACLE Deutschland B.V. & Co. KG | Nagelsweg 55 | 20097 Hamburg ORACLE Deutschland B.V. & Co. KG Hauptverwaltung: Riesstr. 25, D-80992 M?nchen Registergericht: Amtsgericht M?nchen, HRA 95603 Komplement?rin: ORACLE Deutschland Verwaltung B.V. Rijnzathe 6, 3454PV De Meern, Niederlande Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697 Gesch?ftsf?hrer: J?rgen Kunz, Marcel van de Molen, Alexander van der Ven Green Oracle Oracle is committed to developing practices and products that help protect the environment From ahughes at redhat.com Tue Oct 19 10:37:25 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Tue, 19 Oct 2010 18:37:25 +0100 Subject: [RFC] netx: show security dialogs in a separate AppContext In-Reply-To: <4CBDC2BF.5010605@redhat.com> References: <4CBDC2BF.5010605@redhat.com> Message-ID: <20101019173725.GC3392@rivendell.middle-earth.co.uk> On 12:09 Tue 19 Oct , Omair Majid wrote: > Hi, > > The attached patch makes security prompts appear in a separate > AppContext. This ensures that the applet's look and feel is not > automatically set to the system look and feel. > > The patch is a superset of > http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-October/010500.html > > This patch also implements a large part of the code necessary to allow > applets to access their EventQueues. However, I still have to figure out > how to use http://hg.openjdk.java.net/jdk7/awt/jdk/rev/8022709a306d to > ensure allowing access to the EventQueue is safe. So for now, that code > is disabled. > > The patch ensures that the JNLPRuntime is always initialized in the main > AppContext. It starts a thread in this AppContext to listen for security > dialog messages, and shows security dialogs when it receives an > appropriate security message. The security dialogs block the client > applet/application until the user responds. > > Any thoughts or comments? > This needs to be applied against the new IcedTea-Web repository when approved. I'm doing a test build then will be deleting NetX and the plugin from IcedTea6. > Thanks, > Omair > diff -r afdd3f284524 netx/net/sourceforge/jnlp/NetxPanel.java > --- a/netx/net/sourceforge/jnlp/NetxPanel.java Mon Oct 18 21:29:09 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/NetxPanel.java Tue Oct 19 12:07:40 2010 -0400 > @@ -83,19 +83,6 @@ > getHeight(), > atts); > > - synchronized(JNLPRuntime.initMutex) { > - //The custom NetX Policy and SecurityManager are set here. > - if (!JNLPRuntime.isInitialized()) { > - if (JNLPRuntime.isDebug()) > - System.out.println("initializing JNLPRuntime..."); > - > - JNLPRuntime.initialize(false); > - } else { > - if (JNLPRuntime.isDebug()) > - System.out.println("JNLPRuntime already initialized"); > - } > - } > - > doInit = true; > dispatchAppletEvent(APPLET_LOADING, null); > status = APPLET_LOAD; > @@ -145,6 +132,19 @@ > */ > // Reminder: Relax visibility in sun.applet.AppletPanel > protected synchronized void createAppletThread() { > + synchronized(JNLPRuntime.initMutex) { > + //The custom NetX Policy and SecurityManager are set here. > + if (!JNLPRuntime.isInitialized()) { > + if (JNLPRuntime.isDebug()) > + System.out.println("initializing JNLPRuntime..."); > + > + JNLPRuntime.initialize(false); > + } else { > + if (JNLPRuntime.isDebug()) > + System.out.println("JNLPRuntime already initialized"); > + } > + } > + > // when this was being done (incorrectly) in Launcher, the call was > // new AppThreadGroup(mainGroup, file.getTitle()); > ThreadGroup tg = new AppThreadGroup(Launcher.mainGroup, > diff -r afdd3f284524 netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java > --- a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Mon Oct 18 21:29:09 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Tue Oct 19 12:07:40 2010 -0400 > @@ -35,7 +35,7 @@ > import net.sourceforge.jnlp.ShortcutDesc; > import net.sourceforge.jnlp.event.ApplicationEvent; > import net.sourceforge.jnlp.event.ApplicationListener; > -import net.sourceforge.jnlp.security.SecurityWarningDialog.AccessType; > +import net.sourceforge.jnlp.security.AccessType; > import net.sourceforge.jnlp.services.ServiceUtil; > import net.sourceforge.jnlp.util.WeakList; > import net.sourceforge.jnlp.util.XDesktopEntry; > diff -r afdd3f284524 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Mon Oct 18 21:29:09 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Tue Oct 19 12:07:40 2010 -0400 > @@ -57,7 +57,8 @@ > import net.sourceforge.jnlp.cache.CacheUtil; > import net.sourceforge.jnlp.cache.ResourceTracker; > import net.sourceforge.jnlp.cache.UpdatePolicy; > -import net.sourceforge.jnlp.security.SecurityWarningDialog; > +import net.sourceforge.jnlp.security.SecurityWarning; > +import net.sourceforge.jnlp.security.AccessType; > import net.sourceforge.jnlp.tools.JarSigner; > import sun.misc.JarIndex; > > @@ -254,7 +255,7 @@ > > if (extLoader != null && extLoader != loader) { > if (loader.signing && !extLoader.signing) > - if (!SecurityWarningDialog.showNotAllSignedWarningDialog(file)) > + if (!SecurityWarning.showNotAllSignedWarningDialog(file)) > throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LSignedAppJarUsingUnsignedJar"), R("LSignedAppJarUsingUnsignedJarInfo")); > > loader.merge(extLoader); > @@ -401,7 +402,7 @@ > signing = true; > > if (!js.allJarsSigned() && > - !SecurityWarningDialog.showNotAllSignedWarningDialog(file)) > + !SecurityWarning.showNotAllSignedWarningDialog(file)) > throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LSignedAppJarUsingUnsignedJar"), R("LSignedAppJarUsingUnsignedJarInfo")); > > > @@ -455,19 +456,19 @@ > > private void checkTrustWithUser(JarSigner js) throws LaunchException { > if (!js.getRootInCacerts()) { //root cert is not in cacerts > - boolean b = SecurityWarningDialog.showCertWarningDialog( > - SecurityWarningDialog.AccessType.UNVERIFIED, file, js); > + boolean b = SecurityWarning.showCertWarningDialog( > + AccessType.UNVERIFIED, file, js); > if (!b) > throw new LaunchException(null, null, R("LSFatal"), > R("LCLaunching"), R("LNotVerified"), ""); > } else if (js.getRootInCacerts()) { //root cert is in cacerts > boolean b = false; > if (js.noSigningIssues()) > - b = SecurityWarningDialog.showCertWarningDialog( > - SecurityWarningDialog.AccessType.VERIFIED, file, js); > + b = SecurityWarning.showCertWarningDialog( > + AccessType.VERIFIED, file, js); > else if (!js.noSigningIssues()) > - b = SecurityWarningDialog.showCertWarningDialog( > - SecurityWarningDialog.AccessType.SIGNING_ERROR, file, js); > + b = SecurityWarning.showCertWarningDialog( > + AccessType.SIGNING_ERROR, file, js); > if (!b) > throw new LaunchException(null, null, R("LSFatal"), > R("LCLaunching"), R("LCancelOnUserRequest"), ""); > diff -r afdd3f284524 netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Mon Oct 18 21:29:09 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Tue Oct 19 12:07:40 2010 -0400 > @@ -25,9 +25,11 @@ > import java.util.List; > import java.security.*; > import javax.jnlp.*; > +import javax.swing.UIManager; > > import net.sourceforge.jnlp.*; > import net.sourceforge.jnlp.cache.*; > +import net.sourceforge.jnlp.security.SecurityDialogMessageHandler; > import net.sourceforge.jnlp.services.*; > import net.sourceforge.jnlp.util.*; > > @@ -63,6 +65,9 @@ > /** the security policy */ > private static JNLPPolicy policy; > > + /** handles all security message to show appropriate security dialogs */ > + private static SecurityDialogMessageHandler securityDialogMessageHandler; > + > /** the base dir for cache, etc */ > private static File baseDir; > > @@ -165,6 +170,8 @@ > * security manager and security policy, initializing the JNLP > * standard services, etc.

> * > + * This method should be called from the main AppContext/Thread.

> + * > * This method cannot be called more than once. Once > * initialized, methods that alter the runtime can only be > * called by the exit class.

> @@ -206,15 +213,39 @@ > policy = new JNLPPolicy(); > security = new JNLPSecurityManager(); // side effect: create JWindow > > + try { > + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); > + } catch (Exception e) { > + // ignore it > + } > + > if (securityEnabled) { > Policy.setPolicy(policy); // do first b/c our SM blocks setPolicy > System.setSecurityManager(security); > } > > + securityDialogMessageHandler = startSecurityThreads(); > + > initialized = true; > } > > /** > + * This must NOT be called form the application ThreadGroup. An application > + * can inject events into its {@link EventQueue} and bypass the security > + * dialogs. > + * > + * @return a {@link SecurityDialogMessageHandler} that can be used to post > + * security messages > + */ > + private static SecurityDialogMessageHandler startSecurityThreads() { > + ThreadGroup securityThreadGroup = new ThreadGroup("NetxSecurityThreadGroup"); > + SecurityDialogMessageHandler runner = new SecurityDialogMessageHandler(); > + Thread securityThread = new Thread(securityThreadGroup, runner, "NetxSecurityThread"); > + securityThread.start(); > + return runner; > + } > + > + /** > * Returns true if a webstart application has been initialized, and false > * for a plugin applet. > */ > @@ -321,6 +352,20 @@ > } > > /** > + * > + * @return the {@link SecurityDialogMessageHandler} that should be used to > + * post security dialog messages > + */ > + public static SecurityDialogMessageHandler getSecurityDialogHandler() { > + SecurityManager sm = System.getSecurityManager(); > + if (sm != null) { > + // TODO might want to reduce the permission required > + sm.checkPermission(new AllPermission()); > + } > + return securityDialogMessageHandler; > + } > + > + /** > * Returns the system default base dir for or if not set, > * prompts the user for the location. > * > diff -r afdd3f284524 netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java Mon Oct 18 21:29:09 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java Tue Oct 19 12:07:40 2010 -0400 > @@ -34,7 +34,7 @@ > import javax.swing.JWindow; > > import net.sourceforge.jnlp.JNLPFile; > -import net.sourceforge.jnlp.security.SecurityWarningDialog; > +import net.sourceforge.jnlp.security.AccessType; > import net.sourceforge.jnlp.services.ServiceUtil; > import net.sourceforge.jnlp.util.WeakList; > import sun.awt.AWTSecurityManager; > @@ -392,7 +392,7 @@ > ApplicationInstance app = getApplication(); > if (app != null && !app.isSigned()) { > if (perm instanceof SocketPermission > - && ServiceUtil.checkAccess(SecurityWarningDialog.AccessType.NETWORK, perm.getName())) { > + && ServiceUtil.checkAccess(AccessType.NETWORK, perm.getName())) { > return true; > } > } > @@ -434,7 +434,7 @@ > Window w = (Window) window; > > if (JNLPRuntime.isDebug()) > - System.err.println("SM: app: "+app.getTitle()+" is adding a window: "+window); > + System.err.println("SM: app: "+app.getTitle()+" is adding a window: "+window+" with appContext"+AppContext.getAppContext()); > > weakWindows.add(window); // for mapping window -> app > weakApplications.add(app); > @@ -538,4 +538,31 @@ > > } > > + /** > + * Tests if a client can get access to the AWT event queue. This version allows > + * complete access to the EventQueue for its own AppContext-specific EventQueue. > + * > + * FIXME there are probably huge security implications for this. Eg: > + * http://hg.openjdk.java.net/jdk7/awt/jdk/rev/8022709a306d > + * > + * @exception SecurityException if the caller does not have > + * permission to accesss the AWT event queue. > + */ > + public void checkAwtEventQueueAccess() { > + /* > + * this is the templace of the code that should allow applets access to > + * eventqueues > + */ > + > + // AppContext appContext = AppContext.getAppContext(); > + // ApplicationInstance instance = getApplication(); > + > + // if ((appContext == mainAppContext) && (instance != null)) { > + // If we're about to allow access to the main EventQueue, > + // and anything untrusted is on the class context stack, > + // disallow access. > + super.checkAwtEventQueueAccess(); > + // } > + } > + > } > diff -r afdd3f284524 netx/net/sourceforge/jnlp/security/AccessType.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/jnlp/security/AccessType.java Tue Oct 19 12:07:40 2010 -0400 > @@ -0,0 +1,53 @@ > +/* AccessType.java > + Copyright (C) 2010 Red Hat, Inc. > + > +This file is part of IcedTea. > + > +IcedTea is free software; you can redistribute it and/or > +modify it under the terms of the GNU General Public License as published by > +the Free Software Foundation, version 2. > + > +IcedTea is distributed in the hope that it will be useful, > +but WITHOUT ANY WARRANTY; without even the implied warranty of > +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > +General Public License for more details. > + > +You should have received a copy of the GNU General Public License > +along with IcedTea; see the file COPYING. If not, write to > +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA > +02110-1301 USA. > + > +Linking this library statically or dynamically with other modules is > +making a combined work based on this library. Thus, the terms and > +conditions of the GNU General Public License cover the whole > +combination. > + > +As a special exception, the copyright holders of this library give you > +permission to link this library with independent modules to produce an > +executable, regardless of the license terms of these independent > +modules, and to copy and distribute the resulting executable under > +terms of your choice, provided that you also meet, for each linked > +independent module, the terms and conditions of the license of that > +module. An independent module is a module which is not derived from > +or based on this library. If you modify this library, you may extend > +this exception to your version of the library, but you are not > +obligated to do so. If you do not wish to do so, delete this > +exception statement from your version. > +*/ > + > +package net.sourceforge.jnlp.security; > + > +/** The types of access which may need user permission. */ > +public enum AccessType { > + READ_FILE, > + WRITE_FILE, > + CREATE_DESTKOP_SHORTCUT, > + CLIPBOARD_READ, > + CLIPBOARD_WRITE, > + PRINTER, > + NETWORK, > + VERIFIED, > + UNVERIFIED, > + NOTALLSIGNED, > + SIGNING_ERROR > +} > diff -r afdd3f284524 netx/net/sourceforge/jnlp/security/AccessWarningPane.java > --- a/netx/net/sourceforge/jnlp/security/AccessWarningPane.java Mon Oct 18 21:29:09 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/security/AccessWarningPane.java Tue Oct 19 12:07:40 2010 -0400 > @@ -56,6 +56,7 @@ > import javax.swing.SwingConstants; > > import net.sourceforge.jnlp.JNLPFile; > +import net.sourceforge.jnlp.security.AccessType; > import net.sourceforge.jnlp.util.FileUtils; > > /** > @@ -86,7 +87,7 @@ > * Creates the actual GUI components, and adds it to this panel > */ > private void addComponents() { > - SecurityWarningDialog.AccessType type = parent.getAccessType(); > + AccessType type = parent.getAccessType(); > JNLPFile file = parent.getFile(); > > String name = ""; > diff -r afdd3f284524 netx/net/sourceforge/jnlp/security/CertWarningPane.java > --- a/netx/net/sourceforge/jnlp/security/CertWarningPane.java Mon Oct 18 21:29:09 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/security/CertWarningPane.java Tue Oct 19 12:07:40 2010 -0400 > @@ -60,6 +60,7 @@ > import net.sourceforge.jnlp.JNLPFile; > import net.sourceforge.jnlp.PluginBridge; > import net.sourceforge.jnlp.runtime.JNLPRuntime; > +import net.sourceforge.jnlp.security.AccessType; > import net.sourceforge.jnlp.tools.KeyTool; > > /** > @@ -85,7 +86,7 @@ > * Creates the actual GUI components, and adds it to this panel > */ > private void addComponents() { > - SecurityWarningDialog.AccessType type = parent.getAccessType(); > + AccessType type = parent.getAccessType(); > JNLPFile file = parent.getFile(); > Certificate c = parent.getJarSigner().getPublisher(); > > diff -r afdd3f284524 netx/net/sourceforge/jnlp/security/SecurityDialogMessage.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/jnlp/security/SecurityDialogMessage.java Tue Oct 19 12:07:40 2010 -0400 > @@ -0,0 +1,40 @@ > +package net.sourceforge.jnlp.security; > + > +import java.security.cert.X509Certificate; > +import java.util.concurrent.Semaphore; > + > +import javax.swing.JDialog; > + > +import net.sourceforge.jnlp.JNLPFile; > +import net.sourceforge.jnlp.security.AccessType; > +import net.sourceforge.jnlp.security.SecurityWarning.DialogType; > + > +/** > + * Represents a message to the security framework to show a specific security > + * dialog > + */ > +final class SecurityDialogMessage { > + > + /* > + * These fields contain information need to display the correct dialog type > + */ > + > + public DialogType dialogType; > + public AccessType accessType; > + public JNLPFile file; > + public CertVerifier certVerifier; > + public X509Certificate certificate; > + public Object[] extras; > + > + public volatile Object userResponse; > + > + /* > + * These two fields are used to block/unblock the application or the applet. > + * If either of them is not null, call release() or dispose() on it to allow > + * the application/applet to continue. > + */ > + > + public Semaphore lock; > + public JDialog toDispose; > + > +} > \ No newline at end of file > diff -r afdd3f284524 netx/net/sourceforge/jnlp/security/SecurityDialogMessageHandler.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/jnlp/security/SecurityDialogMessageHandler.java Tue Oct 19 12:07:40 2010 -0400 > @@ -0,0 +1,68 @@ > +package net.sourceforge.jnlp.security; > + > +import java.awt.event.ActionEvent; > +import java.awt.event.ActionListener; > +import java.util.concurrent.BlockingQueue; > +import java.util.concurrent.LinkedBlockingQueue; > + > +import net.sourceforge.jnlp.runtime.JNLPRuntime; > + > +/** > + * Handles {@link SecurityDialogMessage}s and shows appropriate security dialogs > + */ > +public final class SecurityDialogMessageHandler implements Runnable { > + > + private BlockingQueue queue = new LinkedBlockingQueue(); > + > + @Override > + public void run() { > + try { > + if (JNLPRuntime.isDebug()) { > + System.out.println("Starting security dialog thread"); > + } > + while (true) { > + SecurityDialogMessage msg = queue.take(); > + handleMessage(msg); > + } > + } catch (InterruptedException e) { > + if (JNLPRuntime.isDebug()) { > + System.out.println("Shutting down security event thread"); > + } > + return; > + } > + > + } > + > + private void handleMessage(SecurityDialogMessage message) { > + final SecurityDialogMessage msg = message; > + > + final SecurityWarningDialog dialog = new SecurityWarningDialog(message.dialogType, > + message.accessType, message.file, message.certVerifier, message.certificate, message.extras); > + > + dialog.addActionListener(new ActionListener() { > + > + @Override > + public void actionPerformed(ActionEvent e) { > + msg.userResponse = dialog.getValue(); > + /* Allow the client to continue on the other side */ > + if (msg.toDispose != null) { > + msg.toDispose.dispose(); > + } > + if (msg.lock != null) { > + msg.lock.release(); > + } > + } > + }); > + dialog.setVisible(true); > + > + } > + > + public void postMessage(SecurityDialogMessage message) { > + try { > + queue.put(message); > + } catch (InterruptedException e) { > + e.printStackTrace(); > + } > + } > + > +} > diff -r afdd3f284524 netx/net/sourceforge/jnlp/security/SecurityWarning.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/jnlp/security/SecurityWarning.java Tue Oct 19 12:07:40 2010 -0400 > @@ -0,0 +1,278 @@ > +/* SecurityWarningDialogFactory.java > + Copyright (C) 2010 Red Hat, Inc. > + > +This file is part of IcedTea. > + > +IcedTea is free software; you can redistribute it and/or > +modify it under the terms of the GNU General Public License as published by > +the Free Software Foundation, version 2. > + > +IcedTea is distributed in the hope that it will be useful, > +but WITHOUT ANY WARRANTY; without even the implied warranty of > +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > +General Public License for more details. > + > +You should have received a copy of the GNU General Public License > +along with IcedTea; see the file COPYING. If not, write to > +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA > +02110-1301 USA. > + > +Linking this library statically or dynamically with other modules is > +making a combined work based on this library. Thus, the terms and > +conditions of the GNU General Public License cover the whole > +combination. > + > +As a special exception, the copyright holders of this library give you > +permission to link this library with independent modules to produce an > +executable, regardless of the license terms of these independent > +modules, and to copy and distribute the resulting executable under > +terms of your choice, provided that you also meet, for each linked > +independent module, the terms and conditions of the license of that > +module. An independent module is a module which is not derived from > +or based on this library. If you modify this library, you may extend > +this exception to your version of the library, but you are not > +obligated to do so. If you do not wish to do so, delete this > +exception statement from your version. > +*/ > + > + > +package net.sourceforge.jnlp.security; > + > +import java.awt.Dialog.ModalityType; > +import java.awt.event.WindowAdapter; > +import java.awt.event.WindowEvent; > +import java.security.AccessController; > +import java.security.PrivilegedAction; > +import java.util.concurrent.Semaphore; > + > +import javax.swing.JDialog; > +import javax.swing.SwingUtilities; > + > +import net.sourceforge.jnlp.JNLPFile; > +import net.sourceforge.jnlp.runtime.JNLPRuntime; > + > +/** > + * A factory for showing many possible types of security warning to the user.

> + * > + * This contains all the public methods that classes outside this package should > + * use instead of using {@link SecurityWarningDialog} directly. > + * > + * All of these methods post a message to the > + * {@link SecurityDialogMessageHandler} and block waiting for a response. > + */ > +public class SecurityWarning { > + /** Types of dialogs we can create */ > + public static enum DialogType { > + CERT_WARNING, > + MORE_INFO, > + CERT_INFO, > + SINGLE_CERT_INFO, > + ACCESS_WARNING, > + NOTALLSIGNED_WARNING, > + APPLET_WARNING > + } > + > + /** > + * Shows a warning dialog for different types of system access (i.e. file > + * open/save, clipboard read/write, printing, etc). > + * > + * @param accessType the type of system access requested. > + * @param file the jnlp file associated with the requesting application. > + * @return true if permission was granted by the user, false otherwise. > + */ > + public static boolean showAccessWarningDialog(AccessType accessType, JNLPFile file) { > + return showAccessWarningDialog(accessType, file, null); > + } > + > + /** > + * Shows a warning dialog for different types of system access (i.e. file > + * open/save, clipboard read/write, printing, etc). > + * > + * @param accessType the type of system access requested. > + * @param file the jnlp file associated with the requesting application. > + * @param extras an optional array of Strings (typically) that gets > + * passed to the dialog labels. > + * @return true if permission was granted by the user, false otherwise. > + */ > + public static boolean showAccessWarningDialog(final AccessType accessType, > + final JNLPFile file, final Object[] extras) { > + final SecurityDialogMessage message = new SecurityDialogMessage(); > + > + message.dialogType = DialogType.ACCESS_WARNING; > + message.accessType = accessType; > + message.file = file; > + message.extras = extras; > + > + Object selectedValue = getUserResponse(message); > + > + if (selectedValue == null) { > + return false; > + } else if (selectedValue instanceof Integer) { > + if (((Integer) selectedValue).intValue() == 0) > + return true; > + else > + return false; > + } else { > + return false; > + } > + } > + > + /** > + * Shows a warning dialog for when the main application jars are signed, > + * but extensions aren't > + * > + * @return true if permission was granted by the user, false otherwise. > + */ > + public static boolean showNotAllSignedWarningDialog(JNLPFile file) { > + > + final SecurityDialogMessage message = new SecurityDialogMessage(); > + message.dialogType = DialogType.NOTALLSIGNED_WARNING; > + message.accessType = AccessType.NOTALLSIGNED; > + message.file = file; > + message.extras = new Object[0]; > + > + Object selectedValue = getUserResponse(message); > + > + if (selectedValue == null) { > + return false; > + } else if (selectedValue instanceof Integer) { > + if (((Integer)selectedValue).intValue() == 0) { > + return true; > + } else { > + return false; > + } > + } else { > + return false; > + } > + } > + > + /** > + * Shows a security warning dialog according to the specified type of > + * access. If type is one of AccessType.VERIFIED or > + * AccessType.UNVERIFIED, extra details will be available with regards > + * to code signing and signing certificates. > + * > + * @param accessType the type of warning dialog to show > + * @param file the JNLPFile associated with this warning > + * @param jarSigner the JarSigner used to verify this application > + */ > + public static boolean showCertWarningDialog(AccessType accessType, > + JNLPFile file, CertVerifier jarSigner) { > + > + final SecurityDialogMessage message = new SecurityDialogMessage(); > + message.dialogType = DialogType.CERT_WARNING; > + message.accessType = accessType; > + message.file = file; > + message.certVerifier = jarSigner; > + > + Object selectedValue = getUserResponse(message); > + > + if (selectedValue == null) { > + return false; > + } else if (selectedValue instanceof Integer) { > + if (((Integer) selectedValue).intValue() == 0) > + return true; > + else > + return false; > + } else { > + return false; > + } > + } > + > + /** > + * FIXME This is unused. Remove it? > + * @return (0, 1, 2) => (Yes, No, Cancel) > + */ > + public static int showAppletWarning() { > + > + SecurityDialogMessage message = new SecurityDialogMessage(); > + message.dialogType = DialogType.APPLET_WARNING; > + > + Object selectedValue = getUserResponse(message); > + > + // result 0 = Yes, 1 = No, 2 = Cancel > + if (selectedValue == null) { > + return 2; > + } else if (selectedValue instanceof Integer) { > + return ((Integer) selectedValue).intValue(); > + } else { > + return 2; > + } > + } > + > + /** > + * Posts the message to the SecurityThread and gets the response. Blocks > + * until a response has been recieved. It's safe to call this from an > + * EventDispatchThread. > + * > + * @param message the SecuritDialogMessage indicating what type of dialog to > + * display > + * @return The user's response. Can be null. The exact answer depends on the > + * type of message, but generally an Integer corresponding to the value 0 > + * indicates success/proceed, and everything else indicates failure > + */ > + private static Object getUserResponse(final SecurityDialogMessage message) { > + /* > + * Want to show a security warning, while blocking the client > + * application. This would be easy except there is a bug in showing > + * modal JDialogs in a different AppContext. The source EventQueue - > + * that sends the message to the (destination) EventQueue which is > + * supposed to actually show the dialog - must not block. If the source > + * EventQueue blocks, the destination EventQueue stops responding. So we > + * have a hack here to work around it. > + */ > + > + /* > + * If this is the event dispatch thread the use the hack > + */ > + if (SwingUtilities.isEventDispatchThread()) { > + /* > + * Create a tiny modal dialog (which creates a new EventQueue for > + * this AppContext, but blocks the original client EventQueue) and > + * then post the message - this makes the source EventQueue continue > + * running - but dot not allow the actual applet/application to > + * continue processing > + */ > + final JDialog fakeDialog = new JDialog(); > + fakeDialog.setSize(0, 0); > + fakeDialog.setResizable(false); > + fakeDialog.setModalityType(ModalityType.APPLICATION_MODAL); > + fakeDialog.addWindowListener(new WindowAdapter() { > + > + @Override > + public void windowOpened(WindowEvent e) { > + message.toDispose = fakeDialog; > + message.lock = null; > + AccessController.doPrivileged(new PrivilegedAction() { > + @Override > + public Void run() { > + JNLPRuntime.getSecurityDialogHandler().postMessage(message); > + return null; > + } > + }); > + } > + }); > + > + /* this dialog will be disposed/hidden when the user closes the security prompt */ > + fakeDialog.setVisible(true); > + } else { > + /* > + * Otherwise do it the normal way. Post a message to the security > + * thread to make it show the security dialog. Wait until it tells us > + * to proceed. > + */ > + message.toDispose = null; > + message.lock = new Semaphore(0); > + JNLPRuntime.getSecurityDialogHandler().postMessage(message); > + > + try { > + message.lock.acquire(); > + } catch (InterruptedException e) { > + message.userResponse = null; > + } > + } > + > + return message.userResponse; > + } > + > +} > diff -r afdd3f284524 netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java > --- a/netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java Mon Oct 18 21:29:09 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java Tue Oct 19 12:07:40 2010 -0400 > @@ -39,49 +39,29 @@ > > import net.sourceforge.jnlp.JNLPFile; > import net.sourceforge.jnlp.runtime.JNLPRuntime; > +import net.sourceforge.jnlp.security.AccessType; > +import net.sourceforge.jnlp.security.SecurityWarning.DialogType; > > import java.awt.*; > > import javax.swing.*; > > import java.awt.event.*; > +import java.security.cert.X509Certificate; > +import java.util.concurrent.CopyOnWriteArrayList; > > -import java.security.cert.X509Certificate; > +import java.util.List; > > /** > - * Provides methods for showing security warning dialogs > - * for a wide range of JNLP security issues. > + * Provides methods for showing security warning dialogs for a wide range of > + * JNLP security issues. Note that the security dialogs should be running in the > + * secure AppContext - this class should not be used directly from an applet or > + * application. See {@link SecurityWarning} for a way to show security dialogs. > * > * @author Joshua Sumali > */ > public class SecurityWarningDialog extends JDialog { > > - /** Types of dialogs we can create */ > - public static enum DialogType { > - CERT_WARNING, > - MORE_INFO, > - CERT_INFO, > - SINGLE_CERT_INFO, > - ACCESS_WARNING, > - NOTALLSIGNED_WARNING, > - APPLET_WARNING > - } > - > - /** The types of access which may need user permission. */ > - public static enum AccessType { > - READ_FILE, > - WRITE_FILE, > - CREATE_DESTKOP_SHORTCUT, > - CLIPBOARD_READ, > - CLIPBOARD_WRITE, > - PRINTER, > - NETWORK, > - VERIFIED, > - UNVERIFIED, > - NOTALLSIGNED, > - SIGNING_ERROR > - } > - > /** The type of dialog we want to show */ > private DialogType dialogType; > > @@ -112,61 +92,59 @@ > */ > private Object value; > > - public SecurityWarningDialog(DialogType dialogType, AccessType accessType, > - JNLPFile file) { > - super(); > - this.dialogType = dialogType; > - this.accessType = accessType; > - this.file = file; > - this.certVerifier = null; > - initialized = true; > - initDialog(); > - } > - > - public SecurityWarningDialog(DialogType dialogType, AccessType accessType, > - JNLPFile file, CertVerifier jarSigner) { > - super(); > - this.dialogType = dialogType; > - this.accessType = accessType; > - this.file = file; > - this.certVerifier = jarSigner; > - initialized = true; > - initDialog(); > - } > - > - public SecurityWarningDialog(DialogType dialogType, AccessType accessType, > - CertVerifier certVerifier) { > + SecurityWarningDialog(DialogType dialogType, AccessType accessType, > + JNLPFile file, CertVerifier jarSigner, X509Certificate cert, Object[] extras) { > super(); > this.dialogType = dialogType; > this.accessType = accessType; > - this.file = null; > - this.certVerifier = certVerifier; > + this.file = file; > + this.certVerifier = jarSigner; > + this.cert = cert; > + this.extras = extras; > initialized = true; > + > initDialog(); > } > > - public SecurityWarningDialog(DialogType dialogType, AccessType accessType, > - JNLPFile file, Object[] extras) { > - super(); > - this.dialogType = dialogType; > - this.accessType = accessType; > - this.file = file; > - this.certVerifier = null; > - initialized = true; > - this.extras = extras; > - initDialog(); > + /** > + * Construct a SecurityWarningDialog to display some sort of access warning > + */ > + SecurityWarningDialog(DialogType dialogType, AccessType accessType, > + JNLPFile file) { > + this(dialogType, accessType, file, null, null, null); > } > > - //for displaying a single certificate > - public SecurityWarningDialog(DialogType dialogType, X509Certificate c) { > - super(); > - this.dialogType = dialogType; > - this.accessType = null; > - this.file = null; > - this.certVerifier = null; > - this.cert = c; > - initialized = true; > - initDialog(); > + /** > + * Create a SecurityWarningDialog to display a certificate-related warning > + */ > + SecurityWarningDialog(DialogType dialogType, AccessType accessType, > + JNLPFile file, CertVerifier jarSigner) { > + this(dialogType, accessType, file, jarSigner, null, null); > + } > + > + /** > + * Create a SecurityWarningDialog to display a certificate-related warning > + */ > + SecurityWarningDialog(DialogType dialogType, AccessType accessType, > + CertVerifier certVerifier) { > + this(dialogType, accessType, null, certVerifier, null, null); > + } > + > + /** > + * Create a SecurityWarningDialog to display some sort of access warning > + * with more information > + */ > + SecurityWarningDialog(DialogType dialogType, AccessType accessType, > + JNLPFile file, Object[] extras) { > + this(dialogType, accessType, file, null, null, extras); > + } > + > + /** > + * Create a SecurityWarningDailog to display information about a single > + * certificate > + */ > + SecurityWarningDialog(DialogType dialogType, X509Certificate c) { > + this(dialogType, null, null, null, c, null); > } > > /** > @@ -178,105 +156,6 @@ > } > > /** > - * Shows a warning dialog for different types of system access (i.e. file > - * open/save, clipboard read/write, printing, etc). > - * > - * @param accessType the type of system access requested. > - * @param file the jnlp file associated with the requesting application. > - * @return true if permission was granted by the user, false otherwise. > - */ > - public static boolean showAccessWarningDialog(AccessType accessType, > - JNLPFile file) { > - return showAccessWarningDialog(accessType, file, null); > - } > - > - /** > - * Shows a warning dialog for different types of system access (i.e. file > - * open/save, clipboard read/write, printing, etc). > - * > - * @param accessType the type of system access requested. > - * @param file the jnlp file associated with the requesting application. > - * @param extras an optional array of Strings (typically) that gets > - * passed to the dialog labels. > - * @return true if permission was granted by the user, false otherwise. > - */ > - public static boolean showAccessWarningDialog(AccessType accessType, > - JNLPFile file, Object[] extras) { > - SecurityWarningDialog dialog = new SecurityWarningDialog( > - DialogType.ACCESS_WARNING, accessType, file, extras); > - dialog.setVisible(true); > - dialog.dispose(); > - > - Object selectedValue = dialog.getValue(); > - if (selectedValue == null) { > - return false; > - } else if (selectedValue instanceof Integer) { > - if (((Integer)selectedValue).intValue() == 0) > - return true; > - else > - return false; > - } else { > - return false; > - } > - } > - > - /** > - * Shows a warning dialog for when the main application jars are signed, > - * but extensions aren't > - * > - * @return true if permission was granted by the user, false otherwise. > - */ > - public static boolean showNotAllSignedWarningDialog(JNLPFile file) { > - SecurityWarningDialog dialog = new SecurityWarningDialog( > - DialogType.NOTALLSIGNED_WARNING, AccessType.NOTALLSIGNED, file, (new Object[0])); > - dialog.setVisible(true); > - dialog.dispose(); > - > - Object selectedValue = dialog.getValue(); > - if (selectedValue == null) { > - return false; > - } else if (selectedValue instanceof Integer) { > - if (((Integer)selectedValue).intValue() == 0) > - return true; > - else > - return false; > - } else { > - return false; > - } > - } > - > - /** > - * Shows a security warning dialog according to the specified type of > - * access. If type is one of AccessType.VERIFIED or > - * AccessType.UNVERIFIED, extra details will be available with regards > - * to code signing and signing certificates. > - * > - * @param accessType the type of warning dialog to show > - * @param file the JNLPFile associated with this warning > - * @param jarSigner the JarSigner used to verify this application > - */ > - public static boolean showCertWarningDialog(AccessType accessType, > - JNLPFile file, CertVerifier jarSigner) { > - SecurityWarningDialog dialog = > - new SecurityWarningDialog(DialogType.CERT_WARNING, accessType, file, > - jarSigner); > - dialog.setVisible(true); > - dialog.dispose(); > - > - Object selectedValue = dialog.getValue(); > - if (selectedValue == null) { > - return false; > - } else if (selectedValue instanceof Integer) { > - if (((Integer)selectedValue).intValue() == 0) > - return true; > - else > - return false; > - } else { > - return false; > - } > - } > - > - /** > * Shows more information regarding jar code signing > * > * @param jarSigner the JarSigner used to verify this application > @@ -320,23 +199,7 @@ > dialog.dispose(); > } > > - public static int showAppletWarning() { > - SecurityWarningDialog dialog = new SecurityWarningDialog(DialogType.APPLET_WARNING, > - null, null, (CertVerifier) null); > - dialog.setVisible(true); > - dialog.dispose(); > > - Object selectedValue = dialog.getValue(); > - > - //result 0 = Yes, 1 = No, 2 = Cancel > - if (selectedValue == null) { > - return 2; > - } else if (selectedValue instanceof Integer) { > - return ((Integer)selectedValue).intValue(); > - } else { > - return 2; > - } > - } > > private void initDialog() { > setSystemLookAndFeel(); > @@ -366,10 +229,7 @@ > > WindowAdapter adapter = new WindowAdapter() { > private boolean gotFocus = false; > - @Override > - public void windowClosing(WindowEvent we) { > - setValue(null); > - } > + > @Override > public void windowGainedFocus(WindowEvent we) { > // Once window gets focus, set initial focus > @@ -454,7 +314,7 @@ > this.value = value; > } > > - protected Object getValue() { > + public Object getValue() { > if (JNLPRuntime.isDebug()) { > System.out.println("Returning value:" + value); > } > @@ -462,6 +322,16 @@ > } > > /** > + * Called when the SecurityWarningDialog is hidden - either because the user > + * made a choice (Ok, Cancel, etc) or closed the window > + */ > + @Override > + public void dispose() { > + notifySelectionMade(); > + super.dispose(); > + } > + > + /** > * Updates the look and feel of the window to be the system look and feel > */ > protected void setSystemLookAndFeel() { > @@ -471,4 +341,26 @@ > //don't worry if we can't. > } > } > + > + private List listeners = new CopyOnWriteArrayList(); > + > + /** > + * Notify all the listeners that the user has made a decision using this > + * security dialog. > + */ > + public void notifySelectionMade() { > + for (ActionListener listener : listeners) { > + listener.actionPerformed(null); > + } > + } > + > + /** > + * Adds an {@link ActionListener} which will be notified if the user makes a > + * choice using this SecurityWarningDialog. The listener should use {@link #getValue()} > + * to actually get the user's response. > + */ > + public void addActionListener(ActionListener listener) { > + listeners.add(listener); > + } > + > } > diff -r afdd3f284524 netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java > --- a/netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java Mon Oct 18 21:29:09 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java Tue Oct 19 12:07:40 2010 -0400 > @@ -52,6 +52,8 @@ > > import com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager; > > +import net.sourceforge.jnlp.security.AccessType; > + > /** > * This class implements an X509 Trust Manager. The certificates it trusts are > * "variable", in the sense that it can dynamically, and temporarily support > @@ -293,8 +295,8 @@ > private boolean askUser(X509Certificate[] chain, String authType, > boolean isTrusted, boolean hostMatched, > String hostName) { > - return SecurityWarningDialog.showCertWarningDialog( > - SecurityWarningDialog.AccessType.UNVERIFIED, null, > + return SecurityWarning.showCertWarningDialog( > + AccessType.UNVERIFIED, null, > new HttpsCertVerifier(this, chain, authType, > isTrusted, hostMatched, > hostName)); > diff -r afdd3f284524 netx/net/sourceforge/jnlp/services/ServiceUtil.java > --- a/netx/net/sourceforge/jnlp/services/ServiceUtil.java Mon Oct 18 21:29:09 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/services/ServiceUtil.java Tue Oct 19 12:07:40 2010 -0400 > @@ -40,7 +40,8 @@ > import net.sourceforge.jnlp.JNLPFile; > import net.sourceforge.jnlp.runtime.ApplicationInstance; > import net.sourceforge.jnlp.runtime.JNLPRuntime; > -import net.sourceforge.jnlp.security.SecurityWarningDialog; > +import net.sourceforge.jnlp.security.SecurityWarning; > +import net.sourceforge.jnlp.security.AccessType; > > /** > * Provides static methods to interact useful for using the JNLP > @@ -219,8 +220,7 @@ > * message formatting. > * @return true if the access was granted, false otherwise. > */ > - public static boolean checkAccess(SecurityWarningDialog.AccessType type, > - Object... extras) { > + public static boolean checkAccess(AccessType type, Object... extras) { > return checkAccess(null, type, extras); > } > > @@ -235,8 +235,7 @@ > * message formatting. > * @return true if the access was granted, false otherwise. > */ > - public static boolean checkAccess(ApplicationInstance app, > - SecurityWarningDialog.AccessType type, > + public static boolean checkAccess(ApplicationInstance app, AccessType type, > Object... extras) { > > if (app == null) > @@ -270,7 +269,7 @@ > } > > if (!codeTrusted) { > - final SecurityWarningDialog.AccessType tmpType = type; > + final AccessType tmpType = type; > final Object[] tmpExtras = extras; > final ApplicationInstance tmpApp = app; > > @@ -279,7 +278,7 @@ > //from resources.jar. > Boolean b = AccessController.doPrivileged(new PrivilegedAction() { > public Boolean run() { > - boolean b = SecurityWarningDialog.showAccessWarningDialog(tmpType, > + boolean b = SecurityWarning.showAccessWarningDialog(tmpType, > tmpApp.getJNLPFile(), tmpExtras); > return new Boolean(b); > } > diff -r afdd3f284524 netx/net/sourceforge/jnlp/services/XClipboardService.java > --- a/netx/net/sourceforge/jnlp/services/XClipboardService.java Mon Oct 18 21:29:09 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/services/XClipboardService.java Tue Oct 19 12:07:40 2010 -0400 > @@ -39,7 +39,7 @@ > > import javax.jnlp.*; > > -import net.sourceforge.jnlp.security.SecurityWarningDialog; > +import net.sourceforge.jnlp.security.AccessType; > > import java.awt.datatransfer.Transferable; > import java.awt.Toolkit; > @@ -59,7 +59,7 @@ > */ > public java.awt.datatransfer.Transferable getContents(){ > > - if (ServiceUtil.checkAccess(SecurityWarningDialog.AccessType.CLIPBOARD_READ)) { > + if (ServiceUtil.checkAccess(AccessType.CLIPBOARD_READ)) { > Transferable t = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null); > return (Transferable) ServiceUtil.createPrivilegedProxy( > Transferable.class, t); > @@ -72,7 +72,7 @@ > * Sets the contents of the system clipboard. > */ > public void setContents(java.awt.datatransfer.Transferable contents) { > - if (ServiceUtil.checkAccess(SecurityWarningDialog.AccessType.CLIPBOARD_WRITE)) { > + if (ServiceUtil.checkAccess(AccessType.CLIPBOARD_WRITE)) { > Toolkit.getDefaultToolkit().getSystemClipboard().setContents( > contents, null); > } > diff -r afdd3f284524 netx/net/sourceforge/jnlp/services/XExtendedService.java > --- a/netx/net/sourceforge/jnlp/services/XExtendedService.java Mon Oct 18 21:29:09 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/services/XExtendedService.java Tue Oct 19 12:07:40 2010 -0400 > @@ -22,7 +22,7 @@ > import javax.jnlp.ExtendedService; > import javax.jnlp.FileContents; > > -import net.sourceforge.jnlp.security.SecurityWarningDialog; > +import net.sourceforge.jnlp.security.AccessType; > > /** > * Implementation of ExtendedService > @@ -35,8 +35,7 @@ > public FileContents openFile(File file) throws IOException { > > /* FIXME: this opens a file with read/write mode, not just read or write */ > - if (ServiceUtil.checkAccess(SecurityWarningDialog.AccessType.READ_FILE, > - new Object[]{ file.getAbsolutePath() })) { > + if (ServiceUtil.checkAccess(AccessType.READ_FILE, new Object[]{ file.getAbsolutePath() })) { > return (FileContents) ServiceUtil.createPrivilegedProxy(FileContents.class, > new XFileContents(file)); > } else { > diff -r afdd3f284524 netx/net/sourceforge/jnlp/services/XFileOpenService.java > --- a/netx/net/sourceforge/jnlp/services/XFileOpenService.java Mon Oct 18 21:29:09 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/services/XFileOpenService.java Tue Oct 19 12:07:40 2010 -0400 > @@ -45,7 +45,7 @@ > > import net.sourceforge.jnlp.*; > import net.sourceforge.jnlp.runtime.*; > -import net.sourceforge.jnlp.security.SecurityWarningDialog; > +import net.sourceforge.jnlp.security.AccessType; > > import javax.swing.JFileChooser; > import javax.swing.JOptionPane; > @@ -67,7 +67,7 @@ > public FileContents openFileDialog (java.lang.String pathHint, > java.lang.String[] extensions) throws java.io.IOException { > > - if (ServiceUtil.checkAccess(SecurityWarningDialog.AccessType.READ_FILE)) { > + if (ServiceUtil.checkAccess(AccessType.READ_FILE)) { > > //open a file dialog here, let the user choose the file. > JFileChooser chooser = new JFileChooser(); > @@ -90,7 +90,7 @@ > public FileContents[] openMultiFileDialog (java.lang.String pathHint, > java.lang.String[] extensions) throws java.io.IOException { > > - if (ServiceUtil.checkAccess(SecurityWarningDialog.AccessType.WRITE_FILE)) { > + if (ServiceUtil.checkAccess(AccessType.WRITE_FILE)) { > JFileChooser chooser = new JFileChooser(); > chooser.setMultiSelectionEnabled(true); > int chosen = chooser.showOpenDialog(null); > diff -r afdd3f284524 netx/net/sourceforge/jnlp/services/XFileSaveService.java > --- a/netx/net/sourceforge/jnlp/services/XFileSaveService.java Mon Oct 18 21:29:09 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/services/XFileSaveService.java Tue Oct 19 12:07:40 2010 -0400 > @@ -43,8 +43,7 @@ > import java.lang.ref.*; > import javax.jnlp.*; > > -import net.sourceforge.jnlp.*; > -import net.sourceforge.jnlp.security.*; > +import net.sourceforge.jnlp.security.AccessType; > > import javax.swing.JFileChooser; > import javax.swing.JOptionPane; > @@ -67,7 +66,7 @@ > java.lang.String[] extensions, java.io.InputStream stream, > java.lang.String name) throws java.io.IOException { > > - if (ServiceUtil.checkAccess(SecurityWarningDialog.AccessType.WRITE_FILE)) { > + if (ServiceUtil.checkAccess(AccessType.WRITE_FILE)) { > JFileChooser chooser = new JFileChooser(); > int chosen = chooser.showSaveDialog(null); > > @@ -90,7 +89,7 @@ > public FileContents saveAsFileDialog(java.lang.String pathHint, > java.lang.String[] extensions, FileContents contents) throws java.io.IOException { > > - if (ServiceUtil.checkAccess(SecurityWarningDialog.AccessType.WRITE_FILE)) { > + if (ServiceUtil.checkAccess(AccessType.WRITE_FILE)) { > JFileChooser chooser = new JFileChooser(); > chooser.setSelectedFile(new File(contents.getName())); > int chosen = chooser.showSaveDialog(null); -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From ahughes at redhat.com Tue Oct 19 10:38:16 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Tue, 19 Oct 2010 18:38:16 +0100 Subject: Request to backport 6979979: Rounding error in font sizes selected by the GTK Look and Feel In-Reply-To: <4CBDD155.900@redhat.com> References: <4CBDD155.900@redhat.com> Message-ID: <20101019173816.GD3392@rivendell.middle-earth.co.uk> On 13:11 Tue 19 Oct , Omair Majid wrote: > Hi, > > I would like to backport the following changeset to openjdk6: > > changeset: 2720:bb733c150f94 > user: omajid > date: Tue Sep 14 10:45:38 2010 -0400 > summary: 6979979: Rounding error in font sizes selected by the GTK > Look and Feel > > It selects a better font size the when Swing is using the GTKLookAndFeel. > > Thanks, > Omair Is this backported in IcedTea6? -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From omajid at redhat.com Tue Oct 19 10:52:21 2010 From: omajid at redhat.com (Omair Majid) Date: Tue, 19 Oct 2010 13:52:21 -0400 Subject: Request to backport 6979979: Rounding error in font sizes selected by the GTK Look and Feel In-Reply-To: <20101019173816.GD3392@rivendell.middle-earth.co.uk> References: <4CBDD155.900@redhat.com> <20101019173816.GD3392@rivendell.middle-earth.co.uk> Message-ID: <4CBDDAD5.1010809@redhat.com> On 10/19/2010 01:38 PM, Dr Andrew John Hughes wrote: > On 13:11 Tue 19 Oct , Omair Majid wrote: >> Hi, >> >> I would like to backport the following changeset to openjdk6: >> >> changeset: 2720:bb733c150f94 >> user: omajid >> date: Tue Sep 14 10:45:38 2010 -0400 >> summary: 6979979: Rounding error in font sizes selected by the GTK >> Look and Feel >> >> It selects a better font size the when Swing is using the GTKLookAndFeel. >> >> Thanks, >> Omair > > Is this backported in IcedTea6? As far as I am aware, no. I am going to add this to IcedTea6 if the openjdk6 devs are ok with adding it to openjdk6. Cheers, Omair From andrew at icedtea.classpath.org Tue Oct 19 11:55:43 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 19 Oct 2010 18:55:43 +0000 Subject: /hg/icedtea6: Move NetX and the plugin to the IcedTea-Web project. Message-ID: changeset a85679cc93f4 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=a85679cc93f4 author: Andrew John Hughes date: Tue Oct 19 19:55:35 2010 +0100 Move NetX and the plugin to the IcedTea-Web project. 2010-10-19 Andrew John Hughes Move NetX and the plugin to the IcedTea-Web project: http://icedtea.classpath.org/hg/icedtea-web * extra/net/sourceforge/jnlp/about/HTMLPanel.java, * extra/net/sourceforge/jnlp/about/Main.java, * extra/net/sourceforge/jnlp/about/resources/about.html, * extra/net/sourceforge/jnlp/about/resources/applications.html, * extra/net/sourceforge/jnlp/about/resources/notes.html, * javaws.desktop, * netx/javaws.1, * netx/javax/jnlp/BasicService.java, * netx/javax/jnlp/ClipboardService.java, * netx/javax/jnlp/DownloadService.java, * netx/javax/jnlp/DownloadServiceListener.java, * netx/javax/jnlp/ExtendedService.java, * netx/javax/jnlp/ExtensionInstallerService.java, * netx/javax/jnlp/FileContents.java, * netx/javax/jnlp/FileOpenService.java, * netx/javax/jnlp/FileSaveService.java, * netx/javax/jnlp/JNLPRandomAccessFile.java, * netx/javax/jnlp/PersistenceService.java, * netx/javax/jnlp/PrintService.java, * netx/javax/jnlp/ServiceManager.java, * netx/javax/jnlp/ServiceManagerStub.java, * netx/javax/jnlp/SingleInstanceListener.java, * netx/javax/jnlp/SingleInstanceService.java, * netx/javax/jnlp/UnavailableServiceException.java, * netx/net/sourceforge/jnlp/AppletDesc.java, * netx/net/sourceforge/jnlp/ApplicationDesc.java, * netx/net/sourceforge/jnlp/AssociationDesc.java, * netx/net/sourceforge/jnlp/ComponentDesc.java, * netx/net/sourceforge/jnlp/DefaultLaunchHandler.java, * netx/net/sourceforge/jnlp/ExtensionDesc.java, * netx/net/sourceforge/jnlp/IconDesc.java, * netx/net/sourceforge/jnlp/InformationDesc.java, * netx/net/sourceforge/jnlp/InstallerDesc.java, * netx/net/sourceforge/jnlp/JARDesc.java, * netx/net/sourceforge/jnlp/JNLPFile.java, * netx/net/sourceforge/jnlp/JNLPSplashScreen.java, * netx/net/sourceforge/jnlp/JREDesc.java, * netx/net/sourceforge/jnlp/LaunchException.java, * netx/net/sourceforge/jnlp/LaunchHandler.java, * netx/net/sourceforge/jnlp/Launcher.java, * netx/net/sourceforge/jnlp/MenuDesc.java, * netx/net/sourceforge/jnlp/NetxPanel.java, * netx/net/sourceforge/jnlp/Node.java, * netx/net/sourceforge/jnlp/PackageDesc.java, * netx/net/sourceforge/jnlp/ParseException.java, * netx/net/sourceforge/jnlp/Parser.java, * netx/net/sourceforge/jnlp/PluginBridge.java, * netx/net/sourceforge/jnlp/PropertyDesc.java, * netx/net/sourceforge/jnlp/RelatedContentDesc.java, * netx/net/sourceforge/jnlp/ResourcesDesc.java, * netx/net/sourceforge/jnlp/SecurityDesc.java, * netx/net/sourceforge/jnlp/ShortcutDesc.java, * netx/net/sourceforge/jnlp/StreamEater.java, * netx/net/sourceforge/jnlp/UpdateDesc.java, * netx/net/sourceforge/jnlp/Version.java, * netx/net/sourceforge/jnlp/cache/CacheEntry.java, * netx/net/sourceforge/jnlp/cache/CacheUtil.java, * netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java, * netx/net/sourceforge/jnlp/cache/DownloadIndicator.java, * netx/net/sourceforge/jnlp/cache/Resource.java, * netx/net/sourceforge/jnlp/cache/ResourceTracker.java, * netx/net/sourceforge/jnlp/cache/UpdatePolicy.java, * netx/net/sourceforge/jnlp/cache/package.html, * netx/net/sourceforge/jnlp/event/ApplicationEvent.java, * netx/net/sourceforge/jnlp/event/ApplicationListener.java, * netx/net/sourceforge/jnlp/event/DownloadEvent.java, * netx/net/sourceforge/jnlp/event/DownloadListener.java, * netx/net/sourceforge/jnlp/event/package.html, * netx/net/sourceforge/jnlp/package.html, * netx/net/sourceforge/jnlp/resources/Manifest.mf, * netx/net/sourceforge/jnlp/resources/Messages.properties, * netx/net/sourceforge/jnlp/resources/about.jnlp, * netx/net/sourceforge/jnlp/resources/default.jnlp, * netx/net/sourceforge/jnlp/runtime/AppThreadGroup.java, * netx/net/sourceforge/jnlp/runtime/AppletAudioClip.java, * netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java, * netx/net/sourceforge/jnlp/runtime/AppletInstance.java, * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java, * netx/net/sourceforge/jnlp/runtime/Boot.java, * netx/net/sourceforge/jnlp/runtime/Boot13.java, * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java, * netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java, * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java, * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java, * netx/net/sourceforge/jnlp/runtime/package.html, * netx/net/sourceforge/jnlp/security/AccessWarningPane.java, * netx/net/sourceforge/jnlp/security/AppletWarningPane.java, * netx/net/sourceforge/jnlp/security/CertVerifier.java, * netx/net/sourceforge/jnlp/security/CertWarningPane.java, * netx/net/sourceforge/jnlp/security/CertsInfoPane.java, * netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java, * netx/net/sourceforge/jnlp/security/MoreInfoPane.java, * netx/net/sourceforge/jnlp/security/NotAllSignedWarningPane.java, * netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java, * netx/net/sourceforge/jnlp/security/SecurityUtil.java, * netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java, * netx/net/sourceforge/jnlp/security/SingleCertInfoPane.java, * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java, * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java, * netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java, * netx/net/sourceforge/jnlp/services/ExtendedSingleInstanceService.jav a, * netx/net/sourceforge/jnlp/services/InstanceExistsException.java, * netx/net/sourceforge/jnlp/services/ServiceUtil.java, * netx/net/sourceforge/jnlp/services/SingleInstanceLock.java, * netx/net/sourceforge/jnlp/services/XBasicService.java, * netx/net/sourceforge/jnlp/services/XClipboardService.java, * netx/net/sourceforge/jnlp/services/XDownloadService.java, * netx/net/sourceforge/jnlp/services/XExtendedService.java, * netx/net/sourceforge/jnlp/services/XExtensionInstallerService.java, * netx/net/sourceforge/jnlp/services/XFileContents.java, * netx/net/sourceforge/jnlp/services/XFileOpenService.java, * netx/net/sourceforge/jnlp/services/XFileSaveService.java, * netx/net/sourceforge/jnlp/services/XJNLPRandomAccessFile.java, * netx/net/sourceforge/jnlp/services/XPersistenceService.java, * netx/net/sourceforge/jnlp/services/XPrintService.java, * netx/net/sourceforge/jnlp/services/XServiceManagerStub.java, * netx/net/sourceforge/jnlp/services/XSingleInstanceService.java, * netx/net/sourceforge/jnlp/services/package.html, * netx/net/sourceforge/jnlp/tools/CharacterEncoder.java, * netx/net/sourceforge/jnlp/tools/HexDumpEncoder.java, * netx/net/sourceforge/jnlp/tools/JarRunner.java, * netx/net/sourceforge/jnlp/tools/JarSigner.java, * netx/net/sourceforge/jnlp/tools/JarSignerResources.java, * netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java, * netx/net/sourceforge/jnlp/tools/KeyTool.java, * netx/net/sourceforge/jnlp/util/FileUtils.java, * netx/net/sourceforge/jnlp/util/PropertiesFile.java, * netx/net/sourceforge/jnlp/util/Reflect.java, * netx/net/sourceforge/jnlp/util/WeakList.java, * netx/net/sourceforge/jnlp/util/XDesktopEntry.java, * netx/net/sourceforge/nanoxml/XMLElement.java, * netx/net/sourceforge/nanoxml/XMLParseException.java, * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc, * plugin/icedteanp/IcedTeaJavaRequestProcessor.h, * plugin/icedteanp/IcedTeaNPPlugin.cc, * plugin/icedteanp/IcedTeaNPPlugin.h, * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc, * plugin/icedteanp/IcedTeaPluginRequestProcessor.h, * plugin/icedteanp/IcedTeaPluginUtils.cc, * plugin/icedteanp/IcedTeaPluginUtils.h, * plugin/icedteanp/IcedTeaRunnable.cc, * plugin/icedteanp/IcedTeaRunnable.h, * plugin/icedteanp/IcedTeaScriptablePluginObject.cc, * plugin/icedteanp/IcedTeaScriptablePluginObject.h, * plugin/icedteanp/java/netscape/javascript/JSException.java, * plugin/icedteanp/java/netscape/javascript/JSObject.java, * plugin/icedteanp/java/netscape/javascript/JSObjectCreatePermission.j ava, * plugin/icedteanp/java/netscape/javascript/JSProxy.java, * plugin/icedteanp/java/netscape/javascript/JSRunnable.java, * plugin/icedteanp/java/netscape/javascript/JSUtil.java, * plugin/icedteanp/java/netscape/security/ForbiddenTargetException.jav a, * plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java, * plugin/icedteanp/java/sun/applet/GetMemberPluginCallRequest.java, * plugin/icedteanp/java/sun/applet/GetWindowPluginCallRequest.java, * plugin/icedteanp/java/sun/applet/JavaConsole.java, * plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java, * plugin/icedteanp/java/sun/applet/PasswordAuthenticationDialog.java, * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java, * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java, * plugin/icedteanp/java/sun/applet/PluginCallRequest.java, * plugin/icedteanp/java/sun/applet/PluginCallRequestFactory.java, * plugin/icedteanp/java/sun/applet/PluginClassLoader.java, * plugin/icedteanp/java/sun/applet/PluginCookieInfoRequest.java, * plugin/icedteanp/java/sun/applet/PluginCookieManager.java, * plugin/icedteanp/java/sun/applet/PluginDebug.java, * plugin/icedteanp/java/sun/applet/PluginException.java, * plugin/icedteanp/java/sun/applet/PluginMain.java, * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java, * plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java, * plugin/icedteanp/java/sun/applet/PluginObjectStore.java, * plugin/icedteanp/java/sun/applet/PluginProxyInfoRequest.java, * plugin/icedteanp/java/sun/applet/PluginProxySelector.java, * plugin/icedteanp/java/sun/applet/PluginStreamHandler.java, * plugin/icedteanp/java/sun/applet/RequestQueue.java, * plugin/icedteanp/java/sun/applet/TestEnv.java, * plugin/icedteanp/java/sun/applet/VoidPluginCallRequest.java, * plugin/tests/LiveConnect/DummyObject.java, * plugin/tests/LiveConnect/OverloadTestHelper1.java, * plugin/tests/LiveConnect/OverloadTestHelper2.java, * plugin/tests/LiveConnect/OverloadTestHelper3.java, * plugin/tests/LiveConnect/PluginTest.java, * plugin/tests/LiveConnect/build, * plugin/tests/LiveConnect/common.js, * plugin/tests/LiveConnect/index.html, * plugin/tests/LiveConnect/jjs_eval_test.js, * plugin/tests/LiveConnect/jjs_func_parameters_tests.js, * plugin/tests/LiveConnect/jjs_func_rettype_tests.js, * plugin/tests/LiveConnect/jjs_get_tests.js, * plugin/tests/LiveConnect/jjs_set_tests.js, * plugin/tests/LiveConnect/jsj_func_overload_tests.js, * plugin/tests/LiveConnect/jsj_func_parameters_tests.js, * plugin/tests/LiveConnect/jsj_func_rettype_tests.js, * plugin/tests/LiveConnect/jsj_get_tests.js, * plugin/tests/LiveConnect/jsj_set_tests.js, * plugin/tests/LiveConnect/jsj_type_casting_tests.js, * plugin/tests/LiveConnect/jsj_type_conversion_tests.js, * patches/extensions/liveconnect.patch: Removed. * Makefile.am: Removed aliases for dead targets. (NETX_SRCDIR): Removed. (NETX_RESOURCE_DIR): Likewise. (NETX_EXTRA_DIR): Likewise. (NETX_BOOTSTRAP_CLASSES): Likewise. (PLUGIN_BOOTSTRAP_CLASSES): Likewise. (NETX_SUN_CLASSES): Likewise. (PLUGIN_SUN_CLASSES): Likewise. (ICEDTEA_BOOTSTRAP_CLASSES): Remove above four variables. (ICEDTEAPLUGIN_CLEAN): Removed. (LIVECONNECT_DIR): Removed. (PLUGIN_DIR): Removed. (PLUGIN_SRCDIR): Removed. (LIVECONNECT_SRCS): Removed. (ICEDTEAPLUGIN_TARGET): Removed. (PLUGIN_TEST_SRCS): Removed. (ICEDTEA_PATCHES): Drop liveconnect.patch. (PLUGIN_VERSION): Removed. (EXTRA_DIST): Drop extra javaws.png javaws.desktop plugin netx. (clean-local): Remove dead targets. (.PHONY): Likewise. (icedtea-against- icedtea): Likewise. (clean-icedtea-against-icedtea): Likewise. (icedtea-debug-against-icedtea): Likewise. (clean-icedtea-debug-against-icedtea): Likewise. (add- plugin): Dropped. (clean-add-plugin): Likewise. (add-plugin-debug): Likewise. (clean-add-plugin-debug): Likewise. (add-netx): Dropped. (clean-add-netx): Likewise. (add-netx-debug): Likewise. (clean-add- netx-debug): Likewise. (icedtea-against-ecj): Drop dead targets. (clean-icedtea-against-ecj): Likewise. (add-plugin-ecj): Likewise. (clean-add-plugin-ecj): Likewise. (add-netx-ecj): Dropped. (clean-add-netx- ecj): Likewise. (PLUGIN_SRC): Removed. (PLUGIN_OBJECTS): Removed. ($(PLUGIN_DIR)/%.o)): Removed. ($(PLUGIN_DIR)/IcedTeaPlugin.so): Removed. (clean- IcedTeaPlugin): Likewise. (plugin): Likewise. (clean-plugin): Likewise. (liveconnect-source-files.txt): Likewise. (liveconnect): Likewise. (liveconnect- dist): Likewise. (clean-liveconnect): Likewise. (netx-source-files.txt): Likewise. (netx): Likewise. (netx-dist): Likewise. (clean-netx): Likewise. (extra-source-files.txt): Likewise. (extra-class-files): Likewise. (clean-extra): Likewise. (extra- lib/about.jar): Likewise. (ADD_ZERO_CONFIGURE_ARGS): Remove dead --disable-plugin. (plugin-tests): Removed. * acinclude.m4: (IT_CHECK_PLUGIN): Removed. (IT_CHECK_PLUGIN_DEPENDENCIES): Likewise. (IT_CHECK_XULRUNNER_VERSION): Likewise. * configure.ac: Don't call IT_CHECK_XULRUNNER_VERSION. diffstat: 201 files changed, 291 insertions(+), 45276 deletions(-) ChangeLog | 269 + Makefile.am | 438 - acinclude.m4 | 47 configure.ac | 1 extra/net/sourceforge/jnlp/about/HTMLPanel.java | 59 extra/net/sourceforge/jnlp/about/Main.java | 135 extra/net/sourceforge/jnlp/about/resources/about.html | 28 extra/net/sourceforge/jnlp/about/resources/applications.html | 36 extra/net/sourceforge/jnlp/about/resources/notes.html | 82 javaws.desktop | 11 netx/javaws.1 | 123 netx/javax/jnlp/BasicService.java | 12 netx/javax/jnlp/ClipboardService.java | 10 netx/javax/jnlp/DownloadService.java | 24 netx/javax/jnlp/DownloadServiceListener.java | 12 netx/javax/jnlp/ExtendedService.java | 51 netx/javax/jnlp/ExtensionInstallerService.java | 21 netx/javax/jnlp/FileContents.java | 17 netx/javax/jnlp/FileOpenService.java | 10 netx/javax/jnlp/FileSaveService.java | 10 netx/javax/jnlp/JNLPRandomAccessFile.java | 45 netx/javax/jnlp/PersistenceService.java | 17 netx/javax/jnlp/PrintService.java | 12 netx/javax/jnlp/ServiceManager.java | 53 netx/javax/jnlp/ServiceManagerStub.java | 10 netx/javax/jnlp/SingleInstanceListener.java | 35 netx/javax/jnlp/SingleInstanceService.java | 46 netx/javax/jnlp/UnavailableServiceException.java | 15 netx/net/sourceforge/jnlp/AppletDesc.java | 122 netx/net/sourceforge/jnlp/ApplicationDesc.java | 74 netx/net/sourceforge/jnlp/AssociationDesc.java | 56 netx/net/sourceforge/jnlp/ComponentDesc.java | 40 netx/net/sourceforge/jnlp/DefaultLaunchHandler.java | 112 netx/net/sourceforge/jnlp/ExtensionDesc.java | 143 netx/net/sourceforge/jnlp/IconDesc.java | 135 netx/net/sourceforge/jnlp/InformationDesc.java | 267 - netx/net/sourceforge/jnlp/InstallerDesc.java | 52 netx/net/sourceforge/jnlp/JARDesc.java | 141 netx/net/sourceforge/jnlp/JNLPFile.java | 633 -- netx/net/sourceforge/jnlp/JNLPSplashScreen.java | 99 netx/net/sourceforge/jnlp/JREDesc.java | 165 netx/net/sourceforge/jnlp/LaunchException.java | 188 netx/net/sourceforge/jnlp/LaunchHandler.java | 66 netx/net/sourceforge/jnlp/Launcher.java | 883 --- netx/net/sourceforge/jnlp/MenuDesc.java | 38 netx/net/sourceforge/jnlp/NetxPanel.java | 168 netx/net/sourceforge/jnlp/Node.java | 146 netx/net/sourceforge/jnlp/PackageDesc.java | 102 netx/net/sourceforge/jnlp/ParseException.java | 92 netx/net/sourceforge/jnlp/Parser.java | 1320 ----- netx/net/sourceforge/jnlp/PluginBridge.java | 253 - netx/net/sourceforge/jnlp/PropertyDesc.java | 64 netx/net/sourceforge/jnlp/RelatedContentDesc.java | 93 netx/net/sourceforge/jnlp/ResourcesDesc.java | 230 netx/net/sourceforge/jnlp/SecurityDesc.java | 201 netx/net/sourceforge/jnlp/ShortcutDesc.java | 70 netx/net/sourceforge/jnlp/StreamEater.java | 45 netx/net/sourceforge/jnlp/UpdateDesc.java | 70 netx/net/sourceforge/jnlp/Version.java | 352 - netx/net/sourceforge/jnlp/cache/CacheEntry.java | 172 netx/net/sourceforge/jnlp/cache/CacheUtil.java | 450 - netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java | 320 - netx/net/sourceforge/jnlp/cache/DownloadIndicator.java | 91 netx/net/sourceforge/jnlp/cache/Resource.java | 269 - netx/net/sourceforge/jnlp/cache/ResourceTracker.java | 1049 ---- netx/net/sourceforge/jnlp/cache/UpdatePolicy.java | 88 netx/net/sourceforge/jnlp/cache/package.html | 28 netx/net/sourceforge/jnlp/event/ApplicationEvent.java | 55 netx/net/sourceforge/jnlp/event/ApplicationListener.java | 37 netx/net/sourceforge/jnlp/event/DownloadEvent.java | 70 netx/net/sourceforge/jnlp/event/DownloadListener.java | 50 netx/net/sourceforge/jnlp/event/package.html | 28 netx/net/sourceforge/jnlp/package.html | 30 netx/net/sourceforge/jnlp/resources/Manifest.mf | 6 netx/net/sourceforge/jnlp/resources/Messages.properties | 182 netx/net/sourceforge/jnlp/resources/about.jnlp | 20 netx/net/sourceforge/jnlp/resources/default.jnlp | 20 netx/net/sourceforge/jnlp/runtime/AppThreadGroup.java | 68 netx/net/sourceforge/jnlp/runtime/AppletAudioClip.java | 107 netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java | 354 - netx/net/sourceforge/jnlp/runtime/AppletInstance.java | 138 netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java | 319 - netx/net/sourceforge/jnlp/runtime/Boot.java | 463 - netx/net/sourceforge/jnlp/runtime/Boot13.java | 102 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | 1198 ---- netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java | 103 netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java | 572 -- netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java | 541 -- netx/net/sourceforge/jnlp/runtime/package.html | 29 netx/net/sourceforge/jnlp/security/AccessWarningPane.java | 209 netx/net/sourceforge/jnlp/security/AppletWarningPane.java | 115 netx/net/sourceforge/jnlp/security/CertVerifier.java | 92 netx/net/sourceforge/jnlp/security/CertWarningPane.java | 254 - netx/net/sourceforge/jnlp/security/CertsInfoPane.java | 341 - netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java | 238 netx/net/sourceforge/jnlp/security/MoreInfoPane.java | 110 netx/net/sourceforge/jnlp/security/NotAllSignedWarningPane.java | 120 netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java | 134 netx/net/sourceforge/jnlp/security/SecurityUtil.java | 285 - netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java | 474 - netx/net/sourceforge/jnlp/security/SingleCertInfoPane.java | 77 netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java | 314 - netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java | 335 - netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java | 120 netx/net/sourceforge/jnlp/services/ExtendedSingleInstanceService.java | 49 netx/net/sourceforge/jnlp/services/InstanceExistsException.java | 35 netx/net/sourceforge/jnlp/services/ServiceUtil.java | 293 - netx/net/sourceforge/jnlp/services/SingleInstanceLock.java | 194 netx/net/sourceforge/jnlp/services/XBasicService.java | 232 netx/net/sourceforge/jnlp/services/XClipboardService.java | 81 netx/net/sourceforge/jnlp/services/XDownloadService.java | 179 netx/net/sourceforge/jnlp/services/XExtendedService.java | 56 netx/net/sourceforge/jnlp/services/XExtensionInstallerService.java | 121 netx/net/sourceforge/jnlp/services/XFileContents.java | 121 netx/net/sourceforge/jnlp/services/XFileOpenService.java | 113 netx/net/sourceforge/jnlp/services/XFileSaveService.java | 140 netx/net/sourceforge/jnlp/services/XJNLPRandomAccessFile.java | 203 netx/net/sourceforge/jnlp/services/XPersistenceService.java | 177 netx/net/sourceforge/jnlp/services/XPrintService.java | 123 netx/net/sourceforge/jnlp/services/XServiceManagerStub.java | 106 netx/net/sourceforge/jnlp/services/XSingleInstanceService.java | 236 netx/net/sourceforge/jnlp/services/package.html | 29 netx/net/sourceforge/jnlp/tools/CharacterEncoder.java | 354 - netx/net/sourceforge/jnlp/tools/HexDumpEncoder.java | 120 netx/net/sourceforge/jnlp/tools/JarRunner.java | 15 netx/net/sourceforge/jnlp/tools/JarSigner.java | 553 -- netx/net/sourceforge/jnlp/tools/JarSignerResources.java | 212 netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java | 69 netx/net/sourceforge/jnlp/tools/KeyTool.java | 461 - netx/net/sourceforge/jnlp/util/FileUtils.java | 159 netx/net/sourceforge/jnlp/util/PropertiesFile.java | 146 netx/net/sourceforge/jnlp/util/Reflect.java | 146 netx/net/sourceforge/jnlp/util/WeakList.java | 126 netx/net/sourceforge/jnlp/util/XDesktopEntry.java | 213 netx/net/sourceforge/nanoxml/XMLElement.java | 1334 ----- netx/net/sourceforge/nanoxml/XMLParseException.java | 130 patches/extensions/liveconnect.patch | 87 plugin/icedteanp/IcedTeaJavaRequestProcessor.cc | 1392 ----- plugin/icedteanp/IcedTeaJavaRequestProcessor.h | 233 plugin/icedteanp/IcedTeaNPPlugin.cc | 2453 ---------- plugin/icedteanp/IcedTeaNPPlugin.h | 136 plugin/icedteanp/IcedTeaPluginRequestProcessor.cc | 988 ---- plugin/icedteanp/IcedTeaPluginRequestProcessor.h | 146 plugin/icedteanp/IcedTeaPluginUtils.cc | 1047 ---- plugin/icedteanp/IcedTeaPluginUtils.h | 296 - plugin/icedteanp/IcedTeaRunnable.cc | 75 plugin/icedteanp/IcedTeaRunnable.h | 104 plugin/icedteanp/IcedTeaScriptablePluginObject.cc | 897 --- plugin/icedteanp/IcedTeaScriptablePluginObject.h | 212 plugin/icedteanp/java/netscape/javascript/JSException.java | 140 plugin/icedteanp/java/netscape/javascript/JSObject.java | 297 - plugin/icedteanp/java/netscape/javascript/JSObjectCreatePermission.java | 47 plugin/icedteanp/java/netscape/javascript/JSProxy.java | 58 plugin/icedteanp/java/netscape/javascript/JSRunnable.java | 72 plugin/icedteanp/java/netscape/javascript/JSUtil.java | 59 plugin/icedteanp/java/netscape/security/ForbiddenTargetException.java | 52 plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java | 71 plugin/icedteanp/java/sun/applet/GetMemberPluginCallRequest.java | 63 plugin/icedteanp/java/sun/applet/GetWindowPluginCallRequest.java | 65 plugin/icedteanp/java/sun/applet/JavaConsole.java | 365 - plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java | 696 -- plugin/icedteanp/java/sun/applet/PasswordAuthenticationDialog.java | 241 plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java | 1505 ------ plugin/icedteanp/java/sun/applet/PluginAppletViewer.java | 2056 -------- plugin/icedteanp/java/sun/applet/PluginCallRequest.java | 89 plugin/icedteanp/java/sun/applet/PluginCallRequestFactory.java | 61 plugin/icedteanp/java/sun/applet/PluginClassLoader.java | 51 plugin/icedteanp/java/sun/applet/PluginCookieInfoRequest.java | 74 plugin/icedteanp/java/sun/applet/PluginCookieManager.java | 88 plugin/icedteanp/java/sun/applet/PluginDebug.java | 51 plugin/icedteanp/java/sun/applet/PluginException.java | 53 plugin/icedteanp/java/sun/applet/PluginMain.java | 319 - plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java | 268 - plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java | 147 plugin/icedteanp/java/sun/applet/PluginObjectStore.java | 132 plugin/icedteanp/java/sun/applet/PluginProxyInfoRequest.java | 81 plugin/icedteanp/java/sun/applet/PluginProxySelector.java | 195 plugin/icedteanp/java/sun/applet/PluginStreamHandler.java | 454 - plugin/icedteanp/java/sun/applet/RequestQueue.java | 77 plugin/icedteanp/java/sun/applet/TestEnv.java | 172 plugin/icedteanp/java/sun/applet/VoidPluginCallRequest.java | 54 plugin/tests/LiveConnect/DummyObject.java | 15 plugin/tests/LiveConnect/OverloadTestHelper1.java | 1 plugin/tests/LiveConnect/OverloadTestHelper2.java | 1 plugin/tests/LiveConnect/OverloadTestHelper3.java | 1 plugin/tests/LiveConnect/PluginTest.java | 710 -- plugin/tests/LiveConnect/build | 18 plugin/tests/LiveConnect/common.js | 219 plugin/tests/LiveConnect/index.html | 91 plugin/tests/LiveConnect/jjs_eval_test.js | 57 plugin/tests/LiveConnect/jjs_func_parameters_tests.js | 107 plugin/tests/LiveConnect/jjs_func_rettype_tests.js | 61 plugin/tests/LiveConnect/jjs_get_tests.js | 114 plugin/tests/LiveConnect/jjs_set_tests.js | 314 - plugin/tests/LiveConnect/jsj_func_overload_tests.js | 181 plugin/tests/LiveConnect/jsj_func_parameters_tests.js | 216 plugin/tests/LiveConnect/jsj_func_rettype_tests.js | 262 - plugin/tests/LiveConnect/jsj_get_tests.js | 260 - plugin/tests/LiveConnect/jsj_set_tests.js | 318 - plugin/tests/LiveConnect/jsj_type_casting_tests.js | 825 --- plugin/tests/LiveConnect/jsj_type_conversion_tests.js | 825 --- diffs (truncated from 46542 to 500 lines): diff -r afdd3f284524 -r a85679cc93f4 ChangeLog --- a/ChangeLog Mon Oct 18 21:29:09 2010 +0100 +++ b/ChangeLog Tue Oct 19 19:55:35 2010 +0100 @@ -1,3 +1,272 @@ 2010-10-18 Andrew John Hughes + + Move NetX and the plugin to the IcedTea-Web project: + http://icedtea.classpath.org/hg/icedtea-web + * extra/net/sourceforge/jnlp/about/HTMLPanel.java, + * extra/net/sourceforge/jnlp/about/Main.java, + * extra/net/sourceforge/jnlp/about/resources/about.html, + * extra/net/sourceforge/jnlp/about/resources/applications.html, + * extra/net/sourceforge/jnlp/about/resources/notes.html, + * javaws.desktop, + * netx/javaws.1, + * netx/javax/jnlp/BasicService.java, + * netx/javax/jnlp/ClipboardService.java, + * netx/javax/jnlp/DownloadService.java, + * netx/javax/jnlp/DownloadServiceListener.java, + * netx/javax/jnlp/ExtendedService.java, + * netx/javax/jnlp/ExtensionInstallerService.java, + * netx/javax/jnlp/FileContents.java, + * netx/javax/jnlp/FileOpenService.java, + * netx/javax/jnlp/FileSaveService.java, + * netx/javax/jnlp/JNLPRandomAccessFile.java, + * netx/javax/jnlp/PersistenceService.java, + * netx/javax/jnlp/PrintService.java, + * netx/javax/jnlp/ServiceManager.java, + * netx/javax/jnlp/ServiceManagerStub.java, + * netx/javax/jnlp/SingleInstanceListener.java, + * netx/javax/jnlp/SingleInstanceService.java, + * netx/javax/jnlp/UnavailableServiceException.java, + * netx/net/sourceforge/jnlp/AppletDesc.java, + * netx/net/sourceforge/jnlp/ApplicationDesc.java, + * netx/net/sourceforge/jnlp/AssociationDesc.java, + * netx/net/sourceforge/jnlp/ComponentDesc.java, + * netx/net/sourceforge/jnlp/DefaultLaunchHandler.java, + * netx/net/sourceforge/jnlp/ExtensionDesc.java, + * netx/net/sourceforge/jnlp/IconDesc.java, + * netx/net/sourceforge/jnlp/InformationDesc.java, + * netx/net/sourceforge/jnlp/InstallerDesc.java, + * netx/net/sourceforge/jnlp/JARDesc.java, + * netx/net/sourceforge/jnlp/JNLPFile.java, + * netx/net/sourceforge/jnlp/JNLPSplashScreen.java, + * netx/net/sourceforge/jnlp/JREDesc.java, + * netx/net/sourceforge/jnlp/LaunchException.java, + * netx/net/sourceforge/jnlp/LaunchHandler.java, + * netx/net/sourceforge/jnlp/Launcher.java, + * netx/net/sourceforge/jnlp/MenuDesc.java, + * netx/net/sourceforge/jnlp/NetxPanel.java, + * netx/net/sourceforge/jnlp/Node.java, + * netx/net/sourceforge/jnlp/PackageDesc.java, + * netx/net/sourceforge/jnlp/ParseException.java, + * netx/net/sourceforge/jnlp/Parser.java, + * netx/net/sourceforge/jnlp/PluginBridge.java, + * netx/net/sourceforge/jnlp/PropertyDesc.java, + * netx/net/sourceforge/jnlp/RelatedContentDesc.java, + * netx/net/sourceforge/jnlp/ResourcesDesc.java, + * netx/net/sourceforge/jnlp/SecurityDesc.java, + * netx/net/sourceforge/jnlp/ShortcutDesc.java, + * netx/net/sourceforge/jnlp/StreamEater.java, + * netx/net/sourceforge/jnlp/UpdateDesc.java, + * netx/net/sourceforge/jnlp/Version.java, + * netx/net/sourceforge/jnlp/cache/CacheEntry.java, + * netx/net/sourceforge/jnlp/cache/CacheUtil.java, + * netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java, + * netx/net/sourceforge/jnlp/cache/DownloadIndicator.java, + * netx/net/sourceforge/jnlp/cache/Resource.java, + * netx/net/sourceforge/jnlp/cache/ResourceTracker.java, + * netx/net/sourceforge/jnlp/cache/UpdatePolicy.java, + * netx/net/sourceforge/jnlp/cache/package.html, + * netx/net/sourceforge/jnlp/event/ApplicationEvent.java, + * netx/net/sourceforge/jnlp/event/ApplicationListener.java, + * netx/net/sourceforge/jnlp/event/DownloadEvent.java, + * netx/net/sourceforge/jnlp/event/DownloadListener.java, + * netx/net/sourceforge/jnlp/event/package.html, + * netx/net/sourceforge/jnlp/package.html, + * netx/net/sourceforge/jnlp/resources/Manifest.mf, + * netx/net/sourceforge/jnlp/resources/Messages.properties, + * netx/net/sourceforge/jnlp/resources/about.jnlp, + * netx/net/sourceforge/jnlp/resources/default.jnlp, + * netx/net/sourceforge/jnlp/runtime/AppThreadGroup.java, + * netx/net/sourceforge/jnlp/runtime/AppletAudioClip.java, + * netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java, + * netx/net/sourceforge/jnlp/runtime/AppletInstance.java, + * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java, + * netx/net/sourceforge/jnlp/runtime/Boot.java, + * netx/net/sourceforge/jnlp/runtime/Boot13.java, + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java, + * netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java, + * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java, + * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java, + * netx/net/sourceforge/jnlp/runtime/package.html, + * netx/net/sourceforge/jnlp/security/AccessWarningPane.java, + * netx/net/sourceforge/jnlp/security/AppletWarningPane.java, + * netx/net/sourceforge/jnlp/security/CertVerifier.java, + * netx/net/sourceforge/jnlp/security/CertWarningPane.java, + * netx/net/sourceforge/jnlp/security/CertsInfoPane.java, + * netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java, + * netx/net/sourceforge/jnlp/security/MoreInfoPane.java, + * netx/net/sourceforge/jnlp/security/NotAllSignedWarningPane.java, + * netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java, + * netx/net/sourceforge/jnlp/security/SecurityUtil.java, + * netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java, + * netx/net/sourceforge/jnlp/security/SingleCertInfoPane.java, + * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java, + * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java, + * netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java, + * netx/net/sourceforge/jnlp/services/ExtendedSingleInstanceService.java, + * netx/net/sourceforge/jnlp/services/InstanceExistsException.java, + * netx/net/sourceforge/jnlp/services/ServiceUtil.java, + * netx/net/sourceforge/jnlp/services/SingleInstanceLock.java, + * netx/net/sourceforge/jnlp/services/XBasicService.java, + * netx/net/sourceforge/jnlp/services/XClipboardService.java, + * netx/net/sourceforge/jnlp/services/XDownloadService.java, + * netx/net/sourceforge/jnlp/services/XExtendedService.java, + * netx/net/sourceforge/jnlp/services/XExtensionInstallerService.java, + * netx/net/sourceforge/jnlp/services/XFileContents.java, + * netx/net/sourceforge/jnlp/services/XFileOpenService.java, + * netx/net/sourceforge/jnlp/services/XFileSaveService.java, + * netx/net/sourceforge/jnlp/services/XJNLPRandomAccessFile.java, + * netx/net/sourceforge/jnlp/services/XPersistenceService.java, + * netx/net/sourceforge/jnlp/services/XPrintService.java, + * netx/net/sourceforge/jnlp/services/XServiceManagerStub.java, + * netx/net/sourceforge/jnlp/services/XSingleInstanceService.java, + * netx/net/sourceforge/jnlp/services/package.html, + * netx/net/sourceforge/jnlp/tools/CharacterEncoder.java, + * netx/net/sourceforge/jnlp/tools/HexDumpEncoder.java, + * netx/net/sourceforge/jnlp/tools/JarRunner.java, + * netx/net/sourceforge/jnlp/tools/JarSigner.java, + * netx/net/sourceforge/jnlp/tools/JarSignerResources.java, + * netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java, + * netx/net/sourceforge/jnlp/tools/KeyTool.java, + * netx/net/sourceforge/jnlp/util/FileUtils.java, + * netx/net/sourceforge/jnlp/util/PropertiesFile.java, + * netx/net/sourceforge/jnlp/util/Reflect.java, + * netx/net/sourceforge/jnlp/util/WeakList.java, + * netx/net/sourceforge/jnlp/util/XDesktopEntry.java, + * netx/net/sourceforge/nanoxml/XMLElement.java, + * netx/net/sourceforge/nanoxml/XMLParseException.java, + * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc, + * plugin/icedteanp/IcedTeaJavaRequestProcessor.h, + * plugin/icedteanp/IcedTeaNPPlugin.cc, + * plugin/icedteanp/IcedTeaNPPlugin.h, + * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc, + * plugin/icedteanp/IcedTeaPluginRequestProcessor.h, + * plugin/icedteanp/IcedTeaPluginUtils.cc, + * plugin/icedteanp/IcedTeaPluginUtils.h, + * plugin/icedteanp/IcedTeaRunnable.cc, + * plugin/icedteanp/IcedTeaRunnable.h, + * plugin/icedteanp/IcedTeaScriptablePluginObject.cc, + * plugin/icedteanp/IcedTeaScriptablePluginObject.h, + * plugin/icedteanp/java/netscape/javascript/JSException.java, + * plugin/icedteanp/java/netscape/javascript/JSObject.java, + * plugin/icedteanp/java/netscape/javascript/JSObjectCreatePermission.java, + * plugin/icedteanp/java/netscape/javascript/JSProxy.java, + * plugin/icedteanp/java/netscape/javascript/JSRunnable.java, + * plugin/icedteanp/java/netscape/javascript/JSUtil.java, + * plugin/icedteanp/java/netscape/security/ForbiddenTargetException.java, + * plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java, + * plugin/icedteanp/java/sun/applet/GetMemberPluginCallRequest.java, + * plugin/icedteanp/java/sun/applet/GetWindowPluginCallRequest.java, + * plugin/icedteanp/java/sun/applet/JavaConsole.java, + * plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java, + * plugin/icedteanp/java/sun/applet/PasswordAuthenticationDialog.java, + * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java, + * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java, + * plugin/icedteanp/java/sun/applet/PluginCallRequest.java, + * plugin/icedteanp/java/sun/applet/PluginCallRequestFactory.java, + * plugin/icedteanp/java/sun/applet/PluginClassLoader.java, + * plugin/icedteanp/java/sun/applet/PluginCookieInfoRequest.java, + * plugin/icedteanp/java/sun/applet/PluginCookieManager.java, + * plugin/icedteanp/java/sun/applet/PluginDebug.java, + * plugin/icedteanp/java/sun/applet/PluginException.java, + * plugin/icedteanp/java/sun/applet/PluginMain.java, + * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java, + * plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java, + * plugin/icedteanp/java/sun/applet/PluginObjectStore.java, + * plugin/icedteanp/java/sun/applet/PluginProxyInfoRequest.java, + * plugin/icedteanp/java/sun/applet/PluginProxySelector.java, + * plugin/icedteanp/java/sun/applet/PluginStreamHandler.java, + * plugin/icedteanp/java/sun/applet/RequestQueue.java, + * plugin/icedteanp/java/sun/applet/TestEnv.java, + * plugin/icedteanp/java/sun/applet/VoidPluginCallRequest.java, + * plugin/tests/LiveConnect/DummyObject.java, + * plugin/tests/LiveConnect/OverloadTestHelper1.java, + * plugin/tests/LiveConnect/OverloadTestHelper2.java, + * plugin/tests/LiveConnect/OverloadTestHelper3.java, + * plugin/tests/LiveConnect/PluginTest.java, + * plugin/tests/LiveConnect/build, + * plugin/tests/LiveConnect/common.js, + * plugin/tests/LiveConnect/index.html, + * plugin/tests/LiveConnect/jjs_eval_test.js, + * plugin/tests/LiveConnect/jjs_func_parameters_tests.js, + * plugin/tests/LiveConnect/jjs_func_rettype_tests.js, + * plugin/tests/LiveConnect/jjs_get_tests.js, + * plugin/tests/LiveConnect/jjs_set_tests.js, + * plugin/tests/LiveConnect/jsj_func_overload_tests.js, + * plugin/tests/LiveConnect/jsj_func_parameters_tests.js, + * plugin/tests/LiveConnect/jsj_func_rettype_tests.js, + * plugin/tests/LiveConnect/jsj_get_tests.js, + * plugin/tests/LiveConnect/jsj_set_tests.js, + * plugin/tests/LiveConnect/jsj_type_casting_tests.js, + * plugin/tests/LiveConnect/jsj_type_conversion_tests.js, + * patches/extensions/liveconnect.patch: + Removed. + * Makefile.am: + Removed aliases for dead targets. + (NETX_SRCDIR): Removed. + (NETX_RESOURCE_DIR): Likewise. + (NETX_EXTRA_DIR): Likewise. + (NETX_BOOTSTRAP_CLASSES): Likewise. + (PLUGIN_BOOTSTRAP_CLASSES): Likewise. + (NETX_SUN_CLASSES): Likewise. + (PLUGIN_SUN_CLASSES): Likewise. + (ICEDTEA_BOOTSTRAP_CLASSES): Remove above four variables. + (ICEDTEAPLUGIN_CLEAN): Removed. + (LIVECONNECT_DIR): Removed. + (PLUGIN_DIR): Removed. + (PLUGIN_SRCDIR): Removed. + (LIVECONNECT_SRCS): Removed. + (ICEDTEAPLUGIN_TARGET): Removed. + (PLUGIN_TEST_SRCS): Removed. + (ICEDTEA_PATCHES): Drop liveconnect.patch. + (PLUGIN_VERSION): Removed. + (EXTRA_DIST): Drop extra javaws.png javaws.desktop plugin netx. + (clean-local): Remove dead targets. + (.PHONY): Likewise. + (icedtea-against-icedtea): Likewise. + (clean-icedtea-against-icedtea): Likewise. + (icedtea-debug-against-icedtea): Likewise. + (clean-icedtea-debug-against-icedtea): Likewise. + (add-plugin): Dropped. + (clean-add-plugin): Likewise. + (add-plugin-debug): Likewise. + (clean-add-plugin-debug): Likewise. + (add-netx): Dropped. + (clean-add-netx): Likewise. + (add-netx-debug): Likewise. + (clean-add-netx-debug): Likewise. + (icedtea-against-ecj): Drop dead targets. + (clean-icedtea-against-ecj): Likewise. + (add-plugin-ecj): Likewise. + (clean-add-plugin-ecj): Likewise. + (add-netx-ecj): Dropped. + (clean-add-netx-ecj): Likewise. + (PLUGIN_SRC): Removed. + (PLUGIN_OBJECTS): Removed. + ($(PLUGIN_DIR)/%.o)): Removed. + ($(PLUGIN_DIR)/IcedTeaPlugin.so): Removed. + (clean-IcedTeaPlugin): Likewise. + (plugin): Likewise. + (clean-plugin): Likewise. + (liveconnect-source-files.txt): Likewise. + (liveconnect): Likewise. + (liveconnect-dist): Likewise. + (clean-liveconnect): Likewise. + (netx-source-files.txt): Likewise. + (netx): Likewise. + (netx-dist): Likewise. + (clean-netx): Likewise. + (extra-source-files.txt): Likewise. + (extra-class-files): Likewise. + (clean-extra): Likewise. + (extra-lib/about.jar): Likewise. + (ADD_ZERO_CONFIGURE_ARGS): Remove dead --disable-plugin. + (plugin-tests): Removed. + * acinclude.m4: + (IT_CHECK_PLUGIN): Removed. + (IT_CHECK_PLUGIN_DEPENDENCIES): Likewise. + (IT_CHECK_XULRUNNER_VERSION): Likewise. + * configure.ac: Don't call IT_CHECK_XULRUNNER_VERSION. + 2010-10-18 Andrew John Hughes * Makefile.am: diff -r afdd3f284524 -r a85679cc93f4 Makefile.am --- a/Makefile.am Mon Oct 18 21:29:09 2010 +0100 +++ b/Makefile.am Tue Oct 19 19:55:35 2010 +0100 @@ -48,10 +48,6 @@ LANGTOOLS = openjdk-ecj/langtools/src/sh LANGTOOLS = openjdk-ecj/langtools/src/share/classes CORBA = openjdk-ecj/corba/src/share/classes -NETX_SRCDIR = $(abs_top_srcdir)/netx -NETX_RESOURCE_DIR=$(NETX_SRCDIR)/net/sourceforge/jnlp/resources -NETX_EXTRA_DIR=$(abs_top_srcdir)/extra/net/sourceforge/jnlp/about/resources - OPENJDK_SOURCEPATH_DIRS = \ $(SHARE):$(SOLARIS):$(LANGTOOLS):$(CORBA) @@ -77,55 +73,12 @@ ICEDTEA_BOOTSTRAP_DIRS = \ $(LANGTOOLS)/com/sun/mirror \ $(LANGTOOLS)/com/sun/tools/apt -# PR43578 - java.security.CodeSource.getCodeSigners() missing -# PR43582 - Missing javax.swing.JTable.setFillsViewportHeight -# PR43585 - java.security.KeyStore.TrustedCertificateEntry class missing -NETX_BOOTSTRAP_CLASSES = \ - $(SHARE)/java/security/CodeSource.java \ - $(SHARE)/javax/swing/JTable.java \ - $(SHARE)/java/security/KeyStore.java - -# PR46074 - Missing java.net cookie code required by IcedTea plugin -PLUGIN_BOOTSTRAP_CLASSES = \ - $(SHARE)/java/net/CookieManager.java \ - $(SHARE)/java/net/HttpCookie.java \ - $(SHARE)/java/net/CookieHandler.java - -# IT563 - NetX uses sun.security code -# IT564 - NetX depends on sun.misc.BASE64Encoder -# IT570 - NetX depends on sun.applet.AppletViewPanel -# IT571 - NetX depends on com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager.java -NETX_SUN_CLASSES = \ - $(SHARE)/sun/security/provider/X509Factory.java \ - $(SHARE)/sun/security/util/SecurityConstants.java \ - $(SHARE)/sun/security/util/HostnameChecker.java \ - $(SHARE)/sun/security/util/DerValue.java \ - $(SHARE)/sun/security/x509/X500Name.java \ - $(SHARE)/sun/misc/BASE64Encoder.java \ - $(SHARE)/sun/applet/AppletViewerPanel.java \ - $(SHARE)/sun/security/validator/ValidatorException.java \ - $(SHARE)/com/sun/net/ssl/internal/ssl/X509ExtendedTrustManager.java - -# IT573 - Plugin depends on sun.awt,X11.XEmbeddedFrame.java -# IT574 - Plugin depends on sun.misc.Ref -# IT575 - Plugin depends on com.sun/jndi.toolkit.url.UrlUtil -# IT576 - Plugin depends on sun.applet.AppletImageRef -PLUGIN_SUN_CLASSES = \ - $(SOLARIS)/sun/awt/X11/XEmbeddedFrame.java \ - $(SHARE)/sun/misc/Ref.java \ - $(SHARE)/com/sun/jndi/toolkit/url/UrlUtil.java \ - $(SHARE)/sun/applet/AppletImageRef.java - # PR42003 - javax.swing.plaf.basic.BasicDirectoryModel # PR43389 - javax.management.StandardMBean ICEDTEA_BOOTSTRAP_CLASSES = \ $(SHARE)/javax/swing/plaf/basic/BasicDirectoryModel.java \ $(SHARE)/javax/management/StandardMBean.java \ - $(SHARE)/com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel.java \ - $(NETX_BOOTSTRAP_CLASSES) \ - $(NETX_SUN_CLASSES) \ - $(PLUGIN_BOOTSTRAP_CLASSES) \ - $(PLUGIN_SUN_CLASSES) + $(SHARE)/com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel.java # Flags IT_CFLAGS=$(CFLAGS) $(ARCHFLAG) @@ -143,16 +96,6 @@ endif endif # FIXME (HotSpot): HotSpot changeset logic goes here - -if ENABLE_PLUGIN -ICEDTEAPLUGIN_CLEAN = clean-IcedTeaPlugin -LIVECONNECT_DIR = netscape sun/applet -PLUGIN_DIR=$(abs_top_builddir)/plugin/icedteanp -PLUGIN_SRCDIR=$(abs_top_srcdir)/plugin/icedteanp -LIVECONNECT_SRCS = $(PLUGIN_SRCDIR)/java -ICEDTEAPLUGIN_TARGET = $(PLUGIN_DIR)/IcedTeaPlugin.so \ - stamps/liveconnect-dist.stamp -endif if ENABLE_PULSE_JAVA # include the makefile in pulseaudio subdir @@ -223,8 +166,6 @@ OPENJDK_ECJ_TREE = stamps/patch-ecj.stam OPENJDK_ECJ_TREE = stamps/patch-ecj.stamp # Sources list - -PLUGIN_TEST_SRCS = $(abs_top_srcdir)/plugin/tests/LiveConnect/*.java REWRITER_SRCS = $(abs_top_srcdir)/rewriter/com/redhat/rewriter/ClassRewriter.java @@ -369,11 +310,6 @@ ICEDTEA_PATCHES += \ patches/icedtea-rhino.patch endif -if ENABLE_PLUGIN -ICEDTEA_PATCHES += \ - patches/extensions/liveconnect.patch -endif - if BUILD_CACAO ICEDTEA_PATCHES += \ patches/cacao/launcher.patch \ @@ -475,8 +411,6 @@ if HAS_PKGVERSION if HAS_PKGVERSION ICEDTEA_PKG = $(EMPTY) (${PKGVERSION}) endif - -PLUGIN_VERSION = $(ICEDTEA_NAME) $(PACKAGE_VERSION)$(ICEDTEA_REV)$(ICEDTEA_PKG) ICEDTEA_ENV = \ ALT_JDK_IMPORT_PATH="$(BOOT_DIR)" \ @@ -581,15 +515,13 @@ ICEDTEA_ENV_ECJ = $(ICEDTEA_ENV) \ # FIXME (distclean): Add jtreg sources # FIXME (distclean): Add pulseaudio sources -EXTRA_DIST = generated $(NETX_SRCDIR) \ +EXTRA_DIST = generated \ $(abs_top_srcdir)/patches/* \ contrib shark arm_port \ - extra overlays \ - javaws.png javaws.desktop \ + overlays \ jconsole.desktop policytool.desktop \ test/jtreg \ HACKING pulseaudio fsg.sh \ - $(abs_top_srcdir)/plugin \ hotspot.map \ autogen.sh \ tapset/hotspot.stp.in \ @@ -608,11 +540,10 @@ check-local: jtregcheck check-local: jtregcheck clean-local: clean-jtreg clean-jtreg-reports $(PULSE_JAVA_CLEAN_TARGET) \ - clean-netx clean-plugin clean-liveconnect clean-icedtea clean-icedtea-debug \ - clean-icedtea-ecj clean-extract clean-ports clean-overlay clean-native-ecj \ - clean-icedtea-against-icedtea clean-icedtea-debug-against-icedtea \ + clean-icedtea clean-icedtea-debug clean-icedtea-ecj clean-extract clean-ports \ + clean-overlay clean-native-ecj clean-icedtea-against-icedtea clean-icedtea-debug-against-icedtea \ clean-icedtea-against-ecj clean-extract-ecj clean-generated clean-replace-hotspot \ - clean-rewriter clean-rewrite-rhino clean-extra clean-rt clean-bootstrap-directory \ + clean-rewriter clean-rewrite-rhino clean-rt clean-bootstrap-directory \ clean-bootstrap-directory-ecj clean-bootstrap-directory-symlink \ clean-bootstrap-directory-symlink-ecj if [ -e bootstrap ]; then \ @@ -640,18 +571,16 @@ install: clean-bootstrap-directory-symlink clean-bootstrap-directory-ecj \ clean-bootstrap-directory-symlink-ecj icedtea icedtea-debug \ clean-icedtea icedtea-against-icedtea clean-icedtea-ecj \ - clean-tools-jar clean-copy clean-rt $(ICEDTEAPLUGIN_CLEAN) hotspot \ + clean-tools-jar clean-copy clean-rt hotspot \ hotspot-helper clean-extra clean-jtreg clean-jtreg-reports \ clean-add-zero clean-add-zero-debug clean-icedtea clean-icedtea-debug clean-icedtea-against-ecj clean-cacao clean-add-cacao clean-add-cacao-debug \ clean-ports clean-overlay clean-extract-ecj clean-extract clean-extract-openjdk \ clean-replace-hotspot clean-generated clean-download clean-hgforest clean-download-openjdk \ - clean-rewriter clean-rewrite-rhino clean-add-netx clean-add-netx-debug \ - clean-add-plugin clean-add-plugin-debug clean-add-systemtap clean-add-systemtap-debug \ + clean-rewriter clean-rewrite-rhino clean-add-systemtap clean-add-systemtap-debug \ clean-add-pulseaudio clean-add-pulseaudio-debug clean-add-nss clean-add-nss-debug \ - clean-add-tzdata-support clean-add-tzdata-support-debug clean-add-plugin-ecj \ - clean-add-netx-ecj clean-add-systemtap-ecj clean-add-pulseaudio-ecj clean-add-nss-ecj \ - clean-add-tzdata-support-ecj + clean-add-tzdata-support clean-add-tzdata-support-debug clean-add-systemtap-ecj \ + clean-add-pulseaudio-ecj clean-add-nss-ecj clean-add-tzdata-support-ecj env: @echo 'unset JAVA_HOME' @@ -1375,118 +1304,23 @@ clean-icedtea-debug: rm -f stamps/icedtea-debug.stamp stamps/icedtea-against-icedtea.stamp: stamps/icedtea.stamp stamps/add-cacao.stamp stamps/add-zero.stamp \ - stamps/add-plugin.stamp stamps/add-netx.stamp stamps/add-systemtap.stamp stamps/add-pulseaudio.stamp \ - stamps/add-nss.stamp stamps/add-tzdata-support.stamp + stamps/add-systemtap.stamp stamps/add-pulseaudio.stamp stamps/add-nss.stamp stamps/add-tzdata-support.stamp mkdir -p stamps touch stamps/icedtea-against-icedtea.stamp -clean-icedtea-against-icedtea: clean-add-zero clean-add-cacao clean-add-plugin clean-add-netx \ - clean-add-systemtap clean-add-pulseaudio clean-add-nss clean-add-tzdata-support +clean-icedtea-against-icedtea: clean-add-zero clean-add-cacao clean-add-systemtap clean-add-pulseaudio \ + clean-add-nss clean-add-tzdata-support rm -f stamps/icedtea-against-icedtea.stamp stamps/icedtea-debug-against-icedtea.stamp: stamps/icedtea-debug.stamp stamps/add-cacao-debug.stamp \ - stamps/add-zero-debug.stamp stamps/add-plugin-debug.stamp stamps/add-netx-debug.stamp \ - stamps/add-systemtap-debug.stamp stamps/add-pulseaudio-debug.stamp stamps/add-nss-debug.stamp \ - stamps/add/tzdata-support-debug.stamp + stamps/add-zero-debug.stamp stamps/add-systemtap-debug.stamp stamps/add-pulseaudio-debug.stamp \ + stamps/add-nss-debug.stamp stamps/add/tzdata-support-debug.stamp mkdir -p stamps touch stamps/icedtea-debug-against-icedtea.stamp -clean-icedtea-debug-against-icedtea: clean-add-zero-debug clean-add-cacao-debug clean-add-plugin-debug \ - clean-add-netx-debug clean-add-systemtap-debug clean-add-pulseaudio-debug clean-add-nss-debug \ - clean-add-tzdata-support-debug +clean-icedtea-debug-against-icedtea: clean-add-zero-debug clean-add-cacao-debug clean-add-systemtap-debug \ + clean-add-pulseaudio-debug clean-add-nss-debug clean-add-tzdata-support-debug rm -f stamps/icedtea-debug-against-icedtea.stamp - -stamps/add-plugin.stamp: stamps/plugin.stamp stamps/icedtea.stamp -if ENABLE_PLUGIN - cp -pPRf $(PLUGIN_DIR)/IcedTeaPlugin.so \ - $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)/ - cp -pPRf $(PLUGIN_DIR)/IcedTeaPlugin.so \ - $(BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR)/ - cp -pPRf $(abs_top_builddir)/liveconnect/lib/classes.jar \ - $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/plugin.jar - cp -pPRf $(abs_top_builddir)/liveconnect/lib/classes.jar \ - $(BUILD_OUTPUT_DIR)/j2re-image/lib/plugin.jar -endif - touch stamps/add-plugin.stamp - -clean-add-plugin: - rm -f $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)/IcedTeaPlugin.so - rm -f $(BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR)/IcedTeaPlugin.so - rm -f $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/plugin.jar - rm -f $(BUILD_OUTPUT_DIR)/j2re-image/lib/plugin.jar From fitzsim at fitzsim.org Tue Oct 19 09:22:16 2010 From: fitzsim at fitzsim.org (Thomas Fitzsimmons) Date: Tue, 19 Oct 2010 12:22:16 -0400 Subject: [IMPORTANT] NetX & Plugin Move In-Reply-To: <20101019141107.GC22251@redhat.com> (Deepak Bhole's message of "Tue, 19 Oct 2010 10:11:08 -0400") References: <20101019115725.GA5740@bree.middle-earth.co.uk> <20101019141107.GC22251@redhat.com> Message-ID: Hi Deepak, Deepak Bhole writes: > * Dr Andrew John Hughes [2010-10-19 07:58]: >> I'm working on creating the new repository for the plugin and NetX. >> Please don't commit any changes to NetX or the plugin until I announce >> the new repository. > > Nice! It will be great to have the Plugin and Web stuff out of > main-line. With gcjwebplugin I went the opposite direction and merged it into GNU Classpath. The advantages of that arrangement outweighed the inconveniences. It meant that more people built the code regularly and in different environments and meant less fiddling for non-plugin developers wanting to test a failing applet against the development tree. > For one, it will avoid double commits to icedtea and > icedtea6 each time.. Do you foresee a need for stable and development branches of the plugin and NetX? > and it will be easier for distros to update just > those specific parts. Are you planning to provide standalone NetX/plugin distribution tarballs, separate from IcedTea? Thomas From dbhole at redhat.com Tue Oct 19 10:44:54 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Tue, 19 Oct 2010 13:44:54 -0400 Subject: [IMPORTANT] NetX & Plugin Move In-Reply-To: References: <20101019115725.GA5740@bree.middle-earth.co.uk> <20101019141107.GC22251@redhat.com> Message-ID: <20101019174454.GD22251@redhat.com> * Thomas Fitzsimmons [2010-10-19 12:21]: > > > Hi Deepak, > > Deepak Bhole writes: > > > * Dr Andrew John Hughes [2010-10-19 07:58]: > >> I'm working on creating the new repository for the plugin and NetX. > >> Please don't commit any changes to NetX or the plugin until I announce > >> the new repository. > > > > Nice! It will be great to have the Plugin and Web stuff out of > > main-line. > > With gcjwebplugin I went the opposite direction and merged it into GNU > Classpath. The advantages of that arrangement outweighed the > inconveniences. It meant that more people built the code regularly and > in different environments and meant less fiddling for non-plugin > developers wanting to test a failing applet against the development > tree. > Hi Tom, I agree with the above but with the changed landscape of the project, the plugin-in-dev-tree model poses other new problems now which require this move. For one, it requires significant backporting efforts. Currently there are 3 supported branches (1.7, 1.8, 1.9) and two tips, IcedTea6 and IcedTea (7). Every commit has to be evaluated for these, and then backported one by one. Once OpenJDK7 is out and IcedTea (7) becomes generally used, it will have additional point branches. Furthermore, pushing a new IcedTea/OpenJDK version requires significant testing effort on the distro side, which limits how often it can be pushed, which in turn limits how quickly the plugin fixes become available to users. > > For one, it will avoid double commits to icedtea and > > icedtea6 each time.. > > Do you foresee a need for stable and development branches of the plugin > and NetX? > > > and it will be easier for distros to update just > > those specific parts. > > Are you planning to provide standalone NetX/plugin distribution > tarballs, separate from IcedTea? > Yes to both of the above. As the plugin gains mainstream popularity, more bugs are being found and the turnaround time for the bug fixes to make it back to the distros is quite significant at the moment. We definitely need to reduce that. Once the bugs become as infrequent as for OpenJDK, we can look into folding it back. For the foreseeable future though, I believe the split is the right thing to do. Cheers, Deepak > Thomas > From joe.darcy at oracle.com Tue Oct 19 12:18:17 2010 From: joe.darcy at oracle.com (Joe Darcy) Date: Tue, 19 Oct 2010 12:18:17 -0700 Subject: Request to backport 6979979: Rounding error in font sizes selected by the GTK Look and Feel In-Reply-To: <4CBDDAD5.1010809@redhat.com> References: <4CBDD155.900@redhat.com> <20101019173816.GD3392@rivendell.middle-earth.co.uk> <4CBDDAD5.1010809@redhat.com> Message-ID: <4CBDEEF9.6030808@oracle.com> Omair Majid wrote: > On 10/19/2010 01:38 PM, Dr Andrew John Hughes wrote: >> On 13:11 Tue 19 Oct , Omair Majid wrote: >>> Hi, >>> >>> I would like to backport the following changeset to openjdk6: >>> >>> changeset: 2720:bb733c150f94 >>> user: omajid >>> date: Tue Sep 14 10:45:38 2010 -0400 >>> summary: 6979979: Rounding error in font sizes selected by the GTK >>> Look and Feel >>> >>> It selects a better font size the when Swing is using the >>> GTKLookAndFeel. >>> >>> Thanks, >>> Omair >> >> Is this backported in IcedTea6? > > As far as I am aware, no. I am going to add this to IcedTea6 if the > openjdk6 devs are ok with adding it to openjdk6. > > Cheers, > Omair Hello Omair. Approved to be backported to OpenJDK 6 b21 (the current build). Thanks, -Joe From dbhole at redhat.com Tue Oct 19 12:58:36 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Tue, 19 Oct 2010 15:58:36 -0400 Subject: RFC: Build fixes for icedtea-web Message-ID: <20101019195836.GA28452@redhat.com> Hi, This patch fixes a few build issues in icedtea-web. It: Fixes build error when building javaws Fixes clean targets Fixes rpath during javaws and pluginappletviewer compilation ChangeLog: 2010-10-19 Deepak Bhole * Makefile.am: (NETX_DIR):Moved NetX launcher objects to a separate directory where they are now built. (LAUNCHER_LINK): Fixed ORIGIN to the rpath argument when compiling launchers. (clean-plugin): Fixed cleanup. (clean-netx): Same. (netx-dist.stamp): Copy specific source dirs, exclude launcher dir. * launcher/jni_md.h: Imported from OpenJDK. Comments? Deepak -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-web-buildfixes.patch Type: text/x-patch Size: 6033 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101019/efeff2ba/icedtea-web-buildfixes.patch From omajid at redhat.com Tue Oct 19 13:11:19 2010 From: omajid at redhat.com (Omair Majid) Date: Tue, 19 Oct 2010 16:11:19 -0400 Subject: [RFC] icedtea-web: use url escaping consistently in filenames Message-ID: <4CBDFB67.8090402@redhat.com> Hi, The attached patch allows netx to work with jars with file names that need to be URL escaped (such as '[' and ']'). Netx consistently uses decoded URLs everywhere except in JNLPClassLoader.initializeResources(). File.toURI().toURL() encodes the filename as a URL, while File.toURL() does not encode the URL. Any comments or objections? Cheers, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-web-url-escaped-filesnames.patch Type: text/x-patch Size: 746 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101019/b011de05/icedtea-web-url-escaped-filesnames.patch From dbhole at redhat.com Tue Oct 19 13:21:09 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Tue, 19 Oct 2010 16:21:09 -0400 Subject: [RFC] icedtea-web: use url escaping consistently in filenames In-Reply-To: <4CBDFB67.8090402@redhat.com> References: <4CBDFB67.8090402@redhat.com> Message-ID: <20101019202109.GC28452@redhat.com> * Omair Majid [2010-10-19 16:13]: > Hi, > > The attached patch allows netx to work with jars with file names > that need to be URL escaped (such as '[' and ']'). Netx consistently > uses decoded URLs everywhere except in > JNLPClassLoader.initializeResources(). > > File.toURI().toURL() encodes the filename as a URL, while > File.toURL() does not encode the URL. > To clarify.. URL location needs to stay decoded because it is used as a key in a hashmap which is searched by other parts of the code using decoded urls. Change looks okay to me. Okay for commit. Cheers, Deepak > Any comments or objections? > > Cheers, > Omair > diff -r afdd3f284524 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Mon Oct 18 21:29:09 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Tue Oct 19 15:53:30 2010 -0400 > @@ -424,7 +424,7 @@ > > for (JARDesc jarDesc: file.getResources().getJARs()) { > try { > - URL location = tracker.getCacheFile(jarDesc.getLocation()).toURI().toURL(); > + URL location = tracker.getCacheFile(jarDesc.getLocation()).toURL(); > SecurityDesc jarSecurity = file.getSecurity(); > > if (file instanceof PluginBridge) { From andrew at icedtea.classpath.org Tue Oct 19 13:27:56 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 19 Oct 2010 20:27:56 +0000 Subject: /hg/icedtea6: Make HotSpot 19 the default. Update documentation... Message-ID: changeset 5327c5405c78 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=5327c5405c78 author: Andrew John Hughes date: Tue Oct 19 21:27:47 2010 +0100 Make HotSpot 19 the default. Update documentation to reflect recent changes. 2010-10-19 Andrew John Hughes * INSTALL: Drop plugin dependencies. Document new JDK detection. Drop removed options from VisualVM and the plugin. Mention new hs19 default. * README: Updated. Remove sections on plugin and NetX. Update Zero&Shark section. * NEWS: Add HotSpot 19, NetX & plugin removal, Shark upstreaming and JDK detection/bootstrapping changes. * acinclude.m4: (AC_CHECK_WITH_HOTSPOT_BUILD): Set DEFAULT_BUILD to hs19 rather than the non-existent hs16 (used when --with-hotspot-build or --with-hotspot-build=yes is passed). Introduce ALTERNATE_BUILD to refer to the build enabled by --with- hotspot-build, which is 'original' (hs17) at present. diffstat: 5 files changed, 84 insertions(+), 96 deletions(-) ChangeLog | 21 ++++++++++++ INSTALL | 99 +++++++++++++++++++++++++--------------------------------- NEWS | 5 ++ README | 44 ++++--------------------- acinclude.m4 | 11 +++--- diffs (344 lines): diff -r a85679cc93f4 -r 5327c5405c78 ChangeLog --- a/ChangeLog Tue Oct 19 19:55:35 2010 +0100 +++ b/ChangeLog Tue Oct 19 21:27:47 2010 +0100 @@ -1,3 +1,24 @@ 2010-10-19 Andrew John Hughes + + * INSTALL: Drop plugin dependencies. + Document new JDK detection. Drop removed + options from VisualVM and the plugin. + Mention new hs19 default. + * README: Updated. Remove sections on + plugin and NetX. Update Zero&Shark section. + * NEWS: Add HotSpot 19, NetX & plugin removal, + Shark upstreaming and JDK detection/bootstrapping + changes. + * acinclude.m4: + (AC_CHECK_WITH_HOTSPOT_BUILD): Set + DEFAULT_BUILD to hs19 rather than the + non-existent hs16 (used when + --with-hotspot-build or + --with-hotspot-build=yes is passed). + Introduce ALTERNATE_BUILD to refer to + the build enabled by --with-hotspot-build, + which is 'original' (hs17) at present. + 2010-10-19 Andrew John Hughes Move NetX and the plugin to the IcedTea-Web project: diff -r a85679cc93f4 -r 5327c5405c78 INSTALL --- a/INSTALL Tue Oct 19 19:55:35 2010 +0100 +++ b/INSTALL Tue Oct 19 21:27:47 2010 +0100 @@ -8,8 +8,8 @@ The build requirements are as follows: The build requirements are as follows: A bootstrap JDK, either: - - GNU libgcj 4.3.0 (or equivalent class library based on GNU Classpath >= 0.95) for --with-gcj-home mode (the default) - - IcedTea6 for --with-openjdk mode + - GNU libgcj >= 4.3.0 (or equivalent class library based on GNU Classpath >= 0.95) (the default) + - IcedTea6 Eclipse Java Compiler (ecj) CUPS libX11 (libXp, libXtst, libXi, libXt) @@ -23,7 +23,6 @@ alsa alsa xalan xerces -firefox-devel glib2-devel gtk2-devel ant >= 1.6.5 with the regexp task from ant-nodeps @@ -32,7 +31,6 @@ libpng-devel libpng-devel libjpeg-devel >= 6b zlib-devel -xulrunner-devel (can be disabled using --disable-plugin) rhino (can be disabled using --without-rhino) libffi (for --enable-zero or on archs other than x86/x86_64/sparc) pulseaudio-libs-devel >= 0.9.11 (for --enable-pulse-java) @@ -41,36 +39,38 @@ systemtap-sdl-devel >= 0.9.5 (for --enab See ./configure --help if you need to override the defaults. -To bootstrap IcedTea with ecj and a GNU Classpath-based JDK: +To perform a full bootstrap of IcedTea: ./autogen.sh ./configure make -The following locations are checked for a GNU Classpath-based JDK: - * /usr/lib/jvm/java-gcj - * /usr/lib/jvm/gcj-jdk - * /usr/lib/jvm/cacao -in that order. - -To build IcedTea with an older version of IcedTea6, use: -./autogen.sh -./configure --with-openjdk -make - -The following locations are checked for an IcedTea6 JDK: +The following locations are checked for a JDK: + * /usr/lib/jvm/java-gcj + * /usr/lib/jvm/gcj-jdk + * /usr/lib/jvm/cacao * /usr/lib/jvm/java-openjdk * /usr/lib/jvm/icedtea6 * /usr/lib/jvm/java-6-openjdk * /usr/lib/jvm/openjdk * /usr/lib/jvm/java-icedtea -in the order given above. +in that order. + +A quick build can be performed by passing --disable-bootstrap. +This requires a recent version of IcedTea6 as the boot JDK. +The following locations are checked for IcedTea6: + * /usr/lib/jvm/java-openjdk + * /usr/lib/jvm/icedtea6 + * /usr/lib/jvm/java-6-openjdk + * /usr/lib/jvm/openjdk + * /usr/lib/jvm/java-icedtea + Note that IcedTea7 can not be used to build IcedTea6. There is currently no install target. IcedTea ends up in openjdk.build when the build completes. -Most targets in IcedTea creat stamp files in the stamps directory to +Most targets in IcedTea create stamp files in the stamps directory to determine what and when dependencies were compiled. Each target has a corresponding clean-x target which removes the output and the stamp file, allowing it to be rebuilt. For example, stamps/rt.stamp (alias @@ -90,31 +90,33 @@ to configure: * --enable-hg: Checkout the OpenJDK tree from Mercurial, rather than downloading and extracting a tarball. * --with-gcj: Compile ecj to native code with gcj prior to building. -* --with-openjdk: Perform a quick (no bootstrap) build using an installed +* --disable-bootstrap: Perform a quick build using an installed copy of IcedTea6. If a directory is not specified, a check against the list presented above is performed. * --with-parallel-jobs: Run the specified number of parallel jobs when building HotSpot and the JDK. If this option is passed without an argument, the number of online processors plus one is used. -* --with-netbeans-home: The location of NetBeans for use in the VisualVM build, - defaults to /usr/share/netbeans. * --with-ant-home: The location of Ant, defaults to /usr/share/ant. * --with-pkgversion=PKG: Include the specified distro package information in the output of java -version. -* --with-gcj-home: Perform a full bootstrap build using an installed - copy of a GNU Classpath JDK such as gcj. If a directory is not specified, - a check against the list presented above is performed. -* --with-java: Specify the location of a 'java' binary. By default, the path - is checked for gij and java. +* --with-jdk-home: The location of a JDK to build with. If a directory is not + specified, a check against the list presented above is performed. +* --with-java: Specify the location of a 'java' binary. By default, + ${SYSTEM_JDK_DIR}/bin/java is used. If this is absent, then the path is + checked for 'gij' and 'java'. * --with-ecj: Specify the location of a 'ecj' binary. By default, the path is checked for ecj, ecj-3.1, ecj-3.2 and ecj-3.3. -* --with-javac: Specify the location of a 'javac' binary. By default, the path - is checked for javac. -* --with-jar: Specify the location of a 'jar' binary. By default, the path +* --with-javac: Specify the location of a 'javac' binary. By default, + ${SYSTEM_JDK_DIR}/bin/javac is used. If this is absent, then the path + is checked for 'javac'. +* --with-jar: Specify the location of a 'jar' binary. By default, + ${SYSTEM_JDK_DIR}/bin/jar is used. If this is absent, then the path is checked for gjar and jar. -* --with-javah: Specify the location of a 'javah' binary. By default, the path +* --with-javah: Specify the location of a 'javah' binary. By default, + ${SYSTEM_JDK_DIR}/bin/javah is used. If this is absent, then the path is checked for gjavah and javah. -* --with-rmic: Specify the location of a 'rmic' binary. By default, the path +* --with-rmic: Specify the location of a 'rmic' binary. By default, + ${SYSTEM_JDK_DIR}/bin/rmic is used. If this is absent, then the path is checked for grmic and rmic. * --with-ecj-jar: Specify the location of an ecj JAR file. By default, the following paths are checked: @@ -149,7 +151,6 @@ to configure: * --with-cacao-src-dir: Specify the location of a CACAO source tree to avoid downloading. * --with-hg-revision: Specify a hg revision to use (as opposed to tip) with the --enable-hg option. * --with-tzdata-dir: Specify the location of Java timezone data, defaulting to /usr/share/javazi. -* --with-netbeans: Specify the location of NetBeans for VisualVM, defaulting to the netbeans on the path. * --with-abs-install-dir: The final install location of the j2sdk-image, for use in the SystemTap tapset. * --with-llvm-config: Specify the location of the llvm-config binary. @@ -164,9 +165,7 @@ These are documented fully in the releva * --enable-cacao: Replace HotSpot with the CACAO VM. * --enable-shark: Build the Shark LLVM-based JIT. * --enable-zero: Build the zero assembler port on x86/x86_64/sparc platforms. -* --disable-plugin: Don't build the browser plugin. -* --disable-npplugin: Build the old unsupported plugin rather than NPPlugin. -* --with-hotspot-build: The HotSpot to use, defaulting to 'original' i.e. hs14 as bundled with OpenJDK. +* --with-hotspot-build: The HotSpot to use, defaulting to 'hs19'. * --with-rhino: Include Javascript support using Rhino. * --with-additional-vms=vm-list: Additional VMs to build using the system described below. @@ -270,23 +269,6 @@ on any architecture supported by LLVM. --enable-shark to configure. Please note that Shark is still in development and builds are still likely to fail at present. -The Browser Plugin -================== - -IcedTea6 contains a Free Software browser plugin based on NPRuntime -called NPPlugin. By default, this will be built, and it can be turned -off using the -disable-plugin option. - -A test suite is supplied for the browser plugin. It can be built -using 'make plugin-tests' and run by loading the HTML page specified -into a browser with the plugin installed. - -For debugging, the environment variable ICEDTEAPLUGIN_DEBUG should be -set to 'true'. This will produce output on the console from the C++ -side, and output from the Java side in $HOME/.icedteaplugin/java.stdout -and $HOME/.icedteaplugin/java.stderr. It also starts the debug server -on port 8787. - Support for Different Versions of HotSpot ========================================= @@ -319,8 +301,15 @@ download stage and just verifies that th download stage and just verifies that the zip's MD5 sum matches that of the requested build. -At present, IcedTea6 only supports the 'original' HotSpot (hs17) -provided as part of the upstream tarball. +At present, IcedTea6 supports the 'original' HotSpot 17 provided as +part of the upstream tarball and HotSpot 19 ('hs19') from the stable +hs19 tree at http://hg.openjdk.java.net/hsx/hsx19/master. The default +is 'hs19'; passing --with-hotspot-build=original to configure will +revert to the version of hs17 provided in b20. Note that the norm. is +for up to one alternate (non-default) build to be supported and just +passing --with-hotspot-build (equivalent to --with-hotspot-build=yes) +will provide the opposite to the default HotSpot (currently hs17, 'original'). +Conversely, passing --with-hotspot-build=no retains the default. Javascript Support ================== diff -r a85679cc93f4 -r 5327c5405c78 NEWS --- a/NEWS Tue Oct 19 19:55:35 2010 +0100 +++ b/NEWS Tue Oct 19 21:27:47 2010 +0100 @@ -10,6 +10,11 @@ CVE-XXXX-YYYY: http://www.cve.mitre.org/ New in release 1.10 (2010-XX-XX): +* Upgrade to HotSpot 19 as default. +* NetX and the plugin moved to the IcedTea-Web project with a separate + release cycle. +* Shark provided upstream rather than as part of IcedTea. +* The option --with-openjdk becomes --with-jdk-home and --disable-bootstrap * Security updates - S6914943, CVE-2009-3555: TLS: MITM attacks via session renegotiation - S6559775, CVE-2010-3568: OpenJDK Deserialization Race condition diff -r a85679cc93f4 -r 5327c5405c78 README --- a/README Tue Oct 19 19:55:35 2010 +0100 +++ b/README Tue Oct 19 21:27:47 2010 +0100 @@ -5,13 +5,8 @@ openjdk.java.net using Free Software too openjdk.java.net using Free Software tools and dependencies. IcedTea addresses two problems: it eliminates the build requirement on -proprietary build tools and it provides implementations of Java Web -Start and the browser plugin which are missing from OpenJDK. It also -provides support for additional architectures via Zero/Shark or the -CACAO VM. - -IcedTea also provides build scripts and patches that fix a number of issues -which are as yet unresolved upstream. +proprietary build tools and provides additional patches and features +(such as Javascript support via Rhino) not available in OpenJDK. See INSTALL for build instructions. @@ -38,9 +33,7 @@ the Java SE 6 platform and implements th the Java SE 6 platform and implements the Java SE 6 Platform Specification. Binaries produced by IcedTea6 have been known to pass the TCK for Java 6. IcedTea6 additionally provides autotools support, -plugin and Web Start support, ARM support, and a LLVM-based JIT -(Shark) for architectures beyond x86, x86_64 and SPARC, the -architectures supported by HotSpot JITs in OpenJDK6. +and ARM support. A Note About License Headers ---------------------------- @@ -50,28 +43,6 @@ license header. Instances are: - We are assuming that these files are owned by Sun: openjdk/jdk/src/share/classes/**/resources/*.properties - -Web Browser Plugin support -=========================== - -IcedTea6 adds a browser plugin to OpenJDK. The current version is a -rewrite, developed to support recent Mozilla API changes. It can be -enabled with the option --enable-plugin, and is based on gcjwebplugin. - -NetX -==== - -NetX provides a drop-in replacement for javaws (Java Web Start). Since -upstream NetX is dormant, we will be hosting and modifying the sources -in the IcedTea repository, particularly in the netx/net/sourceforge/jnlp -directory. - -The NetX sources are built into rt.jar using the same method as -CORBA, JAXWS, JAXP and langtools. - -IcedTea's NetX currently supports verification of signed jars, trusted -certificate storing, system certificate store checking, and provides -the services specified by the jnlp API. The Zero Assembler and Shark Ports ================================== @@ -85,10 +56,11 @@ x86_64 and sparc. To enable it on these x86_64 and sparc. To enable it on these platforms, use the --enable-zero option. -Gary is now working on a JIT called Shark to provide better -performance on platforms which need to use the zero port. A -preliminary version of this is now included with IcedTea and can be -built with the --enable-shark option. +Following the development of Zero, Gary created a JIT called Shark to +provide better performance on platforms which need to use the Zero port. +This makes use of LLVM. + +Both Zero and Shark are now part of upstream OpenJDK. CACAO as VM =========== diff -r a85679cc93f4 -r 5327c5405c78 acinclude.m4 --- a/acinclude.m4 Tue Oct 19 19:55:35 2010 +0100 +++ b/acinclude.m4 Tue Oct 19 21:27:47 2010 +0100 @@ -917,7 +917,8 @@ AC_DEFUN([AC_CHECK_WITH_GCJ], AC_DEFUN([AC_CHECK_WITH_HOTSPOT_BUILD], [ - DEFAULT_BUILD="hs16" + DEFAULT_BUILD="hs19" + ALTERNATE_BUILD="original" AC_MSG_CHECKING([which HotSpot build to use]) AC_ARG_WITH([hotspot-build], [AS_HELP_STRING(--with-hotspot-build,the HotSpot build to use (see hotspot.map))], @@ -925,16 +926,16 @@ AC_DEFUN([AC_CHECK_WITH_HOTSPOT_BUILD], HSBUILD="${withval}" ], [ - HSBUILD="original" + HSBUILD="${DEFAULT_BUILD}" ]) if test "x${HSBUILD}" = xyes; then + HSBUILD="${ALTERNATE_BUILD}" + elif test "x${HSBUILD}" = xno; then HSBUILD="${DEFAULT_BUILD}" - elif test "x${HSBUILD}" = xno; then - HSBUILD="original" fi AC_MSG_RESULT([${HSBUILD}]) AC_SUBST([HSBUILD]) - AM_CONDITIONAL(WITH_ALT_HSBUILD, test "x${HSBUILD}" != "xoriginal") + AM_CONDITIONAL(WITH_ALT_HSBUILD, test "x${HSBUILD}" != "x${DEFAULT_BUILD}") ]) AC_DEFUN([WITH_HOTSPOT_SRC_ZIP], From ahughes at redhat.com Tue Oct 19 13:36:43 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Tue, 19 Oct 2010 21:36:43 +0100 Subject: RFC: Build fixes for icedtea-web In-Reply-To: <20101019195836.GA28452@redhat.com> References: <20101019195836.GA28452@redhat.com> Message-ID: <20101019203643.GG3392@rivendell.middle-earth.co.uk> On 15:58 Tue 19 Oct , Deepak Bhole wrote: > Hi, > > This patch fixes a few build issues in icedtea-web. It: > > Fixes build error when building javaws > Fixes clean targets > Fixes rpath during javaws and pluginappletviewer compilation > > ChangeLog: > 2010-10-19 Deepak Bhole > > * Makefile.am: > (NETX_DIR):Moved NetX launcher objects to a separate directory where > they are now built. > (LAUNCHER_LINK): Fixed ORIGIN to the rpath argument when compiling > launchers. > (clean-plugin): Fixed cleanup. > (clean-netx): Same. > (netx-dist.stamp): Copy specific source dirs, exclude launcher dir. > * launcher/jni_md.h: Imported from OpenJDK. > > Comments? > > Deepak * javac shouldn't be added to .hgignore, it's produced by configure. Only files that would appear in a tarball are listed (the results of ./autogen.sh) * NETX_DIR is confused. It's referring to the source tree, but you're building the launcher objects there. What was wrong with using $(abs_top_builddir)/launcher? I guess a srcdir==builddir conflict, so use the launcher.build naming as used with netx and liveconnect. * clean-plugin and $ORIGIN changes are good * NETX_SRCS only seems to be needed if you mix source and build objects as noted above. If you set NETX_DIR to $(abs_top_builddir)/launcher.build, it should be unnecessary to specify the sources. * jni_md.h addition is fine; conflicts with gcj's version on Fedora from your error earlier on IRC. > diff -r fc0b251243fb -r a7987617d5eb .hgignore > --- a/.hgignore Tue Oct 19 18:19:19 2010 +0100 > +++ b/.hgignore Tue Oct 19 15:53:43 2010 -0700 > @@ -6,3 +6,4 @@ > missing > config.guess > config.sub > +javac > diff -r fc0b251243fb -r a7987617d5eb Makefile.am > --- a/Makefile.am Tue Oct 19 18:19:19 2010 +0100 > +++ b/Makefile.am Tue Oct 19 15:53:43 2010 -0700 > @@ -1,6 +1,8 @@ > # Source directories > > +NETX_DIR = $(abs_top_srcdir)/netx > NETX_SRCDIR = $(abs_top_srcdir)/netx > +NETX_SRCS = $(NETX_DIR)/javaws.1 $(NETX_DIR)/javax $(NETX_DIR)/net > NETX_RESOURCE_DIR=$(NETX_SRCDIR)/net/sourceforge/jnlp/resources > NETX_EXTRA_DIR=$(abs_top_srcdir)/extra/net/sourceforge/jnlp/about/resources > > @@ -93,14 +95,14 @@ > LAUNCHER_SRCDIR = $(abs_top_srcdir)/launcher > LAUNCHER_OBJECTS = java.o java_md.o splashscreen_stubs.o > PLUGIN_LAUNCHER_OBJECTS = $(addprefix $(PLUGIN_DIR)/launcher/,$(LAUNCHER_OBJECTS)) > -NETX_LAUNCHER_OBJECTS = $(addprefix $(abs_top_builddir)/launcher/,$(LAUNCHER_OBJECTS)) > +NETX_LAUNCHER_OBJECTS = $(addprefix $(NETX_DIR)/launcher/,$(LAUNCHER_OBJECTS)) > LAUNCHER_FLAGS = -O2 -fno-strict-aliasing -fPIC -W -Wall -Wno-unused -Wno-parentheses -pipe -fno-omit-frame-pointer \ > -g -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT -DLAUNCHER_NAME='"java"' -I$(LAUNCHER_SRCDIR) \ > -DJDK_MAJOR_VERSION='"1"' -DJDK_MINOR_VERSION='"6"' -DLIBARCHNAME='"$(JRE_ARCH_DIR)"' > LAUNCHER_LINK = -o $@ -Xlinker -O1 -Xlinker -z -Xlinker defs -L$(BOOT_DIR)/lib/$(INSTALL_ARCH_DIR) \ > -Wl,-soname=lib.so -L $(BOOT_DIR)/jre/lib/$(INSTALL_ARCH_DIR)/jli -Wl,-z -Wl,origin \ > - -Wl,--allow-shlib-undefined -Wl,-rpath -Wl,$$ORIGIN/../lib/$(INSTALL_ARCH_DIR)/jli -Wl,-rpath \ > - -Wl,$$ORIGIN/../jre/lib/$(INSTALL_ARCH_DIR)/jli -lpthread $(X11_CFLAGS) $(X11_LIBS) -ljli -ldl -lc -lz > + -Wl,--allow-shlib-undefined -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(INSTALL_ARCH_DIR)/jli -Wl,-rpath \ > + -Wl,\$$ORIGIN/../jre/lib/$(INSTALL_ARCH_DIR)/jli -lpthread $(X11_CFLAGS) $(X11_LIBS) -ljli -ldl -lc -lz > PLUGIN_VERSION = IcedTea $(PACKAGE_VERSION)$(ICEDTEA_REV)$(ICEDTEA_PKG) > > EXTRA_DIST = $(NETX_SRCDIR) $(abs_top_srcdir)/plugin javaws.png javaws.desktop extra launcher > @@ -108,7 +110,7 @@ > # Top-Level Targets > # ================= > > -all-local: stamps/netx-dist.stamp extra-lib/about.jar stamps/plugin.stamp launcher/javaws > +all-local: stamps/netx-dist.stamp extra-lib/about.jar stamps/plugin.stamp $(NETX_DIR)/launcher/javaws > > clean-local: clean-netx clean-plugin clean-liveconnect clean-extra clean-bootstrap-directory clean-native-ecj > > @@ -124,7 +126,7 @@ > cp -pPRf $(abs_top_builddir)/liveconnect/lib/classes.jar $(DESTDIR)$(prefix)/jre/lib/plugin.jar > endif > cp -pPRf $(abs_top_builddir)/netx.build/lib/classes.jar $(DESTDIR)$(prefix)/jre/lib/netx.jar > - cp -pPRf launcher/javaws $(DESTDIR)$(bindir) > + cp -pPRf $(NETX_DIR)/launcher/javaws $(DESTDIR)$(bindir) > cp extra-lib/about.jar $(DESTDIR)$(prefix)/jre/lib > > install-data-local: > @@ -202,6 +204,7 @@ > touch stamps/plugin.stamp > > clean-plugin: $(ICEDTEAPLUGIN_CLEAN) > + rm -rf $(PLUGIN_DIR)/launcher > rm -f stamps/plugin.stamp > > liveconnect-source-files.txt: > @@ -262,8 +265,9 @@ > stamps/netx-dist.stamp: stamps/netx.stamp > (cd $(abs_top_builddir)/netx.build ; \ > mkdir -p lib ; \ > + mkdir -p src ; \ > $(BOOT_DIR)/bin/jar cf lib/classes.jar javax/jnlp net ; \ > - cp -pPR $(SRC_DIR_LINK) $(NETX_SRCDIR) src; \ > + cp -pPR $(SRC_DIR_LINK) $(NETX_SRCS) src; \ > find src -type f -exec chmod 640 '{}' ';' -o -type d -exec chmod 750 '{}' ';'; \ > cd src ; \ > $(BOOT_DIR)/bin/jar uf $(abs_top_builddir)/netx.build/lib/classes.jar \ > @@ -274,6 +278,7 @@ > > clean-netx: > rm -rf $(abs_top_builddir)/netx.build > + rm -rf $(NETX_DIR)/launcher > rm -f stamps/netx-dist.stamp > rm -f netx-source-files.txt > rm -f stamps/netx.stamp > @@ -299,12 +304,12 @@ > extra-lib/about.jar: stamps/extra-class-files.stamp > $(BOOT_DIR)/bin/jar cf $@ -C extra-lib net ; > > -launcher/%.o: $(LAUNCHER_SRCDIR)/%.c > - mkdir -p launcher && \ > +$(NETX_DIR)/launcher/%.o: $(LAUNCHER_SRCDIR)/%.c > + mkdir -p $(NETX_DIR)/launcher && \ > $(CC) $(LAUNCHER_FLAGS) -DJAVA_ARGS='{ "-J-ms8m", "net.sourceforge.jnlp.runtime.Boot", }' -DPROGNAME='"javaws"' \ > -c -o $@ $< > > -launcher/javaws: $(NETX_LAUNCHER_OBJECTS) > +$(NETX_DIR)/launcher/javaws: $(NETX_LAUNCHER_OBJECTS) > $(CC) $(LAUNCHER_LINK) $(NETX_LAUNCHER_OBJECTS) > > # plugin tests > diff -r fc0b251243fb -r a7987617d5eb launcher/jni_md.h > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/launcher/jni_md.h Tue Oct 19 15:53:43 2010 -0700 > @@ -0,0 +1,42 @@ > +/* > + * Copyright (c) 1996, 2000, Oracle and/or its affiliates. All rights reserved. > + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > + * > + * This code is free software; you can redistribute it and/or modify it > + * under the terms of the GNU General Public License version 2 only, as > + * published by the Free Software Foundation. Oracle designates this > + * particular file as subject to the "Classpath" exception as provided > + * by Oracle in the LICENSE file that accompanied this code. > + * > + * This code is distributed in the hope that it will be useful, but WITHOUT > + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License > + * version 2 for more details (a copy is included in the LICENSE file that > + * accompanied this code). > + * > + * You should have received a copy of the GNU General Public License version > + * 2 along with this work; if not, write to the Free Software Foundation, > + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. > + * > + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA > + * or visit www.oracle.com if you need additional information or have any > + * questions. > + */ > + > +#ifndef _JAVASOFT_JNI_MD_H_ > +#define _JAVASOFT_JNI_MD_H_ > + > +#define JNIEXPORT > +#define JNIIMPORT > +#define JNICALL > + > +typedef int jint; > +#ifdef _LP64 /* 64-bit Solaris */ > +typedef long jlong; > +#else > +typedef long long jlong; > +#endif > + > +typedef signed char jbyte; > + > +#endif /* !_JAVASOFT_JNI_MD_H_ */ -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From dbhole at redhat.com Tue Oct 19 13:44:54 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Tue, 19 Oct 2010 16:44:54 -0400 Subject: RFC: Build fixes for icedtea-web In-Reply-To: <20101019203643.GG3392@rivendell.middle-earth.co.uk> References: <20101019195836.GA28452@redhat.com> <20101019203643.GG3392@rivendell.middle-earth.co.uk> Message-ID: <20101019204453.GD28452@redhat.com> * Dr Andrew John Hughes [2010-10-19 16:36]: > On 15:58 Tue 19 Oct , Deepak Bhole wrote: > > Hi, > > > > This patch fixes a few build issues in icedtea-web. It: > > > > Fixes build error when building javaws > > Fixes clean targets > > Fixes rpath during javaws and pluginappletviewer compilation > > > > ChangeLog: > > 2010-10-19 Deepak Bhole > > > > * Makefile.am: > > (NETX_DIR):Moved NetX launcher objects to a separate directory where > > they are now built. > > (LAUNCHER_LINK): Fixed ORIGIN to the rpath argument when compiling > > launchers. > > (clean-plugin): Fixed cleanup. > > (clean-netx): Same. > > (netx-dist.stamp): Copy specific source dirs, exclude launcher dir. > > * launcher/jni_md.h: Imported from OpenJDK. > > > > Comments? > > > > Deepak > > * javac shouldn't be added to .hgignore, it's produced by configure. Only > files that would appear in a tarball are listed (the results of ./autogen.sh) Ah, sorry. I will remove that then. > * NETX_DIR is confused. It's referring to the source tree, but you're building > the launcher objects there. What was wrong with using $(abs_top_builddir)/launcher? launcher objects differ for pluginappletviewer and javaws, based on the macro definitions provided at build time. Thus they need to be built once for each, and so we can't use $(abs_top_builddir)/launcher As for NETX_DIR.. sorry about that, my bad. I didn't notice the abs_top_builddir for PLUGIN_DIR vs abs_top_srcdir for NETX_DIR > I guess a srcdir==builddir conflict, so use the launcher.build naming as used with > netx and liveconnect. Right > * clean-plugin and $ORIGIN changes are good > * NETX_SRCS only seems to be needed if you mix source and build objects as noted above. > If you set NETX_DIR to $(abs_top_builddir)/launcher.build, it should be unnecessary > to specify the sources. Agreed. I will respin the changes and repost. Thanks! Deepak > * jni_md.h addition is fine; conflicts with gcj's version on Fedora from your error > earlier on IRC. > > > diff -r fc0b251243fb -r a7987617d5eb .hgignore > > --- a/.hgignore Tue Oct 19 18:19:19 2010 +0100 > > +++ b/.hgignore Tue Oct 19 15:53:43 2010 -0700 > > @@ -6,3 +6,4 @@ > > missing > > config.guess > > config.sub > > +javac > > diff -r fc0b251243fb -r a7987617d5eb Makefile.am > > --- a/Makefile.am Tue Oct 19 18:19:19 2010 +0100 > > +++ b/Makefile.am Tue Oct 19 15:53:43 2010 -0700 > > @@ -1,6 +1,8 @@ > > # Source directories > > > > +NETX_DIR = $(abs_top_srcdir)/netx > > NETX_SRCDIR = $(abs_top_srcdir)/netx > > +NETX_SRCS = $(NETX_DIR)/javaws.1 $(NETX_DIR)/javax $(NETX_DIR)/net > > NETX_RESOURCE_DIR=$(NETX_SRCDIR)/net/sourceforge/jnlp/resources > > NETX_EXTRA_DIR=$(abs_top_srcdir)/extra/net/sourceforge/jnlp/about/resources > > > > @@ -93,14 +95,14 @@ > > LAUNCHER_SRCDIR = $(abs_top_srcdir)/launcher > > LAUNCHER_OBJECTS = java.o java_md.o splashscreen_stubs.o > > PLUGIN_LAUNCHER_OBJECTS = $(addprefix $(PLUGIN_DIR)/launcher/,$(LAUNCHER_OBJECTS)) > > -NETX_LAUNCHER_OBJECTS = $(addprefix $(abs_top_builddir)/launcher/,$(LAUNCHER_OBJECTS)) > > +NETX_LAUNCHER_OBJECTS = $(addprefix $(NETX_DIR)/launcher/,$(LAUNCHER_OBJECTS)) > > LAUNCHER_FLAGS = -O2 -fno-strict-aliasing -fPIC -W -Wall -Wno-unused -Wno-parentheses -pipe -fno-omit-frame-pointer \ > > -g -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT -DLAUNCHER_NAME='"java"' -I$(LAUNCHER_SRCDIR) \ > > -DJDK_MAJOR_VERSION='"1"' -DJDK_MINOR_VERSION='"6"' -DLIBARCHNAME='"$(JRE_ARCH_DIR)"' > > LAUNCHER_LINK = -o $@ -Xlinker -O1 -Xlinker -z -Xlinker defs -L$(BOOT_DIR)/lib/$(INSTALL_ARCH_DIR) \ > > -Wl,-soname=lib.so -L $(BOOT_DIR)/jre/lib/$(INSTALL_ARCH_DIR)/jli -Wl,-z -Wl,origin \ > > - -Wl,--allow-shlib-undefined -Wl,-rpath -Wl,$$ORIGIN/../lib/$(INSTALL_ARCH_DIR)/jli -Wl,-rpath \ > > - -Wl,$$ORIGIN/../jre/lib/$(INSTALL_ARCH_DIR)/jli -lpthread $(X11_CFLAGS) $(X11_LIBS) -ljli -ldl -lc -lz > > + -Wl,--allow-shlib-undefined -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(INSTALL_ARCH_DIR)/jli -Wl,-rpath \ > > + -Wl,\$$ORIGIN/../jre/lib/$(INSTALL_ARCH_DIR)/jli -lpthread $(X11_CFLAGS) $(X11_LIBS) -ljli -ldl -lc -lz > > PLUGIN_VERSION = IcedTea $(PACKAGE_VERSION)$(ICEDTEA_REV)$(ICEDTEA_PKG) > > > > EXTRA_DIST = $(NETX_SRCDIR) $(abs_top_srcdir)/plugin javaws.png javaws.desktop extra launcher > > @@ -108,7 +110,7 @@ > > # Top-Level Targets > > # ================= > > > > -all-local: stamps/netx-dist.stamp extra-lib/about.jar stamps/plugin.stamp launcher/javaws > > +all-local: stamps/netx-dist.stamp extra-lib/about.jar stamps/plugin.stamp $(NETX_DIR)/launcher/javaws > > > > clean-local: clean-netx clean-plugin clean-liveconnect clean-extra clean-bootstrap-directory clean-native-ecj > > > > @@ -124,7 +126,7 @@ > > cp -pPRf $(abs_top_builddir)/liveconnect/lib/classes.jar $(DESTDIR)$(prefix)/jre/lib/plugin.jar > > endif > > cp -pPRf $(abs_top_builddir)/netx.build/lib/classes.jar $(DESTDIR)$(prefix)/jre/lib/netx.jar > > - cp -pPRf launcher/javaws $(DESTDIR)$(bindir) > > + cp -pPRf $(NETX_DIR)/launcher/javaws $(DESTDIR)$(bindir) > > cp extra-lib/about.jar $(DESTDIR)$(prefix)/jre/lib > > > > install-data-local: > > @@ -202,6 +204,7 @@ > > touch stamps/plugin.stamp > > > > clean-plugin: $(ICEDTEAPLUGIN_CLEAN) > > + rm -rf $(PLUGIN_DIR)/launcher > > rm -f stamps/plugin.stamp > > > > liveconnect-source-files.txt: > > @@ -262,8 +265,9 @@ > > stamps/netx-dist.stamp: stamps/netx.stamp > > (cd $(abs_top_builddir)/netx.build ; \ > > mkdir -p lib ; \ > > + mkdir -p src ; \ > > $(BOOT_DIR)/bin/jar cf lib/classes.jar javax/jnlp net ; \ > > - cp -pPR $(SRC_DIR_LINK) $(NETX_SRCDIR) src; \ > > + cp -pPR $(SRC_DIR_LINK) $(NETX_SRCS) src; \ > > find src -type f -exec chmod 640 '{}' ';' -o -type d -exec chmod 750 '{}' ';'; \ > > cd src ; \ > > $(BOOT_DIR)/bin/jar uf $(abs_top_builddir)/netx.build/lib/classes.jar \ > > @@ -274,6 +278,7 @@ > > > > clean-netx: > > rm -rf $(abs_top_builddir)/netx.build > > + rm -rf $(NETX_DIR)/launcher > > rm -f stamps/netx-dist.stamp > > rm -f netx-source-files.txt > > rm -f stamps/netx.stamp > > @@ -299,12 +304,12 @@ > > extra-lib/about.jar: stamps/extra-class-files.stamp > > $(BOOT_DIR)/bin/jar cf $@ -C extra-lib net ; > > > > -launcher/%.o: $(LAUNCHER_SRCDIR)/%.c > > - mkdir -p launcher && \ > > +$(NETX_DIR)/launcher/%.o: $(LAUNCHER_SRCDIR)/%.c > > + mkdir -p $(NETX_DIR)/launcher && \ > > $(CC) $(LAUNCHER_FLAGS) -DJAVA_ARGS='{ "-J-ms8m", "net.sourceforge.jnlp.runtime.Boot", }' -DPROGNAME='"javaws"' \ > > -c -o $@ $< > > > > -launcher/javaws: $(NETX_LAUNCHER_OBJECTS) > > +$(NETX_DIR)/launcher/javaws: $(NETX_LAUNCHER_OBJECTS) > > $(CC) $(LAUNCHER_LINK) $(NETX_LAUNCHER_OBJECTS) > > > > # plugin tests > > diff -r fc0b251243fb -r a7987617d5eb launcher/jni_md.h > > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > > +++ b/launcher/jni_md.h Tue Oct 19 15:53:43 2010 -0700 > > @@ -0,0 +1,42 @@ > > +/* > > + * Copyright (c) 1996, 2000, Oracle and/or its affiliates. All rights reserved. > > + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > > + * > > + * This code is free software; you can redistribute it and/or modify it > > + * under the terms of the GNU General Public License version 2 only, as > > + * published by the Free Software Foundation. Oracle designates this > > + * particular file as subject to the "Classpath" exception as provided > > + * by Oracle in the LICENSE file that accompanied this code. > > + * > > + * This code is distributed in the hope that it will be useful, but WITHOUT > > + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > > + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License > > + * version 2 for more details (a copy is included in the LICENSE file that > > + * accompanied this code). > > + * > > + * You should have received a copy of the GNU General Public License version > > + * 2 along with this work; if not, write to the Free Software Foundation, > > + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. > > + * > > + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA > > + * or visit www.oracle.com if you need additional information or have any > > + * questions. > > + */ > > + > > +#ifndef _JAVASOFT_JNI_MD_H_ > > +#define _JAVASOFT_JNI_MD_H_ > > + > > +#define JNIEXPORT > > +#define JNIIMPORT > > +#define JNICALL > > + > > +typedef int jint; > > +#ifdef _LP64 /* 64-bit Solaris */ > > +typedef long jlong; > > +#else > > +typedef long long jlong; > > +#endif > > + > > +typedef signed char jbyte; > > + > > +#endif /* !_JAVASOFT_JNI_MD_H_ */ > > > -- > Andrew :) > > Free Java Software Engineer > Red Hat, Inc. (http://www.redhat.com) > > Support Free Java! > Contribute to GNU Classpath and the OpenJDK > http://www.gnu.org/software/classpath > http://openjdk.java.net > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From dbhole at redhat.com Tue Oct 19 14:02:55 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Tue, 19 Oct 2010 17:02:55 -0400 Subject: RFC: Build fixes for icedtea-web In-Reply-To: <20101019204453.GD28452@redhat.com> References: <20101019195836.GA28452@redhat.com> <20101019203643.GG3392@rivendell.middle-earth.co.uk> <20101019204453.GD28452@redhat.com> Message-ID: <20101019210254.GE28452@redhat.com> * Deepak Bhole [2010-10-19 16:45]: > * Dr Andrew John Hughes [2010-10-19 16:36]: > > On 15:58 Tue 19 Oct , Deepak Bhole wrote: > > > Hi, > > > I will respin the changes and repost. > New patch attached. ChangeLog: * Makefile.am: (NETX_DIR): New variable representing the NetX build dir.. (LAUNCHER_LINK): Fixed ORIGIN to the rpath argument when compiling launchers. (clean-plugin): Fixed cleanup. (clean-netx): Same. * launcher/jni_md.h: Imported from OpenJDK. Cheers, Deepak -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-web-buildfixes.patch Type: text/x-patch Size: 6993 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101019/d3a979f4/icedtea-web-buildfixes.patch From dbhole at redhat.com Tue Oct 19 15:38:36 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Tue, 19 Oct 2010 18:38:36 -0400 Subject: [RFC] netx: show security dialogs in a separate AppContext In-Reply-To: <4CBDC2BF.5010605@redhat.com> References: <4CBDC2BF.5010605@redhat.com> Message-ID: <20101019223835.GF28452@redhat.com> * Omair Majid [2010-10-19 12:10]: > Hi, > > The attached patch makes security prompts appear in a separate > AppContext. This ensures that the applet's look and feel is not > automatically set to the system look and feel. > > The patch is a superset of http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-October/010500.html > > This patch also implements a large part of the code necessary to > allow applets to access their EventQueues. However, I still have to > figure out how to use > http://hg.openjdk.java.net/jdk7/awt/jdk/rev/8022709a306d to ensure > allowing access to the EventQueue is safe. So for now, that code is > disabled. > > The patch ensures that the JNLPRuntime is always initialized in the > main AppContext. It starts a thread in this AppContext to listen for > security dialog messages, and shows security dialogs when it > receives an appropriate security message. The security dialogs block > the client applet/application until the user responds. > > Any thoughts or comments? > Hi, Please see comments below. Cheers, Deepak > Thanks, > Omair > diff -r afdd3f284524 netx/net/sourceforge/jnlp/NetxPanel.java > --- a/netx/net/sourceforge/jnlp/NetxPanel.java Mon Oct 18 21:29:09 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/NetxPanel.java Tue Oct 19 12:07:40 2010 -0400 > @@ -83,19 +83,6 @@ > getHeight(), > atts); > > - synchronized(JNLPRuntime.initMutex) { > - //The custom NetX Policy and SecurityManager are set here. > - if (!JNLPRuntime.isInitialized()) { > - if (JNLPRuntime.isDebug()) > - System.out.println("initializing JNLPRuntime..."); > - > - JNLPRuntime.initialize(false); > - } else { > - if (JNLPRuntime.isDebug()) > - System.out.println("JNLPRuntime already initialized"); > - } > - } > - > doInit = true; > dispatchAppletEvent(APPLET_LOADING, null); > status = APPLET_LOAD; > @@ -145,6 +132,19 @@ > */ > // Reminder: Relax visibility in sun.applet.AppletPanel > protected synchronized void createAppletThread() { > + synchronized(JNLPRuntime.initMutex) { > + //The custom NetX Policy and SecurityManager are set here. > + if (!JNLPRuntime.isInitialized()) { > + if (JNLPRuntime.isDebug()) > + System.out.println("initializing JNLPRuntime..."); > + > + JNLPRuntime.initialize(false); > + } else { > + if (JNLPRuntime.isDebug()) > + System.out.println("JNLPRuntime already initialized"); > + } > + } > + > // when this was being done (incorrectly) in Launcher, the call was > // new AppThreadGroup(mainGroup, file.getTitle()); > ThreadGroup tg = new AppThreadGroup(Launcher.mainGroup, > diff -r afdd3f284524 netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java > --- a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Mon Oct 18 21:29:09 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Tue Oct 19 12:07:40 2010 -0400 > @@ -35,7 +35,7 @@ > import net.sourceforge.jnlp.ShortcutDesc; > import net.sourceforge.jnlp.event.ApplicationEvent; > import net.sourceforge.jnlp.event.ApplicationListener; > -import net.sourceforge.jnlp.security.SecurityWarningDialog.AccessType; > +import net.sourceforge.jnlp.security.AccessType; > import net.sourceforge.jnlp.services.ServiceUtil; > import net.sourceforge.jnlp.util.WeakList; > import net.sourceforge.jnlp.util.XDesktopEntry; > diff -r afdd3f284524 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Mon Oct 18 21:29:09 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Tue Oct 19 12:07:40 2010 -0400 > @@ -57,7 +57,8 @@ > import net.sourceforge.jnlp.cache.CacheUtil; > import net.sourceforge.jnlp.cache.ResourceTracker; > import net.sourceforge.jnlp.cache.UpdatePolicy; > -import net.sourceforge.jnlp.security.SecurityWarningDialog; > +import net.sourceforge.jnlp.security.SecurityWarning; > +import net.sourceforge.jnlp.security.AccessType; > import net.sourceforge.jnlp.tools.JarSigner; > import sun.misc.JarIndex; > > @@ -254,7 +255,7 @@ > > if (extLoader != null && extLoader != loader) { > if (loader.signing && !extLoader.signing) > - if (!SecurityWarningDialog.showNotAllSignedWarningDialog(file)) > + if (!SecurityWarning.showNotAllSignedWarningDialog(file)) > throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LSignedAppJarUsingUnsignedJar"), R("LSignedAppJarUsingUnsignedJarInfo")); > > loader.merge(extLoader); > @@ -401,7 +402,7 @@ > signing = true; > > if (!js.allJarsSigned() && > - !SecurityWarningDialog.showNotAllSignedWarningDialog(file)) > + !SecurityWarning.showNotAllSignedWarningDialog(file)) > throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LSignedAppJarUsingUnsignedJar"), R("LSignedAppJarUsingUnsignedJarInfo")); > > > @@ -455,19 +456,19 @@ > > private void checkTrustWithUser(JarSigner js) throws LaunchException { > if (!js.getRootInCacerts()) { //root cert is not in cacerts > - boolean b = SecurityWarningDialog.showCertWarningDialog( > - SecurityWarningDialog.AccessType.UNVERIFIED, file, js); > + boolean b = SecurityWarning.showCertWarningDialog( > + AccessType.UNVERIFIED, file, js); > if (!b) > throw new LaunchException(null, null, R("LSFatal"), > R("LCLaunching"), R("LNotVerified"), ""); > } else if (js.getRootInCacerts()) { //root cert is in cacerts > boolean b = false; > if (js.noSigningIssues()) > - b = SecurityWarningDialog.showCertWarningDialog( > - SecurityWarningDialog.AccessType.VERIFIED, file, js); > + b = SecurityWarning.showCertWarningDialog( > + AccessType.VERIFIED, file, js); > else if (!js.noSigningIssues()) > - b = SecurityWarningDialog.showCertWarningDialog( > - SecurityWarningDialog.AccessType.SIGNING_ERROR, file, js); > + b = SecurityWarning.showCertWarningDialog( > + AccessType.SIGNING_ERROR, file, js); > if (!b) > throw new LaunchException(null, null, R("LSFatal"), > R("LCLaunching"), R("LCancelOnUserRequest"), ""); > diff -r afdd3f284524 netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Mon Oct 18 21:29:09 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Tue Oct 19 12:07:40 2010 -0400 > @@ -25,9 +25,11 @@ > import java.util.List; > import java.security.*; > import javax.jnlp.*; > +import javax.swing.UIManager; > > import net.sourceforge.jnlp.*; > import net.sourceforge.jnlp.cache.*; > +import net.sourceforge.jnlp.security.SecurityDialogMessageHandler; > import net.sourceforge.jnlp.services.*; > import net.sourceforge.jnlp.util.*; > > @@ -63,6 +65,9 @@ > /** the security policy */ > private static JNLPPolicy policy; > > + /** handles all security message to show appropriate security dialogs */ > + private static SecurityDialogMessageHandler securityDialogMessageHandler; > + > /** the base dir for cache, etc */ > private static File baseDir; > > @@ -165,6 +170,8 @@ > * security manager and security policy, initializing the JNLP > * standard services, etc.

> * > + * This method should be called from the main AppContext/Thread.

> + * > * This method cannot be called more than once. Once > * initialized, methods that alter the runtime can only be > * called by the exit class.

> @@ -206,15 +213,39 @@ > policy = new JNLPPolicy(); > security = new JNLPSecurityManager(); // side effect: create JWindow > > + try { > + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); > + } catch (Exception e) { > + // ignore it > + } > + > if (securityEnabled) { > Policy.setPolicy(policy); // do first b/c our SM blocks setPolicy > System.setSecurityManager(security); > } > > + securityDialogMessageHandler = startSecurityThreads(); > + > initialized = true; > } > > /** > + * This must NOT be called form the application ThreadGroup. An application > + * can inject events into its {@link EventQueue} and bypass the security > + * dialogs. > + * > + * @return a {@link SecurityDialogMessageHandler} that can be used to post > + * security messages > + */ > + private static SecurityDialogMessageHandler startSecurityThreads() { > + ThreadGroup securityThreadGroup = new ThreadGroup("NetxSecurityThreadGroup"); > + SecurityDialogMessageHandler runner = new SecurityDialogMessageHandler(); > + Thread securityThread = new Thread(securityThreadGroup, runner, "NetxSecurityThread"); > + securityThread.start(); > + return runner; > + } > + > + /** > * Returns true if a webstart application has been initialized, and false > * for a plugin applet. > */ > @@ -321,6 +352,20 @@ > } > > /** > + * > + * @return the {@link SecurityDialogMessageHandler} that should be used to > + * post security dialog messages > + */ > + public static SecurityDialogMessageHandler getSecurityDialogHandler() { > + SecurityManager sm = System.getSecurityManager(); > + if (sm != null) { > + // TODO might want to reduce the permission required > + sm.checkPermission(new AllPermission()); > + } > + return securityDialogMessageHandler; > + } > + No need for the TODO there. The code should be fully trusted. The only partially trusted code here would be jnlp apps with j2ee permissions and what not, and those should not have access to the dialog. > + /** > * Returns the system default base dir for or if not set, > * prompts the user for the location. > * > diff -r afdd3f284524 netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java Mon Oct 18 21:29:09 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java Tue Oct 19 12:07:40 2010 -0400 > @@ -34,7 +34,7 @@ > import javax.swing.JWindow; > > import net.sourceforge.jnlp.JNLPFile; > -import net.sourceforge.jnlp.security.SecurityWarningDialog; > +import net.sourceforge.jnlp.security.AccessType; > import net.sourceforge.jnlp.services.ServiceUtil; > import net.sourceforge.jnlp.util.WeakList; > import sun.awt.AWTSecurityManager; > @@ -392,7 +392,7 @@ > ApplicationInstance app = getApplication(); > if (app != null && !app.isSigned()) { > if (perm instanceof SocketPermission > - && ServiceUtil.checkAccess(SecurityWarningDialog.AccessType.NETWORK, perm.getName())) { > + && ServiceUtil.checkAccess(AccessType.NETWORK, perm.getName())) { > return true; > } > } > @@ -434,7 +434,7 @@ > Window w = (Window) window; > > if (JNLPRuntime.isDebug()) > - System.err.println("SM: app: "+app.getTitle()+" is adding a window: "+window); > + System.err.println("SM: app: "+app.getTitle()+" is adding a window: "+window+" with appContext"+AppContext.getAppContext()); Just a minor nitpick .. there should be a space between appContext and the ending quotation mark. > > weakWindows.add(window); // for mapping window -> app > weakApplications.add(app); > @@ -538,4 +538,31 @@ > > } > > + /** > + * Tests if a client can get access to the AWT event queue. This version allows > + * complete access to the EventQueue for its own AppContext-specific EventQueue. > + * > + * FIXME there are probably huge security implications for this. Eg: > + * http://hg.openjdk.java.net/jdk7/awt/jdk/rev/8022709a306d > + * > + * @exception SecurityException if the caller does not have > + * permission to accesss the AWT event queue. > + */ > + public void checkAwtEventQueueAccess() { > + /* > + * this is the templace of the code that should allow applets access to > + * eventqueues > + */ > + > + // AppContext appContext = AppContext.getAppContext(); > + // ApplicationInstance instance = getApplication(); > + > + // if ((appContext == mainAppContext) && (instance != null)) { > + // If we're about to allow access to the main EventQueue, > + // and anything untrusted is on the class context stack, > + // disallow access. > + super.checkAwtEventQueueAccess(); > + // } > + } > + As per your original email, I assume this is the part where access is completely disabled for now. > } > diff -r afdd3f284524 netx/net/sourceforge/jnlp/security/AccessType.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/jnlp/security/AccessType.java Tue Oct 19 12:07:40 2010 -0400 > @@ -0,0 +1,53 @@ > +/* AccessType.java > + Copyright (C) 2010 Red Hat, Inc. > + > +This file is part of IcedTea. > + > +IcedTea is free software; you can redistribute it and/or > +modify it under the terms of the GNU General Public License as published by > +the Free Software Foundation, version 2. > + > +IcedTea is distributed in the hope that it will be useful, > +but WITHOUT ANY WARRANTY; without even the implied warranty of > +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > +General Public License for more details. > + > +You should have received a copy of the GNU General Public License > +along with IcedTea; see the file COPYING. If not, write to > +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA > +02110-1301 USA. > + > +Linking this library statically or dynamically with other modules is > +making a combined work based on this library. Thus, the terms and > +conditions of the GNU General Public License cover the whole > +combination. > + > +As a special exception, the copyright holders of this library give you > +permission to link this library with independent modules to produce an > +executable, regardless of the license terms of these independent > +modules, and to copy and distribute the resulting executable under > +terms of your choice, provided that you also meet, for each linked > +independent module, the terms and conditions of the license of that > +module. An independent module is a module which is not derived from > +or based on this library. If you modify this library, you may extend > +this exception to your version of the library, but you are not > +obligated to do so. If you do not wish to do so, delete this > +exception statement from your version. > +*/ > + > +package net.sourceforge.jnlp.security; > + > +/** The types of access which may need user permission. */ > +public enum AccessType { > + READ_FILE, > + WRITE_FILE, > + CREATE_DESTKOP_SHORTCUT, > + CLIPBOARD_READ, > + CLIPBOARD_WRITE, > + PRINTER, > + NETWORK, > + VERIFIED, > + UNVERIFIED, > + NOTALLSIGNED, > + SIGNING_ERROR > +} Is there a reason this enum needs its own class? I understand the need to need to remove it out of SecurityWarningDialog.. perhaps it should reside in the new SecurityWarning class? > diff -r afdd3f284524 netx/net/sourceforge/jnlp/security/AccessWarningPane.java > --- a/netx/net/sourceforge/jnlp/security/AccessWarningPane.java Mon Oct 18 21:29:09 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/security/AccessWarningPane.java Tue Oct 19 12:07:40 2010 -0400 > @@ -56,6 +56,7 @@ > import javax.swing.SwingConstants; > > import net.sourceforge.jnlp.JNLPFile; > +import net.sourceforge.jnlp.security.AccessType; > import net.sourceforge.jnlp.util.FileUtils; > > /** > @@ -86,7 +87,7 @@ > * Creates the actual GUI components, and adds it to this panel > */ > private void addComponents() { > - SecurityWarningDialog.AccessType type = parent.getAccessType(); > + AccessType type = parent.getAccessType(); > JNLPFile file = parent.getFile(); > > String name = ""; > diff -r afdd3f284524 netx/net/sourceforge/jnlp/security/CertWarningPane.java > --- a/netx/net/sourceforge/jnlp/security/CertWarningPane.java Mon Oct 18 21:29:09 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/security/CertWarningPane.java Tue Oct 19 12:07:40 2010 -0400 > @@ -60,6 +60,7 @@ > import net.sourceforge.jnlp.JNLPFile; > import net.sourceforge.jnlp.PluginBridge; > import net.sourceforge.jnlp.runtime.JNLPRuntime; > +import net.sourceforge.jnlp.security.AccessType; > import net.sourceforge.jnlp.tools.KeyTool; > > /** > @@ -85,7 +86,7 @@ > * Creates the actual GUI components, and adds it to this panel > */ > private void addComponents() { > - SecurityWarningDialog.AccessType type = parent.getAccessType(); > + AccessType type = parent.getAccessType(); > JNLPFile file = parent.getFile(); > Certificate c = parent.getJarSigner().getPublisher(); > > diff -r afdd3f284524 netx/net/sourceforge/jnlp/security/SecurityDialogMessage.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/jnlp/security/SecurityDialogMessage.java Tue Oct 19 12:07:40 2010 -0400 > @@ -0,0 +1,40 @@ > +package net.sourceforge.jnlp.security; > + > +import java.security.cert.X509Certificate; > +import java.util.concurrent.Semaphore; > + > +import javax.swing.JDialog; > + > +import net.sourceforge.jnlp.JNLPFile; > +import net.sourceforge.jnlp.security.AccessType; > +import net.sourceforge.jnlp.security.SecurityWarning.DialogType; > + > +/** > + * Represents a message to the security framework to show a specific security > + * dialog > + */ > +final class SecurityDialogMessage { > + > + /* > + * These fields contain information need to display the correct dialog type > + */ > + > + public DialogType dialogType; > + public AccessType accessType; > + public JNLPFile file; > + public CertVerifier certVerifier; > + public X509Certificate certificate; > + public Object[] extras; > + > + public volatile Object userResponse; > + Why is userResponse volatile? Based on the patch, for a given instance, only one thread (either the even dispatcher when action is performed OR another caller thread when locking throws an interruptedexception) modifies the value... or am I missing something? > + /* > + * These two fields are used to block/unblock the application or the applet. > + * If either of them is not null, call release() or dispose() on it to allow > + * the application/applet to continue. > + */ > + > + public Semaphore lock; > + public JDialog toDispose; > + > +} > \ No newline at end of file > diff -r afdd3f284524 netx/net/sourceforge/jnlp/security/SecurityDialogMessageHandler.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/jnlp/security/SecurityDialogMessageHandler.java Tue Oct 19 12:07:40 2010 -0400 > @@ -0,0 +1,68 @@ > +package net.sourceforge.jnlp.security; > + > +import java.awt.event.ActionEvent; > +import java.awt.event.ActionListener; > +import java.util.concurrent.BlockingQueue; > +import java.util.concurrent.LinkedBlockingQueue; > + > +import net.sourceforge.jnlp.runtime.JNLPRuntime; > + > +/** > + * Handles {@link SecurityDialogMessage}s and shows appropriate security dialogs > + */ > +public final class SecurityDialogMessageHandler implements Runnable { > + > + private BlockingQueue queue = new LinkedBlockingQueue(); > + > + @Override > + public void run() { > + try { > + if (JNLPRuntime.isDebug()) { > + System.out.println("Starting security dialog thread"); > + } > + while (true) { > + SecurityDialogMessage msg = queue.take(); > + handleMessage(msg); > + } > + } catch (InterruptedException e) { > + if (JNLPRuntime.isDebug()) { > + System.out.println("Shutting down security event thread"); > + } > + return; > + } > + > + } > + If a misbehaving trusted app does an interruptall, the above would run into problems. > + private void handleMessage(SecurityDialogMessage message) { > + final SecurityDialogMessage msg = message; > + > + final SecurityWarningDialog dialog = new SecurityWarningDialog(message.dialogType, > + message.accessType, message.file, message.certVerifier, message.certificate, message.extras); > + > + dialog.addActionListener(new ActionListener() { > + > + @Override > + public void actionPerformed(ActionEvent e) { > + msg.userResponse = dialog.getValue(); > + /* Allow the client to continue on the other side */ > + if (msg.toDispose != null) { > + msg.toDispose.dispose(); > + } > + if (msg.lock != null) { > + msg.lock.release(); > + } > + } > + }); > + dialog.setVisible(true); > + > + } > + > + public void postMessage(SecurityDialogMessage message) { > + try { > + queue.put(message); > + } catch (InterruptedException e) { > + e.printStackTrace(); > + } > + } > + > +} There are almost no comments in the above file. Can you please add some, stating what those functions are doing? > diff -r afdd3f284524 netx/net/sourceforge/jnlp/security/SecurityWarning.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/jnlp/security/SecurityWarning.java Tue Oct 19 12:07:40 2010 -0400 > @@ -0,0 +1,278 @@ > +/* SecurityWarningDialogFactory.java > + Copyright (C) 2010 Red Hat, Inc. > + > +This file is part of IcedTea. > + > +IcedTea is free software; you can redistribute it and/or > +modify it under the terms of the GNU General Public License as published by > +the Free Software Foundation, version 2. > + > +IcedTea is distributed in the hope that it will be useful, > +but WITHOUT ANY WARRANTY; without even the implied warranty of > +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > +General Public License for more details. > + > +You should have received a copy of the GNU General Public License > +along with IcedTea; see the file COPYING. If not, write to > +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA > +02110-1301 USA. > + > +Linking this library statically or dynamically with other modules is > +making a combined work based on this library. Thus, the terms and > +conditions of the GNU General Public License cover the whole > +combination. > + > +As a special exception, the copyright holders of this library give you > +permission to link this library with independent modules to produce an > +executable, regardless of the license terms of these independent > +modules, and to copy and distribute the resulting executable under > +terms of your choice, provided that you also meet, for each linked > +independent module, the terms and conditions of the license of that > +module. An independent module is a module which is not derived from > +or based on this library. If you modify this library, you may extend > +this exception to your version of the library, but you are not > +obligated to do so. If you do not wish to do so, delete this > +exception statement from your version. > +*/ > + > + > +package net.sourceforge.jnlp.security; > + > +import java.awt.Dialog.ModalityType; > +import java.awt.event.WindowAdapter; > +import java.awt.event.WindowEvent; > +import java.security.AccessController; > +import java.security.PrivilegedAction; > +import java.util.concurrent.Semaphore; > + > +import javax.swing.JDialog; > +import javax.swing.SwingUtilities; > + > +import net.sourceforge.jnlp.JNLPFile; > +import net.sourceforge.jnlp.runtime.JNLPRuntime; > + > +/** > + * A factory for showing many possible types of security warning to the user.

> + * > + * This contains all the public methods that classes outside this package should > + * use instead of using {@link SecurityWarningDialog} directly. > + * > + * All of these methods post a message to the > + * {@link SecurityDialogMessageHandler} and block waiting for a response. > + */ > +public class SecurityWarning { > + /** Types of dialogs we can create */ > + public static enum DialogType { > + CERT_WARNING, > + MORE_INFO, > + CERT_INFO, > + SINGLE_CERT_INFO, > + ACCESS_WARNING, > + NOTALLSIGNED_WARNING, > + APPLET_WARNING > + } > + > + /** > + * Shows a warning dialog for different types of system access (i.e. file > + * open/save, clipboard read/write, printing, etc). > + * > + * @param accessType the type of system access requested. > + * @param file the jnlp file associated with the requesting application. > + * @return true if permission was granted by the user, false otherwise. > + */ > + public static boolean showAccessWarningDialog(AccessType accessType, JNLPFile file) { > + return showAccessWarningDialog(accessType, file, null); > + } > + > + /** > + * Shows a warning dialog for different types of system access (i.e. file > + * open/save, clipboard read/write, printing, etc). > + * > + * @param accessType the type of system access requested. > + * @param file the jnlp file associated with the requesting application. > + * @param extras an optional array of Strings (typically) that gets > + * passed to the dialog labels. > + * @return true if permission was granted by the user, false otherwise. > + */ > + public static boolean showAccessWarningDialog(final AccessType accessType, > + final JNLPFile file, final Object[] extras) { > + final SecurityDialogMessage message = new SecurityDialogMessage(); > + > + message.dialogType = DialogType.ACCESS_WARNING; > + message.accessType = accessType; > + message.file = file; > + message.extras = extras; > + > + Object selectedValue = getUserResponse(message); > + > + if (selectedValue == null) { > + return false; > + } else if (selectedValue instanceof Integer) { > + if (((Integer) selectedValue).intValue() == 0) > + return true; > + else > + return false; > + } else { > + return false; > + } > + } > + > + /** > + * Shows a warning dialog for when the main application jars are signed, > + * but extensions aren't > + * > + * @return true if permission was granted by the user, false otherwise. > + */ > + public static boolean showNotAllSignedWarningDialog(JNLPFile file) { > + > + final SecurityDialogMessage message = new SecurityDialogMessage(); > + message.dialogType = DialogType.NOTALLSIGNED_WARNING; > + message.accessType = AccessType.NOTALLSIGNED; > + message.file = file; > + message.extras = new Object[0]; > + > + Object selectedValue = getUserResponse(message); > + > + if (selectedValue == null) { > + return false; > + } else if (selectedValue instanceof Integer) { > + if (((Integer)selectedValue).intValue() == 0) { > + return true; > + } else { > + return false; > + } > + } else { > + return false; > + } > + } > + > + /** > + * Shows a security warning dialog according to the specified type of > + * access. If type is one of AccessType.VERIFIED or > + * AccessType.UNVERIFIED, extra details will be available with regards > + * to code signing and signing certificates. > + * > + * @param accessType the type of warning dialog to show > + * @param file the JNLPFile associated with this warning > + * @param jarSigner the JarSigner used to verify this application > + */ > + public static boolean showCertWarningDialog(AccessType accessType, > + JNLPFile file, CertVerifier jarSigner) { > + > + final SecurityDialogMessage message = new SecurityDialogMessage(); > + message.dialogType = DialogType.CERT_WARNING; > + message.accessType = accessType; > + message.file = file; > + message.certVerifier = jarSigner; > + > + Object selectedValue = getUserResponse(message); > + > + if (selectedValue == null) { > + return false; > + } else if (selectedValue instanceof Integer) { > + if (((Integer) selectedValue).intValue() == 0) > + return true; > + else > + return false; > + } else { > + return false; > + } > + } > + > + /** > + * FIXME This is unused. Remove it? > + * @return (0, 1, 2) => (Yes, No, Cancel) > + */ > + public static int showAppletWarning() { > + > + SecurityDialogMessage message = new SecurityDialogMessage(); > + message.dialogType = DialogType.APPLET_WARNING; > + > + Object selectedValue = getUserResponse(message); > + > + // result 0 = Yes, 1 = No, 2 = Cancel > + if (selectedValue == null) { > + return 2; > + } else if (selectedValue instanceof Integer) { > + return ((Integer) selectedValue).intValue(); > + } else { > + return 2; > + } > + } > + > + /** > + * Posts the message to the SecurityThread and gets the response. Blocks > + * until a response has been recieved. It's safe to call this from an > + * EventDispatchThread. > + * > + * @param message the SecuritDialogMessage indicating what type of dialog to > + * display > + * @return The user's response. Can be null. The exact answer depends on the > + * type of message, but generally an Integer corresponding to the value 0 > + * indicates success/proceed, and everything else indicates failure > + */ > + private static Object getUserResponse(final SecurityDialogMessage message) { > + /* > + * Want to show a security warning, while blocking the client > + * application. This would be easy except there is a bug in showing > + * modal JDialogs in a different AppContext. The source EventQueue - > + * that sends the message to the (destination) EventQueue which is > + * supposed to actually show the dialog - must not block. If the source > + * EventQueue blocks, the destination EventQueue stops responding. So we > + * have a hack here to work around it. > + */ > + > + /* > + * If this is the event dispatch thread the use the hack > + */ > + if (SwingUtilities.isEventDispatchThread()) { > + /* > + * Create a tiny modal dialog (which creates a new EventQueue for > + * this AppContext, but blocks the original client EventQueue) and > + * then post the message - this makes the source EventQueue continue > + * running - but dot not allow the actual applet/application to > + * continue processing > + */ > + final JDialog fakeDialog = new JDialog(); > + fakeDialog.setSize(0, 0); > + fakeDialog.setResizable(false); > + fakeDialog.setModalityType(ModalityType.APPLICATION_MODAL); > + fakeDialog.addWindowListener(new WindowAdapter() { > + > + @Override > + public void windowOpened(WindowEvent e) { > + message.toDispose = fakeDialog; > + message.lock = null; > + AccessController.doPrivileged(new PrivilegedAction() { > + @Override > + public Void run() { > + JNLPRuntime.getSecurityDialogHandler().postMessage(message); > + return null; > + } > + }); > + } > + }); > + > + /* this dialog will be disposed/hidden when the user closes the security prompt */ > + fakeDialog.setVisible(true); > + } else { > + /* > + * Otherwise do it the normal way. Post a message to the security > + * thread to make it show the security dialog. Wait until it tells us > + * to proceed. > + */ > + message.toDispose = null; > + message.lock = new Semaphore(0); > + JNLPRuntime.getSecurityDialogHandler().postMessage(message); > + > + try { > + message.lock.acquire(); > + } catch (InterruptedException e) { > + message.userResponse = null; > + } > + } > + > + return message.userResponse; > + } > + > +} See comment above. An interruptall would cause all subsequent warning dialogs by other applets in the vm to return a null user response. Rest looks fine to me! From doko at ubuntu.com Tue Oct 19 17:54:15 2010 From: doko at ubuntu.com (Matthias Klose) Date: Wed, 20 Oct 2010 02:54:15 +0200 Subject: /hg/icedtea6: Make HotSpot 19 the default. Update documentation... In-Reply-To: References: Message-ID: <4CBE3DB7.4010703@ubuntu.com> On 19.10.2010 22:27, andrew at icedtea.classpath.org wrote: > changeset 5327c5405c78 in /hg/icedtea6 > details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=5327c5405c78 > author: Andrew John Hughes > date: Tue Oct 19 21:27:47 2010 +0100 > > Make HotSpot 19 the default. Update documentation to reflect recent > changes. > > 2010-10-19 Andrew John Hughes > > * INSTALL: Drop plugin dependencies. Document new > JDK detection. Drop removed options from VisualVM and the > plugin. Mention new hs19 default. > * README: Updated. Remove sections on plugin and NetX. > Update Zero&Shark section. > * NEWS: Add HotSpot 19, NetX& plugin removal, Shark > upstreaming and JDK detection/bootstrapping changes. > * acinclude.m4: (AC_CHECK_WITH_HOTSPOT_BUILD): Set > DEFAULT_BUILD to hs19 rather than the non-existent hs16 > (used when > --with-hotspot-build or > --with-hotspot-build=yes is passed). Introduce > ALTERNATE_BUILD to refer to the build enabled by --with- > hotspot-build, which is 'original' (hs17) at present. tested patch? > diff -r a85679cc93f4 -r 5327c5405c78 acinclude.m4 > --- a/acinclude.m4 Tue Oct 19 19:55:35 2010 +0100 > +++ b/acinclude.m4 Tue Oct 19 21:27:47 2010 +0100 > @@ -917,7 +917,8 @@ AC_DEFUN([AC_CHECK_WITH_GCJ], > > AC_DEFUN([AC_CHECK_WITH_HOTSPOT_BUILD], > [ > - DEFAULT_BUILD="hs16" > + DEFAULT_BUILD="hs19" > + ALTERNATE_BUILD="original" > AC_MSG_CHECKING([which HotSpot build to use]) > AC_ARG_WITH([hotspot-build], > [AS_HELP_STRING(--with-hotspot-build,the HotSpot build to use (see hotspot.map))], > @@ -925,16 +926,16 @@ AC_DEFUN([AC_CHECK_WITH_HOTSPOT_BUILD], > HSBUILD="${withval}" > ], > [ > - HSBUILD="original" > + HSBUILD="${DEFAULT_BUILD}" > ]) > if test "x${HSBUILD}" = xyes; then > + HSBUILD="${ALTERNATE_BUILD}" > + elif test "x${HSBUILD}" = xno; then > HSBUILD="${DEFAULT_BUILD}" > - elif test "x${HSBUILD}" = xno; then > - HSBUILD="original" > fi > AC_MSG_RESULT([${HSBUILD}]) > AC_SUBST([HSBUILD]) > - AM_CONDITIONAL(WITH_ALT_HSBUILD, test "x${HSBUILD}" != "xoriginal") > + AM_CONDITIONAL(WITH_ALT_HSBUILD, test "x${HSBUILD}" != "x${DEFAULT_BUILD}") > ]) > > AC_DEFUN([WITH_HOTSPOT_SRC_ZIP], breaks the build, at least when configuring --with-hotspot-build=hs19 --with-hotspot-src-zip= Checking patches/hotspot/hs19/gcc-suffix.patch 1 out of 1 hunk FAILED -- saving rejects to file openjdk/hotspot/make/linux/makefiles/gcc.make.rej ERROR patch patches/hotspot/hs19/gcc-suffix.patch FAILED! WARNING make clean-patch before retrying a fix make[1]: *** [stamps/patch.stamp] Error 2 the hotspot tarball isn't unpacked. reverting the patch lets the build run again From mark at klomp.org Wed Oct 20 00:20:51 2010 From: mark at klomp.org (Mark Wielaard) Date: Wed, 20 Oct 2010 09:20:51 +0200 Subject: /hg/icedtea6: Make HotSpot 19 the default. Update documentation... In-Reply-To: <4CBE3DB7.4010703@ubuntu.com> References: <4CBE3DB7.4010703@ubuntu.com> Message-ID: <1287559251.2686.1.camel@springer.wildebeest.org> On Wed, 2010-10-20 at 02:54 +0200, Matthias Klose wrote: > On 19.10.2010 22:27, andrew at icedtea.classpath.org wrote: > > changeset 5327c5405c78 in /hg/icedtea6 > > details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=5327c5405c78 > > author: Andrew John Hughes > > date: Tue Oct 19 21:27:47 2010 +0100 > > > > Make HotSpot 19 the default. Update documentation to reflect recent > > changes. > > > > 2010-10-19 Andrew John Hughes > > > > * INSTALL: Drop plugin dependencies. Document new > > JDK detection. Drop removed options from VisualVM and the > > plugin. Mention new hs19 default. > > * README: Updated. Remove sections on plugin and NetX. > > Update Zero&Shark section. > > * NEWS: Add HotSpot 19, NetX& plugin removal, Shark > > upstreaming and JDK detection/bootstrapping changes. > > * acinclude.m4: (AC_CHECK_WITH_HOTSPOT_BUILD): Set > > DEFAULT_BUILD to hs19 rather than the non-existent hs16 > > (used when > > --with-hotspot-build or > > --with-hotspot-build=yes is passed). Introduce > > ALTERNATE_BUILD to refer to the build enabled by --with- > > hotspot-build, which is 'original' (hs17) at present. > > tested patch? > > > diff -r a85679cc93f4 -r 5327c5405c78 acinclude.m4 > > --- a/acinclude.m4 Tue Oct 19 19:55:35 2010 +0100 > > +++ b/acinclude.m4 Tue Oct 19 21:27:47 2010 +0100 > > @@ -917,7 +917,8 @@ AC_DEFUN([AC_CHECK_WITH_GCJ], > > > > AC_DEFUN([AC_CHECK_WITH_HOTSPOT_BUILD], > > [ > > - DEFAULT_BUILD="hs16" > > + DEFAULT_BUILD="hs19" > > + ALTERNATE_BUILD="original" > > AC_MSG_CHECKING([which HotSpot build to use]) > > AC_ARG_WITH([hotspot-build], > > [AS_HELP_STRING(--with-hotspot-build,the HotSpot build to use (see hotspot.map))], > > @@ -925,16 +926,16 @@ AC_DEFUN([AC_CHECK_WITH_HOTSPOT_BUILD], > > HSBUILD="${withval}" > > ], > > [ > > - HSBUILD="original" > > + HSBUILD="${DEFAULT_BUILD}" > > ]) > > if test "x${HSBUILD}" = xyes; then > > + HSBUILD="${ALTERNATE_BUILD}" > > + elif test "x${HSBUILD}" = xno; then > > HSBUILD="${DEFAULT_BUILD}" > > - elif test "x${HSBUILD}" = xno; then > > - HSBUILD="original" > > fi > > AC_MSG_RESULT([${HSBUILD}]) > > AC_SUBST([HSBUILD]) > > - AM_CONDITIONAL(WITH_ALT_HSBUILD, test "x${HSBUILD}" != "xoriginal") > > + AM_CONDITIONAL(WITH_ALT_HSBUILD, test "x${HSBUILD}" != "x${DEFAULT_BUILD}") > > ]) > > > > AC_DEFUN([WITH_HOTSPOT_SRC_ZIP], > > breaks the build, at least when configuring > --with-hotspot-build=hs19 --with-hotspot-src-zip= > > Checking patches/hotspot/hs19/gcc-suffix.patch > 1 out of 1 hunk FAILED -- saving rejects to file > openjdk/hotspot/make/linux/makefiles/gcc.make.rej > ERROR patch patches/hotspot/hs19/gcc-suffix.patch FAILED! > WARNING make clean-patch before retrying a fix > make[1]: *** [stamps/patch.stamp] Error 2 Same on the autobuilder: http://icedtea.classpath.org/pipermail/testresults/2010-October/000831.html Which is configured with just: --enable-nss --with-additional-vms=cacao,shark From doko at icedtea.classpath.org Wed Oct 20 03:01:12 2010 From: doko at icedtea.classpath.org (doko at icedtea.classpath.org) Date: Wed, 20 Oct 2010 10:01:12 +0000 Subject: /hg/icedtea-web: 2010-10-20 Matthias Klose Message-ID: changeset c63223d1132b in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=c63223d1132b author: doko at ubuntu.com date: Wed Oct 20 11:57:18 2010 +0200 2010-10-20 Matthias Klose * Makefile.am: Fix build with builddir != srcdir. diffstat: 2 files changed, 6 insertions(+), 1 deletion(-) ChangeLog | 4 ++++ Makefile.am | 3 ++- diffs (31 lines): diff -r fc0b251243fb -r c63223d1132b ChangeLog --- a/ChangeLog Tue Oct 19 18:19:19 2010 +0100 +++ b/ChangeLog Wed Oct 20 11:57:18 2010 +0200 @@ -1,3 +1,7 @@ 2010-10-19 Andrew John Hughes + + * Makefile.am: Fix build with builddir != srcdir. + 2010-10-19 Andrew John Hughes * Makefile.am: diff -r fc0b251243fb -r c63223d1132b Makefile.am --- a/Makefile.am Tue Oct 19 18:19:19 2010 +0100 +++ b/Makefile.am Wed Oct 20 11:57:18 2010 +0200 @@ -93,7 +93,7 @@ LAUNCHER_SRCDIR = $(abs_top_srcdir)/laun LAUNCHER_SRCDIR = $(abs_top_srcdir)/launcher LAUNCHER_OBJECTS = java.o java_md.o splashscreen_stubs.o PLUGIN_LAUNCHER_OBJECTS = $(addprefix $(PLUGIN_DIR)/launcher/,$(LAUNCHER_OBJECTS)) -NETX_LAUNCHER_OBJECTS = $(addprefix $(abs_top_builddir)/launcher/,$(LAUNCHER_OBJECTS)) +NETX_LAUNCHER_OBJECTS = $(addprefix $(PLUGIN_DIR)/launcher/,$(LAUNCHER_OBJECTS)) LAUNCHER_FLAGS = -O2 -fno-strict-aliasing -fPIC -W -Wall -Wno-unused -Wno-parentheses -pipe -fno-omit-frame-pointer \ -g -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT -DLAUNCHER_NAME='"java"' -I$(LAUNCHER_SRCDIR) \ -DJDK_MAJOR_VERSION='"1"' -DJDK_MINOR_VERSION='"6"' -DLIBARCHNAME='"$(JRE_ARCH_DIR)"' @@ -305,6 +305,7 @@ launcher/%.o: $(LAUNCHER_SRCDIR)/%.c -c -o $@ $< launcher/javaws: $(NETX_LAUNCHER_OBJECTS) + mkdir -p launcher $(CC) $(LAUNCHER_LINK) $(NETX_LAUNCHER_OBJECTS) # plugin tests From doko at ubuntu.com Wed Oct 20 03:23:59 2010 From: doko at ubuntu.com (Matthias Klose) Date: Wed, 20 Oct 2010 12:23:59 +0200 Subject: RFC: Build fixes for icedtea-web In-Reply-To: <20101019210254.GE28452@redhat.com> References: <20101019195836.GA28452@redhat.com> <20101019203643.GG3392@rivendell.middle-earth.co.uk> <20101019204453.GD28452@redhat.com> <20101019210254.GE28452@redhat.com> Message-ID: <4CBEC33F.2050207@ubuntu.com> On 19.10.2010 23:02, Deepak Bhole wrote: > * Deepak Bhole [2010-10-19 16:45]: >> * Dr Andrew John Hughes [2010-10-19 16:36]: >>> On 15:58 Tue 19 Oct , Deepak Bhole wrote: >>>> Hi, > >> >> >> I will respin the changes and repost. >> > > New patch attached. ChangeLog: > > * Makefile.am: > (NETX_DIR): New variable representing the NetX build dir.. > (LAUNCHER_LINK): Fixed ORIGIN to the rpath argument when compiling > launchers. > (clean-plugin): Fixed cleanup. > (clean-netx): Same. > * launcher/jni_md.h: Imported from OpenJDK. hmm, didn't see this one when committing my builddir != srcdir fix. please don't explicitly link with libc. the gcc driver handles this. also, the javaws man pages are still installed by icedtea6. I assume this is not intended. Matthias From ahughes at redhat.com Wed Oct 20 05:32:58 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Wed, 20 Oct 2010 13:32:58 +0100 Subject: /hg/icedtea-web: 2010-10-20 Matthias Klose In-Reply-To: References: Message-ID: <20101020123258.GA6734@bree.middle-earth.co.uk> On 10:01 Wed 20 Oct , doko at icedtea.classpath.org wrote: > changeset c63223d1132b in /hg/icedtea-web > details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=c63223d1132b > author: doko at ubuntu.com > date: Wed Oct 20 11:57:18 2010 +0200 > > 2010-10-20 Matthias Klose > > * Makefile.am: Fix build with builddir != srcdir. > > > diffstat: > > 2 files changed, 6 insertions(+), 1 deletion(-) > ChangeLog | 4 ++++ > Makefile.am | 3 ++- > > diffs (31 lines): > > diff -r fc0b251243fb -r c63223d1132b ChangeLog > --- a/ChangeLog Tue Oct 19 18:19:19 2010 +0100 > +++ b/ChangeLog Wed Oct 20 11:57:18 2010 +0200 > @@ -1,3 +1,7 @@ 2010-10-19 Andrew John Hughes +2010-10-20 Matthias Klose > + > + * Makefile.am: Fix build with builddir != srcdir. > + > 2010-10-19 Andrew John Hughes > > * Makefile.am: > diff -r fc0b251243fb -r c63223d1132b Makefile.am > --- a/Makefile.am Tue Oct 19 18:19:19 2010 +0100 > +++ b/Makefile.am Wed Oct 20 11:57:18 2010 +0200 > @@ -93,7 +93,7 @@ LAUNCHER_SRCDIR = $(abs_top_srcdir)/laun > LAUNCHER_SRCDIR = $(abs_top_srcdir)/launcher > LAUNCHER_OBJECTS = java.o java_md.o splashscreen_stubs.o > PLUGIN_LAUNCHER_OBJECTS = $(addprefix $(PLUGIN_DIR)/launcher/,$(LAUNCHER_OBJECTS)) > -NETX_LAUNCHER_OBJECTS = $(addprefix $(abs_top_builddir)/launcher/,$(LAUNCHER_OBJECTS)) > +NETX_LAUNCHER_OBJECTS = $(addprefix $(PLUGIN_DIR)/launcher/,$(LAUNCHER_OBJECTS)) > LAUNCHER_FLAGS = -O2 -fno-strict-aliasing -fPIC -W -Wall -Wno-unused -Wno-parentheses -pipe -fno-omit-frame-pointer \ > -g -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT -DLAUNCHER_NAME='"java"' -I$(LAUNCHER_SRCDIR) \ > -DJDK_MAJOR_VERSION='"1"' -DJDK_MINOR_VERSION='"6"' -DLIBARCHNAME='"$(JRE_ARCH_DIR)"' > @@ -305,6 +305,7 @@ launcher/%.o: $(LAUNCHER_SRCDIR)/%.c > -c -o $@ $< > > launcher/javaws: $(NETX_LAUNCHER_OBJECTS) > + mkdir -p launcher > $(CC) $(LAUNCHER_LINK) $(NETX_LAUNCHER_OBJECTS) > > # plugin tests The launcher objects shouldn't go in the same directory. -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From ahughes at redhat.com Wed Oct 20 06:04:06 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Wed, 20 Oct 2010 14:04:06 +0100 Subject: RFC: Build fixes for icedtea-web In-Reply-To: <4CBEC33F.2050207@ubuntu.com> References: <20101019195836.GA28452@redhat.com> <20101019203643.GG3392@rivendell.middle-earth.co.uk> <20101019204453.GD28452@redhat.com> <20101019210254.GE28452@redhat.com> <4CBEC33F.2050207@ubuntu.com> Message-ID: <20101020130406.GC6734@bree.middle-earth.co.uk> On 12:23 Wed 20 Oct , Matthias Klose wrote: > On 19.10.2010 23:02, Deepak Bhole wrote: > > * Deepak Bhole [2010-10-19 16:45]: > >> * Dr Andrew John Hughes [2010-10-19 16:36]: > >>> On 15:58 Tue 19 Oct , Deepak Bhole wrote: > >>>> Hi, > > > >> > >> > >> I will respin the changes and repost. > >> > > > > New patch attached. ChangeLog: > > > > * Makefile.am: > > (NETX_DIR): New variable representing the NetX build dir.. > > (LAUNCHER_LINK): Fixed ORIGIN to the rpath argument when compiling > > launchers. > > (clean-plugin): Fixed cleanup. > > (clean-netx): Same. > > * launcher/jni_md.h: Imported from OpenJDK. > > hmm, didn't see this one when committing my builddir != srcdir fix. > > please don't explicitly link with libc. the gcc driver handles this. > The launcher stuff is just copied pretty much as-is from the OpenJDK build so far. No doubt stuff like that can be cleaned up. We were just hacking all this into the OpenJDK build before so this is an improvement. > also, the javaws man pages are still installed by icedtea6. I assume this is not > intended. > I thought the add-netx target had been dropped? I'll check. > Matthias -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From ahughes at redhat.com Wed Oct 20 06:13:23 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Wed, 20 Oct 2010 14:13:23 +0100 Subject: RFC: Build fixes for icedtea-web In-Reply-To: <20101019210254.GE28452@redhat.com> References: <20101019195836.GA28452@redhat.com> <20101019203643.GG3392@rivendell.middle-earth.co.uk> <20101019204453.GD28452@redhat.com> <20101019210254.GE28452@redhat.com> Message-ID: <20101020131323.GD6734@bree.middle-earth.co.uk> On 17:02 Tue 19 Oct , Deepak Bhole wrote: > * Deepak Bhole [2010-10-19 16:45]: > > * Dr Andrew John Hughes [2010-10-19 16:36]: > > > On 15:58 Tue 19 Oct , Deepak Bhole wrote: > > > > Hi, > > > > > > > I will respin the changes and repost. > > > > New patch attached. ChangeLog: > > * Makefile.am: > (NETX_DIR): New variable representing the NetX build dir.. > (LAUNCHER_LINK): Fixed ORIGIN to the rpath argument when compiling > launchers. > (clean-plugin): Fixed cleanup. > (clean-netx): Same. > * launcher/jni_md.h: Imported from OpenJDK. > > Cheers, > Deepak Approved. Please apply. > diff -r fc0b251243fb Makefile.am > --- a/Makefile.am Tue Oct 19 18:19:19 2010 +0100 > +++ b/Makefile.am Tue Oct 19 17:00:54 2010 -0700 > @@ -1,5 +1,6 @@ > # Source directories > > +NETX_DIR = $(abs_top_builddir)/netx.build > NETX_SRCDIR = $(abs_top_srcdir)/netx > NETX_RESOURCE_DIR=$(NETX_SRCDIR)/net/sourceforge/jnlp/resources > NETX_EXTRA_DIR=$(abs_top_srcdir)/extra/net/sourceforge/jnlp/about/resources > @@ -93,14 +94,14 @@ > LAUNCHER_SRCDIR = $(abs_top_srcdir)/launcher > LAUNCHER_OBJECTS = java.o java_md.o splashscreen_stubs.o > PLUGIN_LAUNCHER_OBJECTS = $(addprefix $(PLUGIN_DIR)/launcher/,$(LAUNCHER_OBJECTS)) > -NETX_LAUNCHER_OBJECTS = $(addprefix $(abs_top_builddir)/launcher/,$(LAUNCHER_OBJECTS)) > +NETX_LAUNCHER_OBJECTS = $(addprefix $(NETX_DIR)/launcher/,$(LAUNCHER_OBJECTS)) > LAUNCHER_FLAGS = -O2 -fno-strict-aliasing -fPIC -W -Wall -Wno-unused -Wno-parentheses -pipe -fno-omit-frame-pointer \ > -g -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT -DLAUNCHER_NAME='"java"' -I$(LAUNCHER_SRCDIR) \ > -DJDK_MAJOR_VERSION='"1"' -DJDK_MINOR_VERSION='"6"' -DLIBARCHNAME='"$(JRE_ARCH_DIR)"' > LAUNCHER_LINK = -o $@ -Xlinker -O1 -Xlinker -z -Xlinker defs -L$(BOOT_DIR)/lib/$(INSTALL_ARCH_DIR) \ > -Wl,-soname=lib.so -L $(BOOT_DIR)/jre/lib/$(INSTALL_ARCH_DIR)/jli -Wl,-z -Wl,origin \ > - -Wl,--allow-shlib-undefined -Wl,-rpath -Wl,$$ORIGIN/../lib/$(INSTALL_ARCH_DIR)/jli -Wl,-rpath \ > - -Wl,$$ORIGIN/../jre/lib/$(INSTALL_ARCH_DIR)/jli -lpthread $(X11_CFLAGS) $(X11_LIBS) -ljli -ldl -lc -lz > + -Wl,--allow-shlib-undefined -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(INSTALL_ARCH_DIR)/jli -Wl,-rpath \ > + -Wl,\$$ORIGIN/../jre/lib/$(INSTALL_ARCH_DIR)/jli -lpthread $(X11_CFLAGS) $(X11_LIBS) -ljli -ldl -lc -lz > PLUGIN_VERSION = IcedTea $(PACKAGE_VERSION)$(ICEDTEA_REV)$(ICEDTEA_PKG) > > EXTRA_DIST = $(NETX_SRCDIR) $(abs_top_srcdir)/plugin javaws.png javaws.desktop extra launcher > @@ -108,7 +109,7 @@ > # Top-Level Targets > # ================= > > -all-local: stamps/netx-dist.stamp extra-lib/about.jar stamps/plugin.stamp launcher/javaws > +all-local: stamps/netx-dist.stamp extra-lib/about.jar stamps/plugin.stamp $(NETX_DIR)/launcher/javaws > > clean-local: clean-netx clean-plugin clean-liveconnect clean-extra clean-bootstrap-directory clean-native-ecj > > @@ -123,8 +124,8 @@ > cp -pPRf $(PLUGIN_DIR)/launcher/pluginappletviewer $(DESTDIR)$(bindir) > cp -pPRf $(abs_top_builddir)/liveconnect/lib/classes.jar $(DESTDIR)$(prefix)/jre/lib/plugin.jar > endif > - cp -pPRf $(abs_top_builddir)/netx.build/lib/classes.jar $(DESTDIR)$(prefix)/jre/lib/netx.jar > - cp -pPRf launcher/javaws $(DESTDIR)$(bindir) > + cp -pPRf $(NETX_DIR)/lib/classes.jar $(DESTDIR)$(prefix)/jre/lib/netx.jar > + cp -pPRf $(NETX_DIR)/launcher/javaws $(DESTDIR)$(bindir) > cp extra-lib/about.jar $(DESTDIR)$(prefix)/jre/lib > > install-data-local: > @@ -202,6 +203,7 @@ > touch stamps/plugin.stamp > > clean-plugin: $(ICEDTEAPLUGIN_CLEAN) > + rm -rf $(PLUGIN_DIR)/launcher > rm -f stamps/plugin.stamp > > liveconnect-source-files.txt: > @@ -215,7 +217,7 @@ > mkdir -p $(abs_top_builddir)/liveconnect && \ > $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ > -d $(abs_top_builddir)/liveconnect \ > - -classpath $(abs_top_builddir)/netx.build:$(RUNTIME) \ > + -classpath $(NETX_DIR):$(RUNTIME) \ > -sourcepath $(LIVECONNECT_SRCS) \ > @liveconnect-source-files.txt ; \ > fi > @@ -249,31 +251,31 @@ > find $(NETX_SRCDIR) -name '*.java' | sort > $@ > > stamps/netx.stamp: netx-source-files.txt stamps/bootstrap-directory.stamp > - mkdir -p $(abs_top_builddir)/netx.build > + mkdir -p $(NETX_DIR) > $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ > - -d $(abs_top_builddir)/netx.build \ > + -d $(NETX_DIR) \ > -sourcepath $(NETX_SRCDIR) \ > -bootclasspath $(RUNTIME) \ > @netx-source-files.txt > - cp -r $(NETX_RESOURCE_DIR) $(abs_top_builddir)/netx.build/net/sourceforge/jnlp > + cp -r $(NETX_RESOURCE_DIR) $(NETX_DIR)/net/sourceforge/jnlp > mkdir -p stamps > touch $@ > > stamps/netx-dist.stamp: stamps/netx.stamp > - (cd $(abs_top_builddir)/netx.build ; \ > + (cd $(NETX_DIR) ; \ > mkdir -p lib ; \ > $(BOOT_DIR)/bin/jar cf lib/classes.jar javax/jnlp net ; \ > cp -pPR $(SRC_DIR_LINK) $(NETX_SRCDIR) src; \ > find src -type f -exec chmod 640 '{}' ';' -o -type d -exec chmod 750 '{}' ';'; \ > cd src ; \ > - $(BOOT_DIR)/bin/jar uf $(abs_top_builddir)/netx.build/lib/classes.jar \ > + $(BOOT_DIR)/bin/jar uf $(NETX_DIR)/lib/classes.jar \ > `find . -type f -not -name '*.java'` ; \ > - $(ZIP) -qr $(abs_top_builddir)/netx.build/lib/src.zip javax net ) > + $(ZIP) -qr $(NETX_DIR)/lib/src.zip javax net ) > mkdir -p stamps > touch $@ > > clean-netx: > - rm -rf $(abs_top_builddir)/netx.build > + rm -rf $(NETX_DIR) > rm -f stamps/netx-dist.stamp > rm -f netx-source-files.txt > rm -f stamps/netx.stamp > @@ -299,12 +301,12 @@ > extra-lib/about.jar: stamps/extra-class-files.stamp > $(BOOT_DIR)/bin/jar cf $@ -C extra-lib net ; > > -launcher/%.o: $(LAUNCHER_SRCDIR)/%.c > - mkdir -p launcher && \ > +$(NETX_DIR)/launcher/%.o: $(LAUNCHER_SRCDIR)/%.c > + mkdir -p $(NETX_DIR)/launcher && \ > $(CC) $(LAUNCHER_FLAGS) -DJAVA_ARGS='{ "-J-ms8m", "net.sourceforge.jnlp.runtime.Boot", }' -DPROGNAME='"javaws"' \ > -c -o $@ $< > > -launcher/javaws: $(NETX_LAUNCHER_OBJECTS) > +$(NETX_DIR)/launcher/javaws: $(NETX_LAUNCHER_OBJECTS) > $(CC) $(LAUNCHER_LINK) $(NETX_LAUNCHER_OBJECTS) > > # plugin tests > diff -r fc0b251243fb launcher/jni_md.h > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/launcher/jni_md.h Tue Oct 19 17:00:54 2010 -0700 > @@ -0,0 +1,42 @@ > +/* > + * Copyright (c) 1996, 2000, Oracle and/or its affiliates. All rights reserved. > + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > + * > + * This code is free software; you can redistribute it and/or modify it > + * under the terms of the GNU General Public License version 2 only, as > + * published by the Free Software Foundation. Oracle designates this > + * particular file as subject to the "Classpath" exception as provided > + * by Oracle in the LICENSE file that accompanied this code. > + * > + * This code is distributed in the hope that it will be useful, but WITHOUT > + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License > + * version 2 for more details (a copy is included in the LICENSE file that > + * accompanied this code). > + * > + * You should have received a copy of the GNU General Public License version > + * 2 along with this work; if not, write to the Free Software Foundation, > + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. > + * > + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA > + * or visit www.oracle.com if you need additional information or have any > + * questions. > + */ > + > +#ifndef _JAVASOFT_JNI_MD_H_ > +#define _JAVASOFT_JNI_MD_H_ > + > +#define JNIEXPORT > +#define JNIIMPORT > +#define JNICALL > + > +typedef int jint; > +#ifdef _LP64 /* 64-bit Solaris */ > +typedef long jlong; > +#else > +typedef long long jlong; > +#endif > + > +typedef signed char jbyte; > + > +#endif /* !_JAVASOFT_JNI_MD_H_ */ -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From andrew at icedtea.classpath.org Wed Oct 20 06:26:26 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Wed, 20 Oct 2010 13:26:26 +0000 Subject: /hg/icedtea-web: Introduce NETX_DIR to represent NetX build dire... Message-ID: changeset 96217fb830fb in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=96217fb830fb author: Deepak Bhole date: Wed Oct 20 14:26:16 2010 +0100 Introduce NETX_DIR to represent NetX build directory and use for launcher. Escape ORIGIN correctly. Add jni_md.h to avoid gcj conflicts. 2010-10-19 Deepak Bhole * Makefile.am: (NETX_DIR): New variable representing the NetX build dir. (NETX_LAUNCHER_OBJECTS): Prefix with $(NETX_DIR). (LAUNCHER_LINK): Fixed escaping of ORIGIN to the rpath argument. (all-local): Fix javaws launcher path. (install-exec-local): Likewise, and use $(NETX_DIR) for NetX classes.jar. (clean-plugin): Remove launcher. (liveconnect): Use NETX_DIR in classpath. (netx): Use NETX_DIR throughout. (netx-dist): Likewise. (clean- netx): Likewise. ($(NETX_DIR)/launcher/%.o)): Likewise. * launcher/jni_md.h: Imported from OpenJDK. diffstat: 2 files changed, 34 insertions(+), 16 deletions(-) ChangeLog | 16 ++++++++++++++++ Makefile.am | 34 ++++++++++++++++++---------------- diffs (138 lines): diff -r c63223d1132b -r 96217fb830fb ChangeLog --- a/ChangeLog Wed Oct 20 11:57:18 2010 +0200 +++ b/ChangeLog Wed Oct 20 14:26:16 2010 +0100 @@ -1,3 +1,19 @@ 2010-10-20 Matthias Klose + + * Makefile.am: + (NETX_DIR): New variable representing the NetX build dir. + (NETX_LAUNCHER_OBJECTS): Prefix with $(NETX_DIR). + (LAUNCHER_LINK): Fixed escaping of ORIGIN to the rpath argument. + (all-local): Fix javaws launcher path. + (install-exec-local): Likewise, and use $(NETX_DIR) for NetX classes.jar. + (clean-plugin): Remove launcher. + (liveconnect): Use NETX_DIR in classpath. + (netx): Use NETX_DIR throughout. + (netx-dist): Likewise. + (clean-netx): Likewise. + ($(NETX_DIR)/launcher/%.o)): Likewise. + * launcher/jni_md.h: Imported from OpenJDK. + 2010-10-20 Matthias Klose * Makefile.am: Fix build with builddir != srcdir. diff -r c63223d1132b -r 96217fb830fb Makefile.am --- a/Makefile.am Wed Oct 20 11:57:18 2010 +0200 +++ b/Makefile.am Wed Oct 20 14:26:16 2010 +0100 @@ -1,5 +1,6 @@ # Source directories +NETX_DIR = $(abs_top_builddir)/netx.build NETX_SRCDIR = $(abs_top_srcdir)/netx NETX_RESOURCE_DIR=$(NETX_SRCDIR)/net/sourceforge/jnlp/resources NETX_EXTRA_DIR=$(abs_top_srcdir)/extra/net/sourceforge/jnlp/about/resources @@ -93,14 +94,14 @@ LAUNCHER_SRCDIR = $(abs_top_srcdir)/laun LAUNCHER_SRCDIR = $(abs_top_srcdir)/launcher LAUNCHER_OBJECTS = java.o java_md.o splashscreen_stubs.o PLUGIN_LAUNCHER_OBJECTS = $(addprefix $(PLUGIN_DIR)/launcher/,$(LAUNCHER_OBJECTS)) -NETX_LAUNCHER_OBJECTS = $(addprefix $(PLUGIN_DIR)/launcher/,$(LAUNCHER_OBJECTS)) +NETX_LAUNCHER_OBJECTS = $(addprefix $(NETX_DIR)/launcher/,$(LAUNCHER_OBJECTS)) LAUNCHER_FLAGS = -O2 -fno-strict-aliasing -fPIC -W -Wall -Wno-unused -Wno-parentheses -pipe -fno-omit-frame-pointer \ -g -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT -DLAUNCHER_NAME='"java"' -I$(LAUNCHER_SRCDIR) \ -DJDK_MAJOR_VERSION='"1"' -DJDK_MINOR_VERSION='"6"' -DLIBARCHNAME='"$(JRE_ARCH_DIR)"' LAUNCHER_LINK = -o $@ -Xlinker -O1 -Xlinker -z -Xlinker defs -L$(BOOT_DIR)/lib/$(INSTALL_ARCH_DIR) \ -Wl,-soname=lib.so -L $(BOOT_DIR)/jre/lib/$(INSTALL_ARCH_DIR)/jli -Wl,-z -Wl,origin \ - -Wl,--allow-shlib-undefined -Wl,-rpath -Wl,$$ORIGIN/../lib/$(INSTALL_ARCH_DIR)/jli -Wl,-rpath \ - -Wl,$$ORIGIN/../jre/lib/$(INSTALL_ARCH_DIR)/jli -lpthread $(X11_CFLAGS) $(X11_LIBS) -ljli -ldl -lc -lz + -Wl,--allow-shlib-undefined -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(INSTALL_ARCH_DIR)/jli -Wl,-rpath \ + -Wl,\$$ORIGIN/../jre/lib/$(INSTALL_ARCH_DIR)/jli -lpthread $(X11_CFLAGS) $(X11_LIBS) -ljli -ldl -lc -lz PLUGIN_VERSION = IcedTea $(PACKAGE_VERSION)$(ICEDTEA_REV)$(ICEDTEA_PKG) EXTRA_DIST = $(NETX_SRCDIR) $(abs_top_srcdir)/plugin javaws.png javaws.desktop extra launcher @@ -108,7 +109,7 @@ EXTRA_DIST = $(NETX_SRCDIR) $(abs_top_sr # Top-Level Targets # ================= -all-local: stamps/netx-dist.stamp extra-lib/about.jar stamps/plugin.stamp launcher/javaws +all-local: stamps/netx-dist.stamp extra-lib/about.jar stamps/plugin.stamp $(NETX_DIR)/launcher/javaws clean-local: clean-netx clean-plugin clean-liveconnect clean-extra clean-bootstrap-directory clean-native-ecj @@ -123,8 +124,8 @@ if ENABLE_PLUGIN cp -pPRf $(PLUGIN_DIR)/launcher/pluginappletviewer $(DESTDIR)$(bindir) cp -pPRf $(abs_top_builddir)/liveconnect/lib/classes.jar $(DESTDIR)$(prefix)/jre/lib/plugin.jar endif - cp -pPRf $(abs_top_builddir)/netx.build/lib/classes.jar $(DESTDIR)$(prefix)/jre/lib/netx.jar - cp -pPRf launcher/javaws $(DESTDIR)$(bindir) + cp -pPRf $(NETX_DIR)/lib/classes.jar $(DESTDIR)$(prefix)/jre/lib/netx.jar + cp -pPRf $(NETX_DIR)/launcher/javaws $(DESTDIR)$(bindir) cp extra-lib/about.jar $(DESTDIR)$(prefix)/jre/lib install-data-local: @@ -202,6 +203,7 @@ stamps/plugin.stamp: $(ICEDTEAPLUGIN_TAR touch stamps/plugin.stamp clean-plugin: $(ICEDTEAPLUGIN_CLEAN) + rm -rf $(PLUGIN_DIR)/launcher rm -f stamps/plugin.stamp liveconnect-source-files.txt: @@ -215,7 +217,7 @@ stamps/liveconnect.stamp: liveconnect-so mkdir -p $(abs_top_builddir)/liveconnect && \ $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(abs_top_builddir)/liveconnect \ - -classpath $(abs_top_builddir)/netx.build:$(RUNTIME) \ + -classpath $(NETX_DIR):$(RUNTIME) \ -sourcepath $(LIVECONNECT_SRCS) \ @liveconnect-source-files.txt ; \ fi @@ -249,31 +251,31 @@ netx-source-files.txt: find $(NETX_SRCDIR) -name '*.java' | sort > $@ stamps/netx.stamp: netx-source-files.txt stamps/bootstrap-directory.stamp - mkdir -p $(abs_top_builddir)/netx.build + mkdir -p $(NETX_DIR) $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ - -d $(abs_top_builddir)/netx.build \ + -d $(NETX_DIR) \ -sourcepath $(NETX_SRCDIR) \ -bootclasspath $(RUNTIME) \ @netx-source-files.txt - cp -r $(NETX_RESOURCE_DIR) $(abs_top_builddir)/netx.build/net/sourceforge/jnlp + cp -r $(NETX_RESOURCE_DIR) $(NETX_DIR)/net/sourceforge/jnlp mkdir -p stamps touch $@ stamps/netx-dist.stamp: stamps/netx.stamp - (cd $(abs_top_builddir)/netx.build ; \ + (cd $(NETX_DIR) ; \ mkdir -p lib ; \ $(BOOT_DIR)/bin/jar cf lib/classes.jar javax/jnlp net ; \ cp -pPR $(SRC_DIR_LINK) $(NETX_SRCDIR) src; \ find src -type f -exec chmod 640 '{}' ';' -o -type d -exec chmod 750 '{}' ';'; \ cd src ; \ - $(BOOT_DIR)/bin/jar uf $(abs_top_builddir)/netx.build/lib/classes.jar \ + $(BOOT_DIR)/bin/jar uf $(NETX_DIR)/lib/classes.jar \ `find . -type f -not -name '*.java'` ; \ - $(ZIP) -qr $(abs_top_builddir)/netx.build/lib/src.zip javax net ) + $(ZIP) -qr $(NETX_DIR)/lib/src.zip javax net ) mkdir -p stamps touch $@ clean-netx: - rm -rf $(abs_top_builddir)/netx.build + rm -rf $(NETX_DIR) rm -f stamps/netx-dist.stamp rm -f netx-source-files.txt rm -f stamps/netx.stamp @@ -299,8 +301,8 @@ extra-lib/about.jar: stamps/extra-class- extra-lib/about.jar: stamps/extra-class-files.stamp $(BOOT_DIR)/bin/jar cf $@ -C extra-lib net ; -launcher/%.o: $(LAUNCHER_SRCDIR)/%.c - mkdir -p launcher && \ +$(NETX_DIR)/launcher/%.o: $(LAUNCHER_SRCDIR)/%.c + mkdir -p $(NETX_DIR)/launcher && \ $(CC) $(LAUNCHER_FLAGS) -DJAVA_ARGS='{ "-J-ms8m", "net.sourceforge.jnlp.runtime.Boot", }' -DPROGNAME='"javaws"' \ -c -o $@ $< From andrew at icedtea.classpath.org Wed Oct 20 06:34:45 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Wed, 20 Oct 2010 13:34:45 +0000 Subject: /hg/icedtea-web: Add $(NETX_DIR) prefix to javaws launcher. Message-ID: changeset 22bfb12deaf7 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=22bfb12deaf7 author: Deepak Bhole date: Wed Oct 20 14:34:41 2010 +0100 Add $(NETX_DIR) prefix to javaws launcher. 2010-10-19 Deepak Bhole * Makefile.am: ($(NETX_DIR)/launcher/javaws): Use $(NETX_DIR). diffstat: 2 files changed, 6 insertions(+), 1 deletion(-) ChangeLog | 5 +++++ Makefile.am | 2 +- diffs (24 lines): diff -r 96217fb830fb -r 22bfb12deaf7 ChangeLog --- a/ChangeLog Wed Oct 20 14:26:16 2010 +0100 +++ b/ChangeLog Wed Oct 20 14:34:41 2010 +0100 @@ -1,3 +1,8 @@ 2010-10-19 Deepak Bhole + + * Makefile.am: + ($(NETX_DIR)/launcher/javaws): Use $(NETX_DIR). + 2010-10-19 Deepak Bhole * Makefile.am: diff -r 96217fb830fb -r 22bfb12deaf7 Makefile.am --- a/Makefile.am Wed Oct 20 14:26:16 2010 +0100 +++ b/Makefile.am Wed Oct 20 14:34:41 2010 +0100 @@ -306,7 +306,7 @@ extra-lib/about.jar: stamps/extra-class- $(CC) $(LAUNCHER_FLAGS) -DJAVA_ARGS='{ "-J-ms8m", "net.sourceforge.jnlp.runtime.Boot", }' -DPROGNAME='"javaws"' \ -c -o $@ $< -launcher/javaws: $(NETX_LAUNCHER_OBJECTS) +$(NETX_DIR)/launcher/javaws: $(NETX_LAUNCHER_OBJECTS) mkdir -p launcher $(CC) $(LAUNCHER_LINK) $(NETX_LAUNCHER_OBJECTS) From asu at redhat.com Wed Oct 20 06:49:51 2010 From: asu at redhat.com (Andrew Su) Date: Wed, 20 Oct 2010 09:49:51 -0400 (EDT) Subject: [RFC] icedtea-web (netx): Allow applet to read jnlp file for parameters In-Reply-To: <2140755531.1166061287582576408.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <1755978435.1166101287582591337.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Hi, This patch lets the applet read parameters stored in a jnlp file pointed to by the parameter "jnlp_href". Currently, when the applet loads given the parameter jnlp_href will not read the file, jnlp_file will be like any normal parameter passed in to an applet. I originally planned on placing it inside parse of PluginAppletViewer, but later decided that jnlp stuff should go back into netx. Thanks to Omair's patch which gave me the idea to place it inside PluginBridge (in netx). Comments? Questions? Concerns? Cheers, --Andrew From andrew at icedtea.classpath.org Wed Oct 20 06:50:47 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Wed, 20 Oct 2010 13:50:47 +0000 Subject: /hg/icedtea6: Don't abuse DEFAULT_BUILD in the HotSpot build macro. Message-ID: changeset 0bfb4898c039 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=0bfb4898c039 author: Andrew John Hughes date: Wed Oct 20 14:45:55 2010 +0100 Don't abuse DEFAULT_BUILD in the HotSpot build macro. 2010-10-19 Andrew John Hughes * INSTALL: Clarify HotSpot build documentation. * acinclude.m4: (AC_CHECK_WITH_HOTSPOT_BUILD): Don't abuse DEFAULT_BUILD. Introduce ORIGINAL_BUILD to represent the ORIGINAL BUILD and use that in the conditional and for --without-hotspot-build. Use DEFAULT_BUILD only for when the option is not specified. diffstat: 3 files changed, 19 insertions(+), 6 deletions(-) ChangeLog | 11 +++++++++++ INSTALL | 5 +++-- acinclude.m4 | 9 +++++---- diffs (62 lines): diff -r 5327c5405c78 -r 0bfb4898c039 ChangeLog --- a/ChangeLog Tue Oct 19 21:27:47 2010 +0100 +++ b/ChangeLog Wed Oct 20 14:45:55 2010 +0100 @@ -1,3 +1,14 @@ 2010-10-19 Andrew John Hughes + + * INSTALL: Clarify HotSpot build documentation. + * acinclude.m4: + (AC_CHECK_WITH_HOTSPOT_BUILD): Don't abuse + DEFAULT_BUILD. Introduce ORIGINAL_BUILD to + represent the ORIGINAL BUILD and use that in + the conditional and for --without-hotspot-build. + Use DEFAULT_BUILD only for when the option is + not specified. + 2010-10-19 Andrew John Hughes * INSTALL: Drop plugin dependencies. diff -r 5327c5405c78 -r 0bfb4898c039 INSTALL --- a/INSTALL Tue Oct 19 21:27:47 2010 +0100 +++ b/INSTALL Wed Oct 20 14:45:55 2010 +0100 @@ -308,8 +308,9 @@ revert to the version of hs17 provided i revert to the version of hs17 provided in b20. Note that the norm. is for up to one alternate (non-default) build to be supported and just passing --with-hotspot-build (equivalent to --with-hotspot-build=yes) -will provide the opposite to the default HotSpot (currently hs17, 'original'). -Conversely, passing --with-hotspot-build=no retains the default. +will always provide the alternate build (currently hs19). Conversely, +passing --with-hotspot-build=no provides the original build (currently +hs17). Javascript Support ================== diff -r 5327c5405c78 -r 0bfb4898c039 acinclude.m4 --- a/acinclude.m4 Tue Oct 19 21:27:47 2010 +0100 +++ b/acinclude.m4 Wed Oct 20 14:45:55 2010 +0100 @@ -917,8 +917,9 @@ AC_DEFUN([AC_CHECK_WITH_GCJ], AC_DEFUN([AC_CHECK_WITH_HOTSPOT_BUILD], [ - DEFAULT_BUILD="hs19" - ALTERNATE_BUILD="original" + ORIGINAL_BUILD="original" + ALTERNATE_BUILD="hs19" + DEFAULT_BUILD=${ALTERNATE_BUILD} AC_MSG_CHECKING([which HotSpot build to use]) AC_ARG_WITH([hotspot-build], [AS_HELP_STRING(--with-hotspot-build,the HotSpot build to use (see hotspot.map))], @@ -931,11 +932,11 @@ AC_DEFUN([AC_CHECK_WITH_HOTSPOT_BUILD], if test "x${HSBUILD}" = xyes; then HSBUILD="${ALTERNATE_BUILD}" elif test "x${HSBUILD}" = xno; then - HSBUILD="${DEFAULT_BUILD}" + HSBUILD="${ORIGINAL_BUILD}" fi AC_MSG_RESULT([${HSBUILD}]) AC_SUBST([HSBUILD]) - AM_CONDITIONAL(WITH_ALT_HSBUILD, test "x${HSBUILD}" != "x${DEFAULT_BUILD}") + AM_CONDITIONAL(WITH_ALT_HSBUILD, test "x${HSBUILD}" != "x${ORIGINAL_BUILD}") ]) AC_DEFUN([WITH_HOTSPOT_SRC_ZIP], From asu at redhat.com Wed Oct 20 06:51:28 2010 From: asu at redhat.com (Andrew Su) Date: Wed, 20 Oct 2010 09:51:28 -0400 (EDT) Subject: [RFC] icedtea-web (netx): Allow applet to read jnlp file for parameters In-Reply-To: <1984660164.1166281287582646088.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <1546541348.1166501287582688230.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> And here is the patch :) ----- "Andrew Su" wrote: > From: "Andrew Su" > To: "distro-pkg-dev" > Sent: Wednesday, October 20, 2010 9:49:51 AM GMT -05:00 US/Canada Eastern > Subject: [RFC] icedtea-web (netx): Allow applet to read jnlp file for parameters > > Hi, > > This patch lets the applet read parameters stored in a jnlp file > pointed to by the parameter "jnlp_href". Currently, when the applet > loads given the parameter jnlp_href will not read the file, jnlp_file > will be like any normal parameter passed in to an applet. > > I originally planned on placing it inside parse of PluginAppletViewer, > but later decided that jnlp stuff should go back into netx. Thanks to > Omair's patch which gave me the idea to place it inside PluginBridge > (in netx). > > Comments? Questions? Concerns? > > Cheers, > --Andrew -------------- next part -------------- A non-text attachment was scrubbed... Name: 20101020_enable_applet_parameter_from_jnlp_file.patch Type: text/x-patch Size: 2074 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101020/93c55e18/20101020_enable_applet_parameter_from_jnlp_file.patch From dbhole at redhat.com Wed Oct 20 06:55:22 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Wed, 20 Oct 2010 09:55:22 -0400 Subject: [RFC] icedtea-web (netx): Allow applet to read jnlp file for parameters In-Reply-To: <1546541348.1166501287582688230.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> References: <1984660164.1166281287582646088.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> <1546541348.1166501287582688230.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <20101020135522.GB8838@redhat.com> * Andrew Su [2010-10-20 09:51]: > And here is the patch :) > > > ----- "Andrew Su" wrote: > > > From: "Andrew Su" > > To: "distro-pkg-dev" > > Sent: Wednesday, October 20, 2010 9:49:51 AM GMT -05:00 US/Canada Eastern > > Subject: [RFC] icedtea-web (netx): Allow applet to read jnlp file for parameters > > > > Hi, > > > > This patch lets the applet read parameters stored in a jnlp file > > pointed to by the parameter "jnlp_href". Currently, when the applet > > loads given the parameter jnlp_href will not read the file, jnlp_file > > will be like any normal parameter passed in to an applet. > > > > I originally planned on placing it inside parse of PluginAppletViewer, > > but later decided that jnlp stuff should go back into netx. Thanks to > > Omair's patch which gave me the idea to place it inside PluginBridge > > (in netx). > > > > Comments? Questions? Concerns? > > Just a couple of minor things.. > > Cheers, > > --Andrew > diff -r 01c094e27afd netx/net/sourceforge/jnlp/PluginBridge.java > --- a/netx/net/sourceforge/jnlp/PluginBridge.java Wed Oct 13 01:31:53 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/PluginBridge.java Wed Oct 20 09:20:26 2010 -0400 > @@ -26,9 +26,11 @@ > import java.net.MalformedURLException; > import java.util.Calendar; > import java.util.Hashtable; > +import java.util.Iterator; > import java.util.Locale; > import java.util.List; > import java.util.ArrayList; > +import java.util.Map; > > import net.sourceforge.jnlp.runtime.JNLPRuntime; > > @@ -50,6 +52,29 @@ > fileVersion = new Version("1.1"); > this.codeBase = codebase; > this.sourceLocation = documentBase; > + > + if (atts.containsKey("jnlp_href")){ > + try { > + URL jnlp = new URL(codeBase.toExternalForm() + (String) atts.get("jnlp_href")); > + JNLPFile jnlp_file = new JNLPFile(jnlp); > + Map jnlp_params = jnlp_file.getApplet().getParameters(); > + > + // Change the parameter name to lowercase to follow conventions. > + Iterator it = jnlp_params.keySet().iterator(); > + while(it.hasNext()){ > + String key = (String) it.next(); > + atts.put(key.toLowerCase(), jnlp_params.get(key)); > + } > + } catch (MalformedURLException e) { > + // Don't fail because we cannot get the jnlp file. Parameters are optional not required. > + // it is the site developer who should ensure that file exist. > + System.out.println("Unable to get JNLP file at: " + codeBase.toExternalForm() > + + (String) atts.get("jnlp_href")); Should be printed to err not out since it is an error message > + } catch (Exception e) { > + // Something went horribly wrong. (Or malformed file) > + throw new RuntimeException("Unable to read JNLP file"); > + } > + } > The second catch block is not needed. Infact throwing a RuntimeException there will swallow the original cause and stack. Just the first catch for MalformedURLException is enough. After the above changes ok for commit to icedtea-web head. Cheers, Deepak > // also, see if cache_archive is specified > if (atts.get("cache_archive") != null && ((String) atts.get("cache_archive")).length() > 0) { From omajid at icedtea.classpath.org Wed Oct 20 07:05:15 2010 From: omajid at icedtea.classpath.org (omajid at icedtea.classpath.org) Date: Wed, 20 Oct 2010 14:05:15 +0000 Subject: /hg/icedtea-web: 2 new changesets Message-ID: changeset 8018994ecabd in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=8018994ecabd author: Omair Majid date: Wed Oct 20 09:49:01 2010 -0400 avoid creating unecessary nativedirs; clean them on exit 2010-10-20 Omair Majid * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (JNLPClassLoader): Call installShutdownHooks. (installShutdownHooks): New method. Installs a shutdown hook to recursively delete the contents of nativeDir. (activateNative): Only create a nativeDir if there are native libraries. changeset 257297223569 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=257297223569 author: Omair Majid date: Wed Oct 20 10:04:25 2010 -0400 do not encode cache file url when adding it to jarLocationSecurityMap 2010-10-20 Omair Majid * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (initializeResources): Do not perform url encoding on the file url. Stay consistent with the unencoded urls used in getPermissions. diffstat: 2 files changed, 56 insertions(+), 4 deletions(-) ChangeLog | 15 +++++ netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | 45 ++++++++++++++-- diffs (109 lines): diff -r 22bfb12deaf7 -r 257297223569 ChangeLog --- a/ChangeLog Wed Oct 20 14:34:41 2010 +0100 +++ b/ChangeLog Wed Oct 20 10:04:25 2010 -0400 @@ -1,3 +1,18 @@ 2010-10-19 Deepak Bhole + + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java + (initializeResources): Do not perform url encoding on the file url. Stay + consistent with the unencoded urls used in getPermissions. + +2010-10-20 Omair Majid + + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java + (JNLPClassLoader): Call installShutdownHooks. + (installShutdownHooks): New method. Installs a shutdown hook to + recursively delete the contents of nativeDir. + (activateNative): Only create a nativeDir if there are native + libraries. + 2010-10-19 Deepak Bhole * Makefile.am: diff -r 22bfb12deaf7 -r 257297223569 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Wed Oct 20 14:34:41 2010 +0100 +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Wed Oct 20 10:04:25 2010 -0400 @@ -59,6 +59,7 @@ import net.sourceforge.jnlp.cache.Update import net.sourceforge.jnlp.cache.UpdatePolicy; import net.sourceforge.jnlp.security.SecurityWarningDialog; import net.sourceforge.jnlp.tools.JarSigner; +import net.sourceforge.jnlp.util.FileUtils; import sun.misc.JarIndex; /** @@ -169,6 +170,41 @@ public class JNLPClassLoader extends URL setSecurity(); + installShutdownHooks(); + + } + + /** + * Install JVM shutdown hooks to clean up resources allocated by this + * ClassLoader. + */ + private void installShutdownHooks() { + Runtime.getRuntime().addShutdownHook(new Thread() { + @Override + public void run() { + if (JNLPRuntime.isDebug()) { + System.out.println("Cleaning up native directory" + nativeDir.getAbsolutePath()); + } + + /* + * Delete only the native dir created by this classloader (if + * there is one). Other classloaders (parent, peers) will all + * cleanup things they created + */ + if (nativeDir != null) { + try { + FileUtils.recursiveDelete(nativeDir, + new File(System.getProperty("java.io.tmpdir"))); + } catch (IOException e) { + /* + * failed to delete a file in tmpdir, no big deal (not + * to mention that the VM is shutting down at this + * point so no much we can do) + */ + } + } + } + }); } private void setSecurity() throws LaunchException { @@ -424,7 +460,7 @@ public class JNLPClassLoader extends URL for (JARDesc jarDesc: file.getResources().getJARs()) { try { - URL location = tracker.getCacheFile(jarDesc.getLocation()).toURI().toURL(); + URL location = tracker.getCacheFile(jarDesc.getLocation()).toURL(); SecurityDesc jarSecurity = file.getSecurity(); if (file instanceof PluginBridge) { @@ -741,9 +777,6 @@ public class JNLPClassLoader extends URL if (localFile == null) return; - if (nativeDir == null) - nativeDir = getNativeDir(); - String[] librarySuffixes = { ".so", ".dylib", ".jnilib", ".framework", ".dll" }; try { @@ -770,10 +803,14 @@ public class JNLPClassLoader extends URL continue; } + if (nativeDir == null) + nativeDir = getNativeDir(); + File outFile = new File(nativeDir, name); CacheUtil.streamCopy(jarFile.getInputStream(e), new FileOutputStream(outFile)); + } } catch (IOException ex) { From omajid at redhat.com Wed Oct 20 07:06:26 2010 From: omajid at redhat.com (Omair Majid) Date: Wed, 20 Oct 2010 10:06:26 -0400 Subject: [RFC] icedtea-web: use url escaping consistently in filenames In-Reply-To: <20101019202109.GC28452@redhat.com> References: <4CBDFB67.8090402@redhat.com> <20101019202109.GC28452@redhat.com> Message-ID: <4CBEF762.4010305@redhat.com> On 10/19/2010 04:21 PM, Deepak Bhole wrote: > * Omair Majid [2010-10-19 16:13]: >> Hi, >> >> The attached patch allows netx to work with jars with file names >> that need to be URL escaped (such as '[' and ']'). Netx consistently >> uses decoded URLs everywhere except in >> JNLPClassLoader.initializeResources(). >> >> File.toURI().toURL() encodes the filename as a URL, while >> File.toURL() does not encode the URL. >> > > To clarify.. URL location needs to stay decoded because it is used as a > key in a hashmap which is searched by other parts of the code using > decoded urls. > > Change looks okay to me. Okay for commit. Thanks, pushed to icedtea-web. Cheers, Omair From omajid at redhat.com Wed Oct 20 07:06:59 2010 From: omajid at redhat.com (Omair Majid) Date: Wed, 20 Oct 2010 10:06:59 -0400 Subject: [rfc] netx: do not create unnecessary native directories In-Reply-To: <20101018162933.GB7818@redhat.com> References: <4CAF3CE2.2030907@redhat.com> <20101018162933.GB7818@redhat.com> Message-ID: <4CBEF783.5050905@redhat.com> On 10/18/2010 12:29 PM, Deepak Bhole wrote: > * Omair Majid [2010-10-08 11:47]: >> Hi, >> >> Netx currently creates one or more directories under /tmp/ to hold >> native libraries any time it launches an application. The attached >> patch tries to reduce the clutter caused by these directories. The >> patch ensures that a directory for holding native files is only >> created if there are native libraries. The patch also installs a >> shutdown hook to delete the directory containing the native files. >> >> Any thoughts or comments? >> >> Cheers, >> Omair > >> diff -r 4698e476b886 ChangeLog >> --- a/ChangeLog Fri Oct 08 11:06:14 2010 -0400 >> +++ b/ChangeLog Fri Oct 08 11:33:49 2010 -0400 >> @@ -1,3 +1,11 @@ >> +2010-10-08 Omair Majid >> + >> + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java >> + (JNLPClassLoader): Call installShutdownHooks. >> + (installShutdownHooks): New method. Installs a shutdown hook to >> + recursively delete the contents of nativeDir. >> + (activateNative): Only create a nativeDir if there are native libraries. >> + >> 2010-10-08 Omair Majid >> >> * NEWS: Updated >> diff -r 4698e476b886 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java >> --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Fri Oct 08 11:06:14 2010 -0400 >> +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Fri Oct 08 11:33:49 2010 -0400 >> @@ -59,6 +59,7 @@ >> import net.sourceforge.jnlp.cache.UpdatePolicy; >> import net.sourceforge.jnlp.security.SecurityWarningDialog; >> import net.sourceforge.jnlp.tools.JarSigner; >> +import net.sourceforge.jnlp.util.FileUtils; >> import sun.misc.JarIndex; >> >> /** >> @@ -169,6 +170,41 @@ >> >> setSecurity(); >> >> + installShutdownHooks(); >> + >> + } >> + >> + /** >> + * Install JVM shutdown hooks to clean up resources allocated by this >> + * ClassLoader. >> + */ >> + private void installShutdownHooks() { >> + Runtime.getRuntime().addShutdownHook(new Thread() { >> + @Override >> + public void run() { >> + if (JNLPRuntime.isDebug()) { >> + System.out.println("Cleaing up native directory" + nativeDir.getAbsolutePath()); >> + } >> + > > Typo there in spelling of cleaning :) > > Rest looks fine to me. Assuming you have tested this, OK for commit to > HEAD and all branches. Thanks. I have fixed the typo and pushed it to icedtea-web Cheers, Omair From doko at icedtea.classpath.org Wed Oct 20 07:11:01 2010 From: doko at icedtea.classpath.org (doko at icedtea.classpath.org) Date: Wed, 20 Oct 2010 14:11:01 +0000 Subject: /hg/icedtea-web: Fix -sourcepath for builddir != srcdir Message-ID: changeset 3b526d8b7bb2 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=3b526d8b7bb2 author: doko at ubuntu.com date: Wed Oct 20 16:07:09 2010 +0200 Fix -sourcepath for builddir != srcdir 2010-10-20 Matthias Klose * Makefile.am (stamps/extra-class-files.stamp): Fix -sourcepath. diffstat: 2 files changed, 5 insertions(+), 1 deletion(-) ChangeLog | 4 ++++ Makefile.am | 2 +- diffs (23 lines): diff -r 257297223569 -r 3b526d8b7bb2 ChangeLog --- a/ChangeLog Wed Oct 20 10:04:25 2010 -0400 +++ b/ChangeLog Wed Oct 20 16:07:09 2010 +0200 @@ -1,3 +1,7 @@ 2010-10-20 Omair Majid + + * Makefile.am (stamps/extra-class-files.stamp): Fix -sourcepath. + 2010-10-20 Omair Majid * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java diff -r 257297223569 -r 3b526d8b7bb2 Makefile.am --- a/Makefile.am Wed Oct 20 10:04:25 2010 -0400 +++ b/Makefile.am Wed Oct 20 16:07:09 2010 +0200 @@ -287,7 +287,7 @@ stamps/extra-class-files.stamp: extra-so stamps/extra-class-files.stamp: extra-source-files.txt stamps/netx.stamp mkdir -p extra-lib $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) -d extra-lib \ - -sourcepath extra -cp netx.build \ + -sourcepath $(abs_top_srcdir)/extra -cp netx.build \ -bootclasspath $(RUNTIME) @extra-source-files.txt cp -r $(NETX_EXTRA_DIR) extra-lib/net/sourceforge/jnlp/about mkdir -p stamps From asu at icedtea.classpath.org Wed Oct 20 07:16:11 2010 From: asu at icedtea.classpath.org (asu at icedtea.classpath.org) Date: Wed, 20 Oct 2010 14:16:11 +0000 Subject: /hg/icedtea-web: Enabled parsing jnlp file located at jnlp_href ... Message-ID: changeset 5b479d60cadb in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=5b479d60cadb author: Andrew Su date: Wed Oct 20 10:17:46 2010 -0400 Enabled parsing jnlp file located at jnlp_href for applet parameters. diffstat: 2 files changed, 28 insertions(+) ChangeLog | 6 ++++++ netx/net/sourceforge/jnlp/PluginBridge.java | 22 ++++++++++++++++++++++ diffs (55 lines): diff -r 3b526d8b7bb2 -r 5b479d60cadb ChangeLog --- a/ChangeLog Wed Oct 20 16:07:09 2010 +0200 +++ b/ChangeLog Wed Oct 20 10:17:46 2010 -0400 @@ -1,3 +1,9 @@ 2010-10-20 Matthias Klose + + * PluginBridge.java: + (PluginBridge): Added parsing for jnlp_href, and reading the jnlp file + for applet parameters. + 2010-10-20 Matthias Klose * Makefile.am (stamps/extra-class-files.stamp): Fix -sourcepath. diff -r 3b526d8b7bb2 -r 5b479d60cadb netx/net/sourceforge/jnlp/PluginBridge.java --- a/netx/net/sourceforge/jnlp/PluginBridge.java Wed Oct 20 16:07:09 2010 +0200 +++ b/netx/net/sourceforge/jnlp/PluginBridge.java Wed Oct 20 10:17:46 2010 -0400 @@ -26,9 +26,11 @@ import java.net.MalformedURLException; import java.net.MalformedURLException; import java.util.Calendar; import java.util.Hashtable; +import java.util.Iterator; import java.util.Locale; import java.util.List; import java.util.ArrayList; +import java.util.Map; import net.sourceforge.jnlp.runtime.JNLPRuntime; @@ -50,6 +52,26 @@ public class PluginBridge extends JNLPFi fileVersion = new Version("1.1"); this.codeBase = codebase; this.sourceLocation = documentBase; + + if (atts.containsKey("jnlp_href")){ + try { + URL jnlp = new URL(codeBase.toExternalForm() + (String) atts.get("jnlp_href")); + JNLPFile jnlp_file = new JNLPFile(jnlp); + Map jnlp_params = jnlp_file.getApplet().getParameters(); + + // Change the parameter name to lowercase to follow conventions. + Iterator it = jnlp_params.keySet().iterator(); + while(it.hasNext()){ + String key = (String) it.next(); + atts.put(key.toLowerCase(), jnlp_params.get(key)); + } + } catch (MalformedURLException e) { + // Don't fail because we cannot get the jnlp file. Parameters are optional not required. + // it is the site developer who should ensure that file exist. + System.err.println("Unable to get JNLP file at: " + codeBase.toExternalForm() + + (String) atts.get("jnlp_href")); + } + } // also, see if cache_archive is specified if (atts.get("cache_archive") != null && ((String) atts.get("cache_archive")).length() > 0) { From asu at redhat.com Wed Oct 20 07:23:14 2010 From: asu at redhat.com (Andrew Su) Date: Wed, 20 Oct 2010 10:23:14 -0400 (EDT) Subject: [RFC] icedtea-web (netx): Allow applet to read jnlp file for parameters In-Reply-To: <20101020135522.GB8838@redhat.com> Message-ID: <973428632.1178111287584594168.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> ----- "Deepak Bhole" wrote: > From: "Deepak Bhole" > To: "Andrew Su" > Cc: "distro-pkg-dev" > Sent: Wednesday, October 20, 2010 9:55:22 AM GMT -05:00 US/Canada Eastern > Subject: Re: [RFC] icedtea-web (netx): Allow applet to read jnlp file for parameters > > * Andrew Su [2010-10-20 09:51]: > > And here is the patch :) > > > > > > ----- "Andrew Su" wrote: > > > > > From: "Andrew Su" > > > To: "distro-pkg-dev" > > > Sent: Wednesday, October 20, 2010 9:49:51 AM GMT -05:00 US/Canada > Eastern > > > Subject: [RFC] icedtea-web (netx): Allow applet to read jnlp file > for parameters > > > > > > Hi, > > > > > > This patch lets the applet read parameters stored in a jnlp file > > > pointed to by the parameter "jnlp_href". Currently, when the > applet > > > loads given the parameter jnlp_href will not read the file, > jnlp_file > > > will be like any normal parameter passed in to an applet. > > > > > > I originally planned on placing it inside parse of > PluginAppletViewer, > > > but later decided that jnlp stuff should go back into netx. Thanks > to > > > Omair's patch which gave me the idea to place it inside > PluginBridge > > > (in netx). > > > > > > Comments? Questions? Concerns? > > > > > Just a couple of minor things.. > > > > Cheers, > > > --Andrew > > > diff -r 01c094e27afd netx/net/sourceforge/jnlp/PluginBridge.java > > --- a/netx/net/sourceforge/jnlp/PluginBridge.java Wed Oct 13 > 01:31:53 2010 +0100 > > +++ b/netx/net/sourceforge/jnlp/PluginBridge.java Wed Oct 20 > 09:20:26 2010 -0400 > > @@ -26,9 +26,11 @@ > > import java.net.MalformedURLException; > > import java.util.Calendar; > > import java.util.Hashtable; > > +import java.util.Iterator; > > import java.util.Locale; > > import java.util.List; > > import java.util.ArrayList; > > +import java.util.Map; > > > > import net.sourceforge.jnlp.runtime.JNLPRuntime; > > > > @@ -50,6 +52,29 @@ > > fileVersion = new Version("1.1"); > > this.codeBase = codebase; > > this.sourceLocation = documentBase; > > + > > + if (atts.containsKey("jnlp_href")){ > > + try { > > + URL jnlp = new URL(codeBase.toExternalForm() + > (String) atts.get("jnlp_href")); > > + JNLPFile jnlp_file = new JNLPFile(jnlp); > > + Map jnlp_params = > jnlp_file.getApplet().getParameters(); > > + > > + // Change the parameter name to lowercase to follow > conventions. > > + Iterator it = jnlp_params.keySet().iterator(); > > + while(it.hasNext()){ > > + String key = (String) it.next(); > > + atts.put(key.toLowerCase(), > jnlp_params.get(key)); > > + } > > + } catch (MalformedURLException e) { > > + // Don't fail because we cannot get the jnlp file. > Parameters are optional not required. > > + // it is the site developer who should ensure that > file exist. > > + System.out.println("Unable to get JNLP file at: " + > codeBase.toExternalForm() > > + + (String) atts.get("jnlp_href")); > > Should be printed to err not out since it is an error message > > > + } catch (Exception e) { > > + // Something went horribly wrong. (Or malformed > file) > > + throw new RuntimeException("Unable to read JNLP > file"); > > + } > > + } > > > > The second catch block is not needed. Infact throwing a > RuntimeException > there will swallow the original cause and stack. Just the first catch > for MalformedURLException is enough. > > After the above changes ok for commit to icedtea-web head. > Fixed. Thanks, Andrew > Cheers, > Deepak > > > // also, see if cache_archive is specified > > if (atts.get("cache_archive") != null && ((String) > atts.get("cache_archive")).length() > 0) { From doko at icedtea.classpath.org Wed Oct 20 09:11:00 2010 From: doko at icedtea.classpath.org (doko at icedtea.classpath.org) Date: Wed, 20 Oct 2010 16:11:00 +0000 Subject: /hg/icedtea-web: 2010-10-20 Matthias Klose Message-ID: changeset cc9fbbbe8865 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=cc9fbbbe8865 author: doko at ubuntu.com date: Wed Oct 20 18:07:07 2010 +0200 2010-10-20 Matthias Klose * AUTHORS: Add myself. diffstat: 2 files changed, 5 insertions(+) AUTHORS | 1 + ChangeLog | 4 ++++ diffs (22 lines): diff -r 5b479d60cadb -r cc9fbbbe8865 AUTHORS --- a/AUTHORS Wed Oct 20 10:17:46 2010 -0400 +++ b/AUTHORS Wed Oct 20 18:07:07 2010 +0200 @@ -5,6 +5,7 @@ Deepak Bhole Deepak Bhole Thomas Fitzsimmons Andrew John Hughes +Matthias Klose Omair Majid This project also includes code from the following projects: diff -r 5b479d60cadb -r cc9fbbbe8865 ChangeLog --- a/ChangeLog Wed Oct 20 10:17:46 2010 -0400 +++ b/ChangeLog Wed Oct 20 18:07:07 2010 +0200 @@ -1,3 +1,7 @@ 2010-10-20 Andrew Su +2010-10-20 Matthias Klose + + * AUTHORS: Add myself. + 2010-10-20 Andrew Su * PluginBridge.java: From andrew at icedtea.classpath.org Wed Oct 20 10:38:48 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Wed, 20 Oct 2010 17:38:48 +0000 Subject: /hg/icedtea-web: Add jni_md.h (missing from previous commit). Message-ID: changeset 84f659329cfb in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=84f659329cfb author: Deepak Bhole date: Wed Oct 20 18:38:37 2010 +0100 Add jni_md.h (missing from previous commit). diffstat: 1 file changed, 42 insertions(+) launcher/jni_md.h | 42 ++++++++++++++++++++++++++++++++++++++++++ diffs (46 lines): diff -r cc9fbbbe8865 -r 84f659329cfb launcher/jni_md.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/launcher/jni_md.h Wed Oct 20 18:38:37 2010 +0100 @@ -0,0 +1,42 @@ +/* + * Copyright (c) 1996, 2000, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef _JAVASOFT_JNI_MD_H_ +#define _JAVASOFT_JNI_MD_H_ + +#define JNIEXPORT +#define JNIIMPORT +#define JNICALL + +typedef int jint; +#ifdef _LP64 /* 64-bit Solaris */ +typedef long jlong; +#else +typedef long long jlong; +#endif + +typedef signed char jbyte; + +#endif /* !_JAVASOFT_JNI_MD_H_ */ From omajid at redhat.com Wed Oct 20 11:09:34 2010 From: omajid at redhat.com (Omair Majid) Date: Wed, 20 Oct 2010 14:09:34 -0400 Subject: [RFC] netx: show security dialogs in a separate AppContext In-Reply-To: <20101019223835.GF28452@redhat.com> References: <4CBDC2BF.5010605@redhat.com> <20101019223835.GF28452@redhat.com> Message-ID: <4CBF305E.7050906@redhat.com> Hi, On 10/19/2010 06:38 PM, Deepak Bhole wrote: > * Omair Majid [2010-10-19 12:10]: >> Hi, >> >> The attached patch makes security prompts appear in a separate >> AppContext. This ensures that the applet's look and feel is not >> automatically set to the system look and feel. >> >> The patch is a superset of http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-October/010500.html >> >> This patch also implements a large part of the code necessary to >> allow applets to access their EventQueues. However, I still have to >> figure out how to use >> http://hg.openjdk.java.net/jdk7/awt/jdk/rev/8022709a306d to ensure >> allowing access to the EventQueue is safe. So for now, that code is >> disabled. >> >> The patch ensures that the JNLPRuntime is always initialized in the >> main AppContext. It starts a thread in this AppContext to listen for >> security dialog messages, and shows security dialogs when it >> receives an appropriate security message. The security dialogs block >> the client applet/application until the user responds. >> >> Any thoughts or comments? >> > > Hi, > > Please see comments below. > Thanks for the review and the comments. Updated patch attached. > Cheers, > Deepak > >> Thanks, >> Omair > >> diff -r afdd3f284524 netx/net/sourceforge/jnlp/NetxPanel.java >> --- a/netx/net/sourceforge/jnlp/NetxPanel.java Mon Oct 18 21:29:09 2010 +0100 >> +++ b/netx/net/sourceforge/jnlp/NetxPanel.java Tue Oct 19 12:07:40 2010 -0400 >> @@ -83,19 +83,6 @@ >> getHeight(), >> atts); >> >> - synchronized(JNLPRuntime.initMutex) { >> - //The custom NetX Policy and SecurityManager are set here. >> - if (!JNLPRuntime.isInitialized()) { >> - if (JNLPRuntime.isDebug()) >> - System.out.println("initializing JNLPRuntime..."); >> - >> - JNLPRuntime.initialize(false); >> - } else { >> - if (JNLPRuntime.isDebug()) >> - System.out.println("JNLPRuntime already initialized"); >> - } >> - } >> - >> doInit = true; >> dispatchAppletEvent(APPLET_LOADING, null); >> status = APPLET_LOAD; >> @@ -145,6 +132,19 @@ >> */ >> // Reminder: Relax visibility in sun.applet.AppletPanel >> protected synchronized void createAppletThread() { >> + synchronized(JNLPRuntime.initMutex) { >> + //The custom NetX Policy and SecurityManager are set here. >> + if (!JNLPRuntime.isInitialized()) { >> + if (JNLPRuntime.isDebug()) >> + System.out.println("initializing JNLPRuntime..."); >> + >> + JNLPRuntime.initialize(false); >> + } else { >> + if (JNLPRuntime.isDebug()) >> + System.out.println("JNLPRuntime already initialized"); >> + } >> + } >> + >> // when this was being done (incorrectly) in Launcher, the call was >> // new AppThreadGroup(mainGroup, file.getTitle()); >> ThreadGroup tg = new AppThreadGroup(Launcher.mainGroup, >> diff -r afdd3f284524 netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java >> --- a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Mon Oct 18 21:29:09 2010 +0100 >> +++ b/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Tue Oct 19 12:07:40 2010 -0400 >> @@ -35,7 +35,7 @@ >> import net.sourceforge.jnlp.ShortcutDesc; >> import net.sourceforge.jnlp.event.ApplicationEvent; >> import net.sourceforge.jnlp.event.ApplicationListener; >> -import net.sourceforge.jnlp.security.SecurityWarningDialog.AccessType; >> +import net.sourceforge.jnlp.security.AccessType; >> import net.sourceforge.jnlp.services.ServiceUtil; >> import net.sourceforge.jnlp.util.WeakList; >> import net.sourceforge.jnlp.util.XDesktopEntry; >> diff -r afdd3f284524 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java >> --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Mon Oct 18 21:29:09 2010 +0100 >> +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Tue Oct 19 12:07:40 2010 -0400 >> @@ -57,7 +57,8 @@ >> import net.sourceforge.jnlp.cache.CacheUtil; >> import net.sourceforge.jnlp.cache.ResourceTracker; >> import net.sourceforge.jnlp.cache.UpdatePolicy; >> -import net.sourceforge.jnlp.security.SecurityWarningDialog; >> +import net.sourceforge.jnlp.security.SecurityWarning; >> +import net.sourceforge.jnlp.security.AccessType; >> import net.sourceforge.jnlp.tools.JarSigner; >> import sun.misc.JarIndex; >> >> @@ -254,7 +255,7 @@ >> >> if (extLoader != null&& extLoader != loader) { >> if (loader.signing&& !extLoader.signing) >> - if (!SecurityWarningDialog.showNotAllSignedWarningDialog(file)) >> + if (!SecurityWarning.showNotAllSignedWarningDialog(file)) >> throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LSignedAppJarUsingUnsignedJar"), R("LSignedAppJarUsingUnsignedJarInfo")); >> >> loader.merge(extLoader); >> @@ -401,7 +402,7 @@ >> signing = true; >> >> if (!js.allJarsSigned()&& >> - !SecurityWarningDialog.showNotAllSignedWarningDialog(file)) >> + !SecurityWarning.showNotAllSignedWarningDialog(file)) >> throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LSignedAppJarUsingUnsignedJar"), R("LSignedAppJarUsingUnsignedJarInfo")); >> >> >> @@ -455,19 +456,19 @@ >> >> private void checkTrustWithUser(JarSigner js) throws LaunchException { >> if (!js.getRootInCacerts()) { //root cert is not in cacerts >> - boolean b = SecurityWarningDialog.showCertWarningDialog( >> - SecurityWarningDialog.AccessType.UNVERIFIED, file, js); >> + boolean b = SecurityWarning.showCertWarningDialog( >> + AccessType.UNVERIFIED, file, js); >> if (!b) >> throw new LaunchException(null, null, R("LSFatal"), >> R("LCLaunching"), R("LNotVerified"), ""); >> } else if (js.getRootInCacerts()) { //root cert is in cacerts >> boolean b = false; >> if (js.noSigningIssues()) >> - b = SecurityWarningDialog.showCertWarningDialog( >> - SecurityWarningDialog.AccessType.VERIFIED, file, js); >> + b = SecurityWarning.showCertWarningDialog( >> + AccessType.VERIFIED, file, js); >> else if (!js.noSigningIssues()) >> - b = SecurityWarningDialog.showCertWarningDialog( >> - SecurityWarningDialog.AccessType.SIGNING_ERROR, file, js); >> + b = SecurityWarning.showCertWarningDialog( >> + AccessType.SIGNING_ERROR, file, js); >> if (!b) >> throw new LaunchException(null, null, R("LSFatal"), >> R("LCLaunching"), R("LCancelOnUserRequest"), ""); >> diff -r afdd3f284524 netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java >> --- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Mon Oct 18 21:29:09 2010 +0100 >> +++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Tue Oct 19 12:07:40 2010 -0400 >> @@ -25,9 +25,11 @@ >> import java.util.List; >> import java.security.*; >> import javax.jnlp.*; >> +import javax.swing.UIManager; >> >> import net.sourceforge.jnlp.*; >> import net.sourceforge.jnlp.cache.*; >> +import net.sourceforge.jnlp.security.SecurityDialogMessageHandler; >> import net.sourceforge.jnlp.services.*; >> import net.sourceforge.jnlp.util.*; >> >> @@ -63,6 +65,9 @@ >> /** the security policy */ >> private static JNLPPolicy policy; >> >> + /** handles all security message to show appropriate security dialogs */ >> + private static SecurityDialogMessageHandler securityDialogMessageHandler; >> + >> /** the base dir for cache, etc */ >> private static File baseDir; >> >> @@ -165,6 +170,8 @@ >> * security manager and security policy, initializing the JNLP >> * standard services, etc.

>> * >> + * This method should be called from the main AppContext/Thread.

>> + * >> * This method cannot be called more than once. Once >> * initialized, methods that alter the runtime can only be >> * called by the exit class.

>> @@ -206,15 +213,39 @@ >> policy = new JNLPPolicy(); >> security = new JNLPSecurityManager(); // side effect: create JWindow >> >> + try { >> + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); >> + } catch (Exception e) { >> + // ignore it >> + } >> + >> if (securityEnabled) { >> Policy.setPolicy(policy); // do first b/c our SM blocks setPolicy >> System.setSecurityManager(security); >> } >> >> + securityDialogMessageHandler = startSecurityThreads(); >> + >> initialized = true; >> } >> >> /** >> + * This must NOT be called form the application ThreadGroup. An application >> + * can inject events into its {@link EventQueue} and bypass the security >> + * dialogs. >> + * >> + * @return a {@link SecurityDialogMessageHandler} that can be used to post >> + * security messages >> + */ >> + private static SecurityDialogMessageHandler startSecurityThreads() { >> + ThreadGroup securityThreadGroup = new ThreadGroup("NetxSecurityThreadGroup"); >> + SecurityDialogMessageHandler runner = new SecurityDialogMessageHandler(); >> + Thread securityThread = new Thread(securityThreadGroup, runner, "NetxSecurityThread"); >> + securityThread.start(); >> + return runner; >> + } >> + >> + /** >> * Returns true if a webstart application has been initialized, and false >> * for a plugin applet. >> */ >> @@ -321,6 +352,20 @@ >> } >> >> /** >> + * >> + * @return the {@link SecurityDialogMessageHandler} that should be used to >> + * post security dialog messages >> + */ >> + public static SecurityDialogMessageHandler getSecurityDialogHandler() { >> + SecurityManager sm = System.getSecurityManager(); >> + if (sm != null) { >> + // TODO might want to reduce the permission required >> + sm.checkPermission(new AllPermission()); >> + } >> + return securityDialogMessageHandler; >> + } >> + > > No need for the TODO there. The code should be fully trusted. The only > partially trusted code here would be jnlp apps with j2ee permissions and > what not, and those should not have access to the dialog. > Sure. Fixed. >> + /** >> * Returns the system default base dir for or if not set, >> * prompts the user for the location. >> * >> diff -r afdd3f284524 netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java >> --- a/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java Mon Oct 18 21:29:09 2010 +0100 >> +++ b/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java Tue Oct 19 12:07:40 2010 -0400 >> @@ -34,7 +34,7 @@ >> import javax.swing.JWindow; >> >> import net.sourceforge.jnlp.JNLPFile; >> -import net.sourceforge.jnlp.security.SecurityWarningDialog; >> +import net.sourceforge.jnlp.security.AccessType; >> import net.sourceforge.jnlp.services.ServiceUtil; >> import net.sourceforge.jnlp.util.WeakList; >> import sun.awt.AWTSecurityManager; >> @@ -392,7 +392,7 @@ >> ApplicationInstance app = getApplication(); >> if (app != null&& !app.isSigned()) { >> if (perm instanceof SocketPermission >> -&& ServiceUtil.checkAccess(SecurityWarningDialog.AccessType.NETWORK, perm.getName())) { >> +&& ServiceUtil.checkAccess(AccessType.NETWORK, perm.getName())) { >> return true; >> } >> } >> @@ -434,7 +434,7 @@ >> Window w = (Window) window; >> >> if (JNLPRuntime.isDebug()) >> - System.err.println("SM: app: "+app.getTitle()+" is adding a window: "+window); >> + System.err.println("SM: app: "+app.getTitle()+" is adding a window: "+window+" with appContext"+AppContext.getAppContext()); > > Just a minor nitpick .. there should be a space between appContext and > the ending quotation mark. > Fixed. >> >> weakWindows.add(window); // for mapping window -> app >> weakApplications.add(app); >> @@ -538,4 +538,31 @@ >> >> } >> >> + /** >> + * Tests if a client can get access to the AWT event queue. This version allows >> + * complete access to the EventQueue for its own AppContext-specific EventQueue. >> + * >> + * FIXME there are probably huge security implications for this. Eg: >> + * http://hg.openjdk.java.net/jdk7/awt/jdk/rev/8022709a306d >> + * >> + * @exception SecurityException if the caller does not have >> + * permission to accesss the AWT event queue. >> + */ >> + public void checkAwtEventQueueAccess() { >> + /* >> + * this is the templace of the code that should allow applets access to >> + * eventqueues >> + */ >> + >> + // AppContext appContext = AppContext.getAppContext(); >> + // ApplicationInstance instance = getApplication(); >> + >> + // if ((appContext == mainAppContext)&& (instance != null)) { >> + // If we're about to allow access to the main EventQueue, >> + // and anything untrusted is on the class context stack, >> + // disallow access. >> + super.checkAwtEventQueueAccess(); >> + // } >> + } >> + > > As per your original email, I assume this is the part where access is > completely disabled for now. > Yup. checkAwtEventQueueAccess() is called by Toolkit.getSystemEventQueue() to allow or disallow access to the Awt/Swing EventQueue. The current implementation delegates to SecurityManager, which checks if the calling code has CHECK_AWT_EVENTQUEUE_PERMISSION. Uncommenting the code would allow applets/applications to access their own EventQueue. Accessing the EventQueue associated with the main AppContext (which shows the security dialogs) still delegates to parent. >> } >> diff -r afdd3f284524 netx/net/sourceforge/jnlp/security/AccessType.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/netx/net/sourceforge/jnlp/security/AccessType.java Tue Oct 19 12:07:40 2010 -0400 >> @@ -0,0 +1,53 @@ >> +/* AccessType.java >> + Copyright (C) 2010 Red Hat, Inc. >> + >> +This file is part of IcedTea. >> + >> +IcedTea is free software; you can redistribute it and/or >> +modify it under the terms of the GNU General Public License as published by >> +the Free Software Foundation, version 2. >> + >> +IcedTea is distributed in the hope that it will be useful, >> +but WITHOUT ANY WARRANTY; without even the implied warranty of >> +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >> +General Public License for more details. >> + >> +You should have received a copy of the GNU General Public License >> +along with IcedTea; see the file COPYING. If not, write to >> +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA >> +02110-1301 USA. >> + >> +Linking this library statically or dynamically with other modules is >> +making a combined work based on this library. Thus, the terms and >> +conditions of the GNU General Public License cover the whole >> +combination. >> + >> +As a special exception, the copyright holders of this library give you >> +permission to link this library with independent modules to produce an >> +executable, regardless of the license terms of these independent >> +modules, and to copy and distribute the resulting executable under >> +terms of your choice, provided that you also meet, for each linked >> +independent module, the terms and conditions of the license of that >> +module. An independent module is a module which is not derived from >> +or based on this library. If you modify this library, you may extend >> +this exception to your version of the library, but you are not >> +obligated to do so. If you do not wish to do so, delete this >> +exception statement from your version. >> +*/ >> + >> +package net.sourceforge.jnlp.security; >> + >> +/** The types of access which may need user permission. */ >> +public enum AccessType { >> + READ_FILE, >> + WRITE_FILE, >> + CREATE_DESTKOP_SHORTCUT, >> + CLIPBOARD_READ, >> + CLIPBOARD_WRITE, >> + PRINTER, >> + NETWORK, >> + VERIFIED, >> + UNVERIFIED, >> + NOTALLSIGNED, >> + SIGNING_ERROR >> +} > > Is there a reason this enum needs its own class? I understand the need > to need to remove it out of SecurityWarningDialog.. perhaps it should > reside in the new SecurityWarning class? > I just wasnt sure where to place it. I have moved it to SecurityWarning as you suggested. >> diff -r afdd3f284524 netx/net/sourceforge/jnlp/security/AccessWarningPane.java >> --- a/netx/net/sourceforge/jnlp/security/AccessWarningPane.java Mon Oct 18 21:29:09 2010 +0100 >> +++ b/netx/net/sourceforge/jnlp/security/AccessWarningPane.java Tue Oct 19 12:07:40 2010 -0400 >> @@ -56,6 +56,7 @@ >> import javax.swing.SwingConstants; >> >> import net.sourceforge.jnlp.JNLPFile; >> +import net.sourceforge.jnlp.security.AccessType; >> import net.sourceforge.jnlp.util.FileUtils; >> >> /** >> @@ -86,7 +87,7 @@ >> * Creates the actual GUI components, and adds it to this panel >> */ >> private void addComponents() { >> - SecurityWarningDialog.AccessType type = parent.getAccessType(); >> + AccessType type = parent.getAccessType(); >> JNLPFile file = parent.getFile(); >> >> String name = ""; >> diff -r afdd3f284524 netx/net/sourceforge/jnlp/security/CertWarningPane.java >> --- a/netx/net/sourceforge/jnlp/security/CertWarningPane.java Mon Oct 18 21:29:09 2010 +0100 >> +++ b/netx/net/sourceforge/jnlp/security/CertWarningPane.java Tue Oct 19 12:07:40 2010 -0400 >> @@ -60,6 +60,7 @@ >> import net.sourceforge.jnlp.JNLPFile; >> import net.sourceforge.jnlp.PluginBridge; >> import net.sourceforge.jnlp.runtime.JNLPRuntime; >> +import net.sourceforge.jnlp.security.AccessType; >> import net.sourceforge.jnlp.tools.KeyTool; >> >> /** >> @@ -85,7 +86,7 @@ >> * Creates the actual GUI components, and adds it to this panel >> */ >> private void addComponents() { >> - SecurityWarningDialog.AccessType type = parent.getAccessType(); >> + AccessType type = parent.getAccessType(); >> JNLPFile file = parent.getFile(); >> Certificate c = parent.getJarSigner().getPublisher(); >> >> diff -r afdd3f284524 netx/net/sourceforge/jnlp/security/SecurityDialogMessage.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/netx/net/sourceforge/jnlp/security/SecurityDialogMessage.java Tue Oct 19 12:07:40 2010 -0400 >> @@ -0,0 +1,40 @@ >> +package net.sourceforge.jnlp.security; >> + >> +import java.security.cert.X509Certificate; >> +import java.util.concurrent.Semaphore; >> + >> +import javax.swing.JDialog; >> + >> +import net.sourceforge.jnlp.JNLPFile; >> +import net.sourceforge.jnlp.security.AccessType; >> +import net.sourceforge.jnlp.security.SecurityWarning.DialogType; >> + >> +/** >> + * Represents a message to the security framework to show a specific security >> + * dialog >> + */ >> +final class SecurityDialogMessage { >> + >> + /* >> + * These fields contain information need to display the correct dialog type >> + */ >> + >> + public DialogType dialogType; >> + public AccessType accessType; >> + public JNLPFile file; >> + public CertVerifier certVerifier; >> + public X509Certificate certificate; >> + public Object[] extras; >> + >> + public volatile Object userResponse; >> + > > Why is userResponse volatile? Based on the patch, for a given instance, > only one thread (either the even dispatcher when action is performed OR > another caller thread when locking throws an interruptedexception) > modifies the value... or am I missing something? > I apologise in advance if my knowledge of concurrency is a little off, but we need to ensure that setting the values on the message object happen-before reading it. Yes, only one thread can change it, but the change needs to propogate to the other thread. The lock ensures that this happens in the non EventDispatchThread case. In the case of the EventDispatchThread, one thread sets the value and the other reads it. The volatile ensures that changes to userReponse are visible to the client thread. Perhaps I am wrong; I can make it non-volatile if you want me to. >> + /* >> + * These two fields are used to block/unblock the application or the applet. >> + * If either of them is not null, call release() or dispose() on it to allow >> + * the application/applet to continue. >> + */ >> + >> + public Semaphore lock; >> + public JDialog toDispose; >> + >> +} >> \ No newline at end of file >> diff -r afdd3f284524 netx/net/sourceforge/jnlp/security/SecurityDialogMessageHandler.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/netx/net/sourceforge/jnlp/security/SecurityDialogMessageHandler.java Tue Oct 19 12:07:40 2010 -0400 >> @@ -0,0 +1,68 @@ >> +package net.sourceforge.jnlp.security; >> + >> +import java.awt.event.ActionEvent; >> +import java.awt.event.ActionListener; >> +import java.util.concurrent.BlockingQueue; >> +import java.util.concurrent.LinkedBlockingQueue; >> + >> +import net.sourceforge.jnlp.runtime.JNLPRuntime; >> + >> +/** >> + * Handles {@link SecurityDialogMessage}s and shows appropriate security dialogs >> + */ >> +public final class SecurityDialogMessageHandler implements Runnable { >> + >> + private BlockingQueue queue = new LinkedBlockingQueue(); >> + >> + @Override >> + public void run() { >> + try { >> + if (JNLPRuntime.isDebug()) { >> + System.out.println("Starting security dialog thread"); >> + } >> + while (true) { >> + SecurityDialogMessage msg = queue.take(); >> + handleMessage(msg); >> + } >> + } catch (InterruptedException e) { >> + if (JNLPRuntime.isDebug()) { >> + System.out.println("Shutting down security event thread"); >> + } >> + return; >> + } >> + >> + } >> + > > If a misbehaving trusted app does an interruptall, the above would run > into problems. > Ah, good catch. I have modified to the code to simply continue if Interrupted. >> + private void handleMessage(SecurityDialogMessage message) { >> + final SecurityDialogMessage msg = message; >> + >> + final SecurityWarningDialog dialog = new SecurityWarningDialog(message.dialogType, >> + message.accessType, message.file, message.certVerifier, message.certificate, message.extras); >> + >> + dialog.addActionListener(new ActionListener() { >> + >> + @Override >> + public void actionPerformed(ActionEvent e) { >> + msg.userResponse = dialog.getValue(); >> + /* Allow the client to continue on the other side */ >> + if (msg.toDispose != null) { >> + msg.toDispose.dispose(); >> + } >> + if (msg.lock != null) { >> + msg.lock.release(); >> + } >> + } >> + }); >> + dialog.setVisible(true); >> + >> + } >> + >> + public void postMessage(SecurityDialogMessage message) { >> + try { >> + queue.put(message); >> + } catch (InterruptedException e) { >> + e.printStackTrace(); >> + } >> + } >> + >> +} > > There are almost no comments in the above file. Can you please add some, > stating what those functions are doing? > Done. >> diff -r afdd3f284524 netx/net/sourceforge/jnlp/security/SecurityWarning.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/netx/net/sourceforge/jnlp/security/SecurityWarning.java Tue Oct 19 12:07:40 2010 -0400 >> @@ -0,0 +1,278 @@ >> +/* SecurityWarningDialogFactory.java >> + Copyright (C) 2010 Red Hat, Inc. >> + >> +This file is part of IcedTea. >> + >> +IcedTea is free software; you can redistribute it and/or >> +modify it under the terms of the GNU General Public License as published by >> +the Free Software Foundation, version 2. >> + >> +IcedTea is distributed in the hope that it will be useful, >> +but WITHOUT ANY WARRANTY; without even the implied warranty of >> +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >> +General Public License for more details. >> + >> +You should have received a copy of the GNU General Public License >> +along with IcedTea; see the file COPYING. If not, write to >> +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA >> +02110-1301 USA. >> + >> +Linking this library statically or dynamically with other modules is >> +making a combined work based on this library. Thus, the terms and >> +conditions of the GNU General Public License cover the whole >> +combination. >> + >> +As a special exception, the copyright holders of this library give you >> +permission to link this library with independent modules to produce an >> +executable, regardless of the license terms of these independent >> +modules, and to copy and distribute the resulting executable under >> +terms of your choice, provided that you also meet, for each linked >> +independent module, the terms and conditions of the license of that >> +module. An independent module is a module which is not derived from >> +or based on this library. If you modify this library, you may extend >> +this exception to your version of the library, but you are not >> +obligated to do so. If you do not wish to do so, delete this >> +exception statement from your version. >> +*/ >> + >> + >> +package net.sourceforge.jnlp.security; >> + >> +import java.awt.Dialog.ModalityType; >> +import java.awt.event.WindowAdapter; >> +import java.awt.event.WindowEvent; >> +import java.security.AccessController; >> +import java.security.PrivilegedAction; >> +import java.util.concurrent.Semaphore; >> + >> +import javax.swing.JDialog; >> +import javax.swing.SwingUtilities; >> + >> +import net.sourceforge.jnlp.JNLPFile; >> +import net.sourceforge.jnlp.runtime.JNLPRuntime; >> + >> +/** >> + * A factory for showing many possible types of security warning to the user.

>> + * >> + * This contains all the public methods that classes outside this package should >> + * use instead of using {@link SecurityWarningDialog} directly. >> + * >> + * All of these methods post a message to the >> + * {@link SecurityDialogMessageHandler} and block waiting for a response. >> + */ >> +public class SecurityWarning { >> + /** Types of dialogs we can create */ >> + public static enum DialogType { >> + CERT_WARNING, >> + MORE_INFO, >> + CERT_INFO, >> + SINGLE_CERT_INFO, >> + ACCESS_WARNING, >> + NOTALLSIGNED_WARNING, >> + APPLET_WARNING >> + } >> + >> + /** >> + * Shows a warning dialog for different types of system access (i.e. file >> + * open/save, clipboard read/write, printing, etc). >> + * >> + * @param accessType the type of system access requested. >> + * @param file the jnlp file associated with the requesting application. >> + * @return true if permission was granted by the user, false otherwise. >> + */ >> + public static boolean showAccessWarningDialog(AccessType accessType, JNLPFile file) { >> + return showAccessWarningDialog(accessType, file, null); >> + } >> + >> + /** >> + * Shows a warning dialog for different types of system access (i.e. file >> + * open/save, clipboard read/write, printing, etc). >> + * >> + * @param accessType the type of system access requested. >> + * @param file the jnlp file associated with the requesting application. >> + * @param extras an optional array of Strings (typically) that gets >> + * passed to the dialog labels. >> + * @return true if permission was granted by the user, false otherwise. >> + */ >> + public static boolean showAccessWarningDialog(final AccessType accessType, >> + final JNLPFile file, final Object[] extras) { >> + final SecurityDialogMessage message = new SecurityDialogMessage(); >> + >> + message.dialogType = DialogType.ACCESS_WARNING; >> + message.accessType = accessType; >> + message.file = file; >> + message.extras = extras; >> + >> + Object selectedValue = getUserResponse(message); >> + >> + if (selectedValue == null) { >> + return false; >> + } else if (selectedValue instanceof Integer) { >> + if (((Integer) selectedValue).intValue() == 0) >> + return true; >> + else >> + return false; >> + } else { >> + return false; >> + } >> + } >> + >> + /** >> + * Shows a warning dialog for when the main application jars are signed, >> + * but extensions aren't >> + * >> + * @return true if permission was granted by the user, false otherwise. >> + */ >> + public static boolean showNotAllSignedWarningDialog(JNLPFile file) { >> + >> + final SecurityDialogMessage message = new SecurityDialogMessage(); >> + message.dialogType = DialogType.NOTALLSIGNED_WARNING; >> + message.accessType = AccessType.NOTALLSIGNED; >> + message.file = file; >> + message.extras = new Object[0]; >> + >> + Object selectedValue = getUserResponse(message); >> + >> + if (selectedValue == null) { >> + return false; >> + } else if (selectedValue instanceof Integer) { >> + if (((Integer)selectedValue).intValue() == 0) { >> + return true; >> + } else { >> + return false; >> + } >> + } else { >> + return false; >> + } >> + } >> + >> + /** >> + * Shows a security warning dialog according to the specified type of >> + * access. Iftype is one of AccessType.VERIFIED or >> + * AccessType.UNVERIFIED, extra details will be available with regards >> + * to code signing and signing certificates. >> + * >> + * @param accessType the type of warning dialog to show >> + * @param file the JNLPFile associated with this warning >> + * @param jarSigner the JarSigner used to verify this application >> + */ >> + public static boolean showCertWarningDialog(AccessType accessType, >> + JNLPFile file, CertVerifier jarSigner) { >> + >> + final SecurityDialogMessage message = new SecurityDialogMessage(); >> + message.dialogType = DialogType.CERT_WARNING; >> + message.accessType = accessType; >> + message.file = file; >> + message.certVerifier = jarSigner; >> + >> + Object selectedValue = getUserResponse(message); >> + >> + if (selectedValue == null) { >> + return false; >> + } else if (selectedValue instanceof Integer) { >> + if (((Integer) selectedValue).intValue() == 0) >> + return true; >> + else >> + return false; >> + } else { >> + return false; >> + } >> + } >> + >> + /** >> + * FIXME This is unused. Remove it? >> + * @return (0, 1, 2) => (Yes, No, Cancel) >> + */ >> + public static int showAppletWarning() { >> + >> + SecurityDialogMessage message = new SecurityDialogMessage(); >> + message.dialogType = DialogType.APPLET_WARNING; >> + >> + Object selectedValue = getUserResponse(message); >> + >> + // result 0 = Yes, 1 = No, 2 = Cancel >> + if (selectedValue == null) { >> + return 2; >> + } else if (selectedValue instanceof Integer) { >> + return ((Integer) selectedValue).intValue(); >> + } else { >> + return 2; >> + } >> + } >> + >> + /** >> + * Posts the message to the SecurityThread and gets the response. Blocks >> + * until a response has been recieved. It's safe to call this from an >> + * EventDispatchThread. >> + * >> + * @param message the SecuritDialogMessage indicating what type of dialog to >> + * display >> + * @return The user's response. Can be null. The exact answer depends on the >> + * type of message, but generally an Integer corresponding to the value 0 >> + * indicates success/proceed, and everything else indicates failure >> + */ >> + private static Object getUserResponse(final SecurityDialogMessage message) { >> + /* >> + * Want to show a security warning, while blocking the client >> + * application. This would be easy except there is a bug in showing >> + * modal JDialogs in a different AppContext. The source EventQueue - >> + * that sends the message to the (destination) EventQueue which is >> + * supposed to actually show the dialog - must not block. If the source >> + * EventQueue blocks, the destination EventQueue stops responding. So we >> + * have a hack here to work around it. >> + */ >> + >> + /* >> + * If this is the event dispatch thread the use the hack >> + */ >> + if (SwingUtilities.isEventDispatchThread()) { >> + /* >> + * Create a tiny modal dialog (which creates a new EventQueue for >> + * this AppContext, but blocks the original client EventQueue) and >> + * then post the message - this makes the source EventQueue continue >> + * running - but dot not allow the actual applet/application to >> + * continue processing >> + */ >> + final JDialog fakeDialog = new JDialog(); >> + fakeDialog.setSize(0, 0); >> + fakeDialog.setResizable(false); >> + fakeDialog.setModalityType(ModalityType.APPLICATION_MODAL); >> + fakeDialog.addWindowListener(new WindowAdapter() { >> + >> + @Override >> + public void windowOpened(WindowEvent e) { >> + message.toDispose = fakeDialog; >> + message.lock = null; >> + AccessController.doPrivileged(new PrivilegedAction() { >> + @Override >> + public Void run() { >> + JNLPRuntime.getSecurityDialogHandler().postMessage(message); >> + return null; >> + } >> + }); >> + } >> + }); >> + >> + /* this dialog will be disposed/hidden when the user closes the security prompt */ >> + fakeDialog.setVisible(true); >> + } else { >> + /* >> + * Otherwise do it the normal way. Post a message to the security >> + * thread to make it show the security dialog. Wait until it tells us >> + * to proceed. >> + */ >> + message.toDispose = null; >> + message.lock = new Semaphore(0); >> + JNLPRuntime.getSecurityDialogHandler().postMessage(message); >> + >> + try { >> + message.lock.acquire(); >> + } catch (InterruptedException e) { >> + message.userResponse = null; >> + } >> + } >> + >> + return message.userResponse; >> + } >> + >> +} > > See comment above. An interruptall would cause all subsequent warning > dialogs by other applets in the vm to return a null user response. > Fixed. It now waits in the loop until it gets a response. > Rest looks fine to me! > Thanks again for the review. -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-web-eventqueue-06.patch Type: text/x-patch Size: 55475 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101020/07385959/icedtea-web-eventqueue-06.patch From omajid at redhat.com Wed Oct 20 11:24:26 2010 From: omajid at redhat.com (Omair Majid) Date: Wed, 20 Oct 2010 14:24:26 -0400 Subject: Request to backport 6979979: Rounding error in font sizes selected by the GTK Look and Feel In-Reply-To: <4CBDEEF9.6030808@oracle.com> References: <4CBDD155.900@redhat.com> <20101019173816.GD3392@rivendell.middle-earth.co.uk> <4CBDDAD5.1010809@redhat.com> <4CBDEEF9.6030808@oracle.com> Message-ID: <4CBF33DA.2000009@redhat.com> On 10/19/2010 03:18 PM, Joe Darcy wrote: > Omair Majid wrote: >> On 10/19/2010 01:38 PM, Dr Andrew John Hughes wrote: >>> On 13:11 Tue 19 Oct , Omair Majid wrote: >>>> Hi, >>>> >>>> I would like to backport the following changeset to openjdk6: >>>> >>>> changeset: 2720:bb733c150f94 >>>> user: omajid >>>> date: Tue Sep 14 10:45:38 2010 -0400 >>>> summary: 6979979: Rounding error in font sizes selected by the GTK >>>> Look and Feel >>>> >>>> It selects a better font size the when Swing is using the >>>> GTKLookAndFeel. >>>> >>>> Thanks, >>>> Omair >>> >>> Is this backported in IcedTea6? >> >> As far as I am aware, no. I am going to add this to IcedTea6 if the >> openjdk6 devs are ok with adding it to openjdk6. >> >> Cheers, >> Omair > > Hello Omair. > > Approved to be backported to OpenJDK 6 b21 (the current build). > > Thanks, > > -Joe Thanks for the approval. Unfortunately, the patch does not apply straight-away. There was some refactoring in FontManager and FontUtilies - the patch requires changing the class from FontUtilites to FontManager. The webrev: http://cr.openjdk.java.net/~omajid/webrevs/gtk-floating-point-font-size-support-jdk6/webrev.00/ is identical to the original webrev for the fix: http://cr.openjdk.java.net/~omajid/webrevs/gtk-floating-point-font-size-support/webrev.01/ with the exception of the FontUtilties -> FontManager rename. Can I still go ahead and backport? Thanks, Omair From joe.darcy at oracle.com Wed Oct 20 11:42:57 2010 From: joe.darcy at oracle.com (Joe Darcy) Date: Wed, 20 Oct 2010 11:42:57 -0700 Subject: Request to backport 6979979: Rounding error in font sizes selected by the GTK Look and Feel In-Reply-To: <4CBF36E7.6040103@oracle.com> References: <4CBDD155.900@redhat.com> <20101019173816.GD3392@rivendell.middle-earth.co.uk> <4CBDDAD5.1010809@redhat.com> <4CBDEEF9.6030808@oracle.com> <4CBF33DA.2000009@redhat.com> <4CBF36E7.6040103@oracle.com> Message-ID: <4CBF3831.9@oracle.com> Phil Race wrote: > That's an inconsequential difference, so I can't think of any reason > why not .. the change looks fine to me Then still approved to go back! Thanks, -Joe > > -phil. > > On 10/20/2010 11:24 AM, Omair Majid wrote: >> On 10/19/2010 03:18 PM, Joe Darcy wrote: >>> Omair Majid wrote: >>>> On 10/19/2010 01:38 PM, Dr Andrew John Hughes wrote: >>>>> On 13:11 Tue 19 Oct , Omair Majid wrote: >>>>>> Hi, >>>>>> >>>>>> I would like to backport the following changeset to openjdk6: >>>>>> >>>>>> changeset: 2720:bb733c150f94 >>>>>> user: omajid >>>>>> date: Tue Sep 14 10:45:38 2010 -0400 >>>>>> summary: 6979979: Rounding error in font sizes selected by the GTK >>>>>> Look and Feel >>>>>> >>>>>> It selects a better font size the when Swing is using the >>>>>> GTKLookAndFeel. >>>>>> >>>>>> Thanks, >>>>>> Omair >>>>> >>>>> Is this backported in IcedTea6? >>>> >>>> As far as I am aware, no. I am going to add this to IcedTea6 if the >>>> openjdk6 devs are ok with adding it to openjdk6. >>>> >>>> Cheers, >>>> Omair >>> >>> Hello Omair. >>> >>> Approved to be backported to OpenJDK 6 b21 (the current build). >>> >>> Thanks, >>> >>> -Joe >> >> Thanks for the approval. Unfortunately, the patch does not apply >> straight-away. There was some refactoring in FontManager and >> FontUtilies - the patch requires changing the class from FontUtilites >> to FontManager. >> >> The webrev: >> http://cr.openjdk.java.net/~omajid/webrevs/gtk-floating-point-font-size-support-jdk6/webrev.00/ >> >> is identical to the original webrev for the fix: >> http://cr.openjdk.java.net/~omajid/webrevs/gtk-floating-point-font-size-support/webrev.01/ >> >> with the exception of the FontUtilties -> FontManager rename. >> >> Can I still go ahead and backport? >> >> Thanks, >> Omair > From dbhole at redhat.com Wed Oct 20 11:45:58 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Wed, 20 Oct 2010 14:45:58 -0400 Subject: [RFC] netx: show security dialogs in a separate AppContext In-Reply-To: <4CBF305E.7050906@redhat.com> References: <4CBDC2BF.5010605@redhat.com> <20101019223835.GF28452@redhat.com> <4CBF305E.7050906@redhat.com> Message-ID: <20101020184557.GB10267@redhat.com> * Omair Majid [2010-10-20 14:09]: > Hi, > > On 10/19/2010 06:38 PM, Deepak Bhole wrote: > >* Omair Majid [2010-10-19 12:10]: > >>Hi, > >> > >>The attached patch makes security prompts appear in a separate > >>AppContext. This ensures that the applet's look and feel is not > >>automatically set to the system look and feel. > >> > >>The patch is a superset of http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-October/010500.html > >> > >>This patch also implements a large part of the code necessary to > >>allow applets to access their EventQueues. However, I still have to > >>figure out how to use > >>http://hg.openjdk.java.net/jdk7/awt/jdk/rev/8022709a306d to ensure > >>allowing access to the EventQueue is safe. So for now, that code is > >>disabled. > >> > >>The patch ensures that the JNLPRuntime is always initialized in the > >>main AppContext. It starts a thread in this AppContext to listen for > >>security dialog messages, and shows security dialogs when it > >>receives an appropriate security message. The security dialogs block > >>the client applet/application until the user responds. > >> > >>Any thoughts or comments? > >> > > > >Hi, > > > >Please see comments below. > > > > Thanks for the review and the comments. Updated patch attached. > > >Cheers, > >Deepak > > > >>Thanks, > >>Omair > > > >>+final class SecurityDialogMessage { > >>+ > >>+ /* > >>+ * These fields contain information need to display the correct dialog type > >>+ */ > >>+ > >>+ public DialogType dialogType; > >>+ public AccessType accessType; > >>+ public JNLPFile file; > >>+ public CertVerifier certVerifier; > >>+ public X509Certificate certificate; > >>+ public Object[] extras; > >>+ > >>+ public volatile Object userResponse; > >>+ > > > >Why is userResponse volatile? Based on the patch, for a given instance, > >only one thread (either the even dispatcher when action is performed OR > >another caller thread when locking throws an interruptedexception) > >modifies the value... or am I missing something? > > > > I apologise in advance if my knowledge of concurrency is a little > off, but we need to ensure that setting the values on the message > object happen-before reading it. Yes, only one thread can change it, > but the change needs to propogate to the other thread. The lock > ensures that this happens in the non EventDispatchThread case. In > the case of the EventDispatchThread, one thread sets the value and > the other reads it. The volatile ensures that changes to userReponse > are visible to the client thread. > > Perhaps I am wrong; I can make it non-volatile if you want me to. > Ah I see. Yes, you are correct. Volatile in this case will ensure that userResponse is not locally cached, and therefore the EDT will always see the update value when returning from getUserResponse(). Okay, everything else looks good to me. Okay for commit to head. Thanks! Deepak From philip.race at oracle.com Wed Oct 20 11:37:27 2010 From: philip.race at oracle.com (Phil Race) Date: Wed, 20 Oct 2010 11:37:27 -0700 Subject: Request to backport 6979979: Rounding error in font sizes selected by the GTK Look and Feel In-Reply-To: <4CBF33DA.2000009@redhat.com> References: <4CBDD155.900@redhat.com> <20101019173816.GD3392@rivendell.middle-earth.co.uk> <4CBDDAD5.1010809@redhat.com> <4CBDEEF9.6030808@oracle.com> <4CBF33DA.2000009@redhat.com> Message-ID: <4CBF36E7.6040103@oracle.com> That's an inconsequential difference, so I can't think of any reason why not .. the change looks fine to me -phil. On 10/20/2010 11:24 AM, Omair Majid wrote: > On 10/19/2010 03:18 PM, Joe Darcy wrote: >> Omair Majid wrote: >>> On 10/19/2010 01:38 PM, Dr Andrew John Hughes wrote: >>>> On 13:11 Tue 19 Oct , Omair Majid wrote: >>>>> Hi, >>>>> >>>>> I would like to backport the following changeset to openjdk6: >>>>> >>>>> changeset: 2720:bb733c150f94 >>>>> user: omajid >>>>> date: Tue Sep 14 10:45:38 2010 -0400 >>>>> summary: 6979979: Rounding error in font sizes selected by the GTK >>>>> Look and Feel >>>>> >>>>> It selects a better font size the when Swing is using the >>>>> GTKLookAndFeel. >>>>> >>>>> Thanks, >>>>> Omair >>>> >>>> Is this backported in IcedTea6? >>> >>> As far as I am aware, no. I am going to add this to IcedTea6 if the >>> openjdk6 devs are ok with adding it to openjdk6. >>> >>> Cheers, >>> Omair >> >> Hello Omair. >> >> Approved to be backported to OpenJDK 6 b21 (the current build). >> >> Thanks, >> >> -Joe > > Thanks for the approval. Unfortunately, the patch does not apply > straight-away. There was some refactoring in FontManager and > FontUtilies - the patch requires changing the class from FontUtilites > to FontManager. > > The webrev: > http://cr.openjdk.java.net/~omajid/webrevs/gtk-floating-point-font-size-support-jdk6/webrev.00/ > > is identical to the original webrev for the fix: > http://cr.openjdk.java.net/~omajid/webrevs/gtk-floating-point-font-size-support/webrev.01/ > > with the exception of the FontUtilties -> FontManager rename. > > Can I still go ahead and backport? > > Thanks, > Omair From omajid at redhat.com Wed Oct 20 12:06:56 2010 From: omajid at redhat.com (Omair Majid) Date: Wed, 20 Oct 2010 15:06:56 -0400 Subject: Request to backport 6979979: Rounding error in font sizes selected by the GTK Look and Feel In-Reply-To: <4CBF3831.9@oracle.com> References: <4CBDD155.900@redhat.com> <20101019173816.GD3392@rivendell.middle-earth.co.uk> <4CBDDAD5.1010809@redhat.com> <4CBDEEF9.6030808@oracle.com> <4CBF33DA.2000009@redhat.com> <4CBF36E7.6040103@oracle.com> <4CBF3831.9@oracle.com> Message-ID: <4CBF3DD0.5050708@redhat.com> On 10/20/2010 02:42 PM, Joe Darcy wrote: > Phil Race wrote: >> That's an inconsequential difference, so I can't think of any reason >> why not .. the change looks fine to me > Thanks for the review Phil. > Then still approved to go back! > Thanks for the approval Joe. I have pushed the change. Cheers, Omair > Thanks, > > -Joe > >> >> -phil. >> >> On 10/20/2010 11:24 AM, Omair Majid wrote: >>> On 10/19/2010 03:18 PM, Joe Darcy wrote: >>>> Omair Majid wrote: >>>>> On 10/19/2010 01:38 PM, Dr Andrew John Hughes wrote: >>>>>> On 13:11 Tue 19 Oct , Omair Majid wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I would like to backport the following changeset to openjdk6: >>>>>>> >>>>>>> changeset: 2720:bb733c150f94 >>>>>>> user: omajid >>>>>>> date: Tue Sep 14 10:45:38 2010 -0400 >>>>>>> summary: 6979979: Rounding error in font sizes selected by the GTK >>>>>>> Look and Feel >>>>>>> >>>>>>> It selects a better font size the when Swing is using the >>>>>>> GTKLookAndFeel. >>>>>>> >>>>>>> Thanks, >>>>>>> Omair >>>>>> >>>>>> Is this backported in IcedTea6? >>>>> >>>>> As far as I am aware, no. I am going to add this to IcedTea6 if the >>>>> openjdk6 devs are ok with adding it to openjdk6. >>>>> >>>>> Cheers, >>>>> Omair >>>> >>>> Hello Omair. >>>> >>>> Approved to be backported to OpenJDK 6 b21 (the current build). >>>> >>>> Thanks, >>>> >>>> -Joe >>> >>> Thanks for the approval. Unfortunately, the patch does not apply >>> straight-away. There was some refactoring in FontManager and >>> FontUtilies - the patch requires changing the class from FontUtilites >>> to FontManager. >>> >>> The webrev: >>> http://cr.openjdk.java.net/~omajid/webrevs/gtk-floating-point-font-size-support-jdk6/webrev.00/ >>> >>> is identical to the original webrev for the fix: >>> http://cr.openjdk.java.net/~omajid/webrevs/gtk-floating-point-font-size-support/webrev.01/ >>> >>> with the exception of the FontUtilties -> FontManager rename. >>> >>> Can I still go ahead and backport? >>> >>> Thanks, >>> Omair >> > From omajid at redhat.com Wed Oct 20 12:49:27 2010 From: omajid at redhat.com (Omair Majid) Date: Wed, 20 Oct 2010 15:49:27 -0400 Subject: [FYI] icedtea-web: Update AUTHORS Message-ID: <4CBF47C7.5000503@redhat.com> Hi, The attached patch adds people who have worked on the netx code to AUTHORS. It also adds a link to the original Netx project. Does anyone have any objections to committing this? Thanks, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-web-update-authors.patch Type: text/x-patch Size: 918 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101020/89fb6deb/icedtea-web-update-authors.patch From dbhole at redhat.com Wed Oct 20 13:40:28 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Wed, 20 Oct 2010 16:40:28 -0400 Subject: [FYI] icedtea-web: Update AUTHORS In-Reply-To: <4CBF47C7.5000503@redhat.com> References: <4CBF47C7.5000503@redhat.com> Message-ID: <20101020204027.GC10267@redhat.com> * Omair Majid [2010-10-20 15:49]: > Hi, > > The attached patch adds people who have worked on the netx code to > AUTHORS. It also adds a link to the original Netx project. > > Does anyone have any objections to committing this? > Andrew Su should be on it as well. No objections after adding Andrew's name. Deepak > Thanks, > Omair > diff -r 84f659329cfb AUTHORS > --- a/AUTHORS Wed Oct 20 18:38:37 2010 +0100 > +++ b/AUTHORS Wed Oct 20 15:47:01 2010 -0400 > @@ -6,8 +6,12 @@ > Thomas Fitzsimmons > Andrew John Hughes > Matthias Klose > +Francis Kung > Omair Majid > +Joshua Sumali > +Mark Wielaard > > This project also includes code from the following projects: > > OpenJDK > +Netx > diff -r 84f659329cfb ChangeLog > --- a/ChangeLog Wed Oct 20 18:38:37 2010 +0100 > +++ b/ChangeLog Wed Oct 20 15:47:01 2010 -0400 > @@ -1,3 +1,8 @@ > +2010-10-20 Omair Majid > + > + * AUTHORS: Add Francis Kung, Joshua Sumali and Mark Wielaard. Refer to > + forked Netx project. > + > 2010-10-20 Matthias Klose > > * AUTHORS: Add myself. From dbhole at redhat.com Wed Oct 20 13:42:39 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Wed, 20 Oct 2010 16:42:39 -0400 Subject: [FYI] icedtea-web: Update AUTHORS In-Reply-To: <20101020204027.GC10267@redhat.com> References: <4CBF47C7.5000503@redhat.com> <20101020204027.GC10267@redhat.com> Message-ID: <20101020204239.GD10267@redhat.com> * Deepak Bhole [2010-10-20 16:40]: > * Omair Majid [2010-10-20 15:49]: > > Hi, > > > > The attached patch adds people who have worked on the netx code to > > AUTHORS. It also adds a link to the original Netx project. > > > > Does anyone have any objections to committing this? > > > > Andrew Su should be on it as well. > > No objections after adding Andrew's name. > Doh! Forgot one more.. Man Wong (mwong at redhat.com) Deepak > Deepak > > > Thanks, > > Omair > > > diff -r 84f659329cfb AUTHORS > > --- a/AUTHORS Wed Oct 20 18:38:37 2010 +0100 > > +++ b/AUTHORS Wed Oct 20 15:47:01 2010 -0400 > > @@ -6,8 +6,12 @@ > > Thomas Fitzsimmons > > Andrew John Hughes > > Matthias Klose > > +Francis Kung > > Omair Majid > > +Joshua Sumali > > +Mark Wielaard > > > > This project also includes code from the following projects: > > > > OpenJDK > > +Netx > > diff -r 84f659329cfb ChangeLog > > --- a/ChangeLog Wed Oct 20 18:38:37 2010 +0100 > > +++ b/ChangeLog Wed Oct 20 15:47:01 2010 -0400 > > @@ -1,3 +1,8 @@ > > +2010-10-20 Omair Majid > > + > > + * AUTHORS: Add Francis Kung, Joshua Sumali and Mark Wielaard. Refer to > > + forked Netx project. > > + > > 2010-10-20 Matthias Klose > > > > * AUTHORS: Add myself. > From omajid at icedtea.classpath.org Wed Oct 20 13:53:09 2010 From: omajid at icedtea.classpath.org (omajid at icedtea.classpath.org) Date: Wed, 20 Oct 2010 20:53:09 +0000 Subject: /hg/icedtea-web: update AUTHORS Message-ID: changeset 1b3abd2b1e4f in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=1b3abd2b1e4f author: Omair Majid date: Wed Oct 20 16:52:44 2010 -0400 update AUTHORS 2010-10-20 Omair Majid * AUTHORS: Add Francis Kung, Andrew Su, Joshua Sumali, Mark Wielaard and Man Lung Wong. Add link to forked Netx project. diffstat: 2 files changed, 11 insertions(+) AUTHORS | 6 ++++++ ChangeLog | 5 +++++ diffs (30 lines): diff -r 84f659329cfb -r 1b3abd2b1e4f AUTHORS --- a/AUTHORS Wed Oct 20 18:38:37 2010 +0100 +++ b/AUTHORS Wed Oct 20 16:52:44 2010 -0400 @@ -6,8 +6,14 @@ Thomas Fitzsimmons Thomas Fitzsimmons Andrew John Hughes Matthias Klose +Francis Kung Omair Majid +Andrew Su +Joshua Sumali +Mark Wielaard +Man Lung Wong This project also includes code from the following projects: OpenJDK +Netx diff -r 84f659329cfb -r 1b3abd2b1e4f ChangeLog --- a/ChangeLog Wed Oct 20 18:38:37 2010 +0100 +++ b/ChangeLog Wed Oct 20 16:52:44 2010 -0400 @@ -1,3 +1,8 @@ 2010-10-20 Matthias Klose + + * AUTHORS: Add Francis Kung, Andrew Su, Joshua Sumali, Mark Wielaard and + Man Lung Wong. Add link to forked Netx project. + 2010-10-20 Matthias Klose * AUTHORS: Add myself. From omajid at redhat.com Wed Oct 20 13:55:19 2010 From: omajid at redhat.com (Omair Majid) Date: Wed, 20 Oct 2010 16:55:19 -0400 Subject: [FYI] icedtea-web: Update AUTHORS In-Reply-To: <20101020204239.GD10267@redhat.com> References: <4CBF47C7.5000503@redhat.com> <20101020204027.GC10267@redhat.com> <20101020204239.GD10267@redhat.com> Message-ID: <4CBF5737.1010807@redhat.com> On 10/20/2010 04:42 PM, Deepak Bhole wrote: > * Deepak Bhole [2010-10-20 16:40]: >> * Omair Majid [2010-10-20 15:49]: >>> Hi, >>> >>> The attached patch adds people who have worked on the netx code to >>> AUTHORS. It also adds a link to the original Netx project. >>> >>> Does anyone have any objections to committing this? >>> >> >> Andrew Su should be on it as well. >> >> No objections after adding Andrew's name. >> > > Doh! Forgot one more.. Man Wong (mwong at redhat.com) > Done. Apologies to anyone that I may have missed. Please feel free to add yourself. Cheers, Omair From ahughes at redhat.com Wed Oct 20 14:34:17 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Wed, 20 Oct 2010 22:34:17 +0100 Subject: [FYI] icedtea-web: Update AUTHORS In-Reply-To: <4CBF5737.1010807@redhat.com> References: <4CBF47C7.5000503@redhat.com> <20101020204027.GC10267@redhat.com> <20101020204239.GD10267@redhat.com> <4CBF5737.1010807@redhat.com> Message-ID: <20101020213417.GH24339@rivendell.middle-earth.co.uk> On 16:55 Wed 20 Oct , Omair Majid wrote: > On 10/20/2010 04:42 PM, Deepak Bhole wrote: > > * Deepak Bhole [2010-10-20 16:40]: > >> * Omair Majid [2010-10-20 15:49]: > >>> Hi, > >>> > >>> The attached patch adds people who have worked on the netx code to > >>> AUTHORS. It also adds a link to the original Netx project. > >>> > >>> Does anyone have any objections to committing this? > >>> > >> > >> Andrew Su should be on it as well. > >> > >> No objections after adding Andrew's name. > >> > > > > Doh! Forgot one more.. Man Wong (mwong at redhat.com) > > > > Done. Apologies to anyone that I may have missed. Please feel free to > add yourself. > > Cheers, > Omair Man Wong and Andrew Su aren't in the AUTHORS of IcedTea6; that's why they were missed. So they need to be added there too. -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From doko at ubuntu.com Wed Oct 20 15:23:32 2010 From: doko at ubuntu.com (Matthias Klose) Date: Thu, 21 Oct 2010 00:23:32 +0200 Subject: [patch, icedtea-web] Don't include copies of jni.h and jni_md.h Message-ID: <4CBF6BE4.3030803@ubuntu.com> These headers are included in every JDK_HOME, no need to carry local copies. Matthias -------------- next part -------------- A non-text attachment was scrubbed... Name: launcher.diff Type: text/x-diff Size: 1360 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101021/e89434b2/launcher.diff From doko at ubuntu.com Wed Oct 20 15:36:04 2010 From: doko at ubuntu.com (Matthias Klose) Date: Thu, 21 Oct 2010 00:36:04 +0200 Subject: [patch, icedtea-web] Don't include copies of jni.h and jni_md.h In-Reply-To: <4CBF6BE4.3030803@ubuntu.com> References: <4CBF6BE4.3030803@ubuntu.com> Message-ID: <4CBF6ED4.5070408@ubuntu.com> On 21.10.2010 00:23, Matthias Klose wrote: > These headers are included in every JDK_HOME, no need to carry local copies. on some systems, both I$(BOOT_DIR)/include and I$(BOOT_DIR)/include/linux may be needed. From ahughes at redhat.com Wed Oct 20 16:21:18 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Thu, 21 Oct 2010 00:21:18 +0100 Subject: [icedtea-web] RFC: Fix warnings generated by NetX code Message-ID: <20101020232118.GI24339@rivendell.middle-earth.co.uk> The attached patch cuts the warnings for NetX down from over 100 to a paltry 11 (and some of those are caused by Oracle's code). Ok for HEAD? ChangeLog: 2010-10-20 Andrew John Hughes * netx/javax/jnlp/ServiceManager.java: (lookupTable): Add generic types. * netx/net/sourceforge/jnlp/AppletDesc.java: (parameters): Likewise. (AppletDesc(String,String,URL,int,int,Map)): Likewise. (getParameters()): Likewise. * netx/net/sourceforge/jnlp/ApplicationDesc.java: (getArguments()): Remove redundant cast. (addArgument(String)): Add generic typing. * netx/net/sourceforge/jnlp/ExtensionDesc.java: (extToPart): Add generic types. (eagerExtParts): Likewise. * netx/net/sourceforge/jnlp/InformationDesc.java: (info): Likewise. (getIcons(Object)): Add generic typing. (getAssociations()): Likewise. (getRelatedContents()): Likewise. (getItem(Object)): Likewise. (getItems(Object)): Likewise. (addItem(String,Object)): Likewise. * netx/net/sourceforge/jnlp/JNLPFile.java: (resources): Likewise. (InformationDesc.getItems(Object)): Likewise. (getResources(Class)): Likewise. * netx/net/sourceforge/jnlp/LaunchException.java: (getCauses()): Likewise. * netx/net/sourceforge/jnlp/Launcher.java: (launchApplication(JNLPFile)): Likewise. * netx/net/sourceforge/jnlp/NetxPanel.java: (NetxPanel(URL,Hashtable)): Likewise. (NetxPanel(URL,Hashtable,boolean)): Likewise. * netx/net/sourceforge/jnlp/Node.java: (getChildNodes()): Likewise. * netx/net/sourceforge/jnlp/Parser.java: (getResources(Node,boolean)): Likewise. (getInfo(Node)): Likewise. (getInformationDesc(Node)): Likewise. (getApplet(Node)): Likewise. (getApplication(Node)): Likewise. (splitString(String)): Likewise. (getLocales(Node)): Likewise. (getChildNodes(Node,String)): Likewise. * netx/net/sourceforge/jnlp/PluginBridge.java: Fix variable naming and add generic types. (cacheJars): Changed from cache_jars. (cacheExJars): Changed from cache_ex-jars. (atts): Add generic typing. (PluginBridge(URL,URL,String,String,int,int,Hashtable)): Likewise. (getInformation(Locale)): Likewise. (getResources(Locale,String,String)): Likewise. (getJARs()): Avoid excessive copying; filtering already performed by getResources in JNLPFile. * netx/net/sourceforge/jnlp/ResourcesDesc.java: (resources): Add generic typing. (getJREs()): Likewise. (getJARs()): Likewise. (getJARs(String)): Likewise. (getExtensions()): Likewise. (getPackages()): Likewise. (getPackages(String)): Likewise. (getProperties()): Likewise. (getPropertiesMap()): Likewise. (getResources(Class)): Make generic. * netx/net/sourceforge/jnlp/Version.java: (matches(Version)): Add generic types. (matchesAny(Version)): Likewise. (matchesSingle(String)): Likewise. (matches(String,String)): Likewise. (equal(List,List)): Likewise. (greater(List,List)): Likewise. (compare(String,String)): Use Integer.valueOf. (normalize(List,int)): Add generic types, using a List of lists rather than an array of lists. (getVersionStrings()): Add generic types. (getParts()): Likewise. * netx/net/sourceforge/jnlp/cache/CacheUtil.java: (waitForResources(ApplicationInstance,ResourceTracker, URL,String)): Likewise. * netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java: (getListener(ApplicatonInstance,String,URL)): Use setVisible instead of show(). (disposeListener(DownloadServiceListener)): Use setVisible instead of hide(). (DownloadPanel.urls): Add generic typing. (DownloadPanel.panels): Likewise. (DownloadPanel.update(URL,String,long,long,int)): Fix formatting. Add generic types. * netx/net/sourceforge/jnlp/cache/Resource.java: (resources): Add generic typing. (trackers): Likewise. (getResource(URL,Version,UpdatePolicy)): Use generic types. (getTracker()): Likewise. (addTracker(ResourceTracker)): Likewise. (fireDownloadEvent()): Likewise. * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: (prefetchTrackers): Add generic typing. (queue): Likewise. (active): Likewise. (resources): Likewise. (listeners): Likewise. (fireDownloadEvent(Resource)): Remove unneeded cast. (getPrefetch()): Use generic typing. (selectByFlag(List,int,int)): Likewise. (getResource(URL)): Likewise. * netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java: (weakClips): Add generic types. (destroy()): Use generic typing. (getApplets()): Likewise. (getStreamKeys()): Likewise. * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: (weakWindows): Add generic types. (installEnvironment()): Likewise. (destroy()): Remove redundant cast. * netx/net/sourceforge/jnlp/runtime/Boot.java: Extend PrivilegedAction. (run()): Add generic typing. (getOptions(String)): Likewise. * netx/net/sourceforge/jnlp/runtime/Boot13.java: (main(String[]): Likewise. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Fix formatting. (urlToLoader): Add generic types. (resourcePermissions): Likewise. (available): Likewise. (jarEntries): Likewise. (getInstance(JNLPFile,UpdatePolicy)): Remove redundant cast. (getInstance(URL,String,Version,UpdatePolicy)): Likewise. (initializeExtensions()): Add generic types. (initializePermissions()): Likewise. (initializeResources()): Likewise. (getPermissions(CodeSource)): Likewise. (fillInPartJars(List)): Likewise. (activateJars(List)): Likewise. (loadClass(String)): Likewise. Suppress warnings due to sun.misc.JarIndex usage. (findResources(String)): Mark as overriding. Add generic types. (getExtensionName()): Add @Deprecated annotation. (getExtensionHREF()): Likewise. * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: (weakWindows): Add generic typing. (weakApplications): Likewise. (getApplication(Window)): Remove redundant casts. Add w, which is window cast to Window. * netx/net/sourceforge/jnlp/services/ServiceUtil.java: (invoke(Object,Method,Object[])): Use generic types. * netx/net/sourceforge/jnlp/services/XPersistenceService.java: (getNames(URL)): Likewise. * netx/net/sourceforge/jnlp/tools/JarSigner.java: (verifyJars(List,ResourceTracker)): Remove redundant cast. * netx/net/sourceforge/jnlp/util/WeakList.java: Redesign as a generic type. (refs): Add generic types. (deref(WeakReference)): Likewise. (get(int)): Likewise. (set(int,Object)): Likewise. (add(int,E)): Likewise. (remove()): Likewise. (hardList()): Likewise. * netx/net/sourceforge/nanoxml/XMLElement.java: (attributes): Add generic typing. (children): Likewise. (entities): Likewise. (XMLElement()): Use generic types. (XMLElement(Hashtable): Likewise. (resolveEntity(StringBuffer)): Remove redundant cast. -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 -------------- next part -------------- diff -r 1b3abd2b1e4f netx/javax/jnlp/ServiceManager.java --- a/netx/javax/jnlp/ServiceManager.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/javax/jnlp/ServiceManager.java Thu Oct 21 00:21:09 2010 +0100 @@ -10,7 +10,8 @@ private static ServiceManagerStub stub = null; - private static Map lookupTable = new HashMap(); // ensure lookup is idempotent + private static Map lookupTable + = new HashMap(); // ensure lookup is idempotent private ServiceManager() { // says it can't be instantiated diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/AppletDesc.java --- a/netx/net/sourceforge/jnlp/AppletDesc.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/AppletDesc.java Thu Oct 21 00:21:09 2010 +0100 @@ -45,7 +45,7 @@ private int height; /** the parameters */ - private Map parameters; + private Map parameters; /** @@ -58,13 +58,14 @@ * @param height the height * @param parameters the parameters */ - public AppletDesc(String name, String mainClass, URL documentBase, int width, int height, Map parameters) { + public AppletDesc(String name, String mainClass, URL documentBase, int width, int height, + Map parameters) { this.name = name; this.mainClass = mainClass; this.documentBase = documentBase; this.width = width; this.height = height; - this.parameters = new HashMap(parameters); + this.parameters = new HashMap(parameters); } /** @@ -105,8 +106,8 @@ /** * Returns the applet parameters */ - public Map getParameters() { - return new HashMap(parameters); + public Map getParameters() { + return new HashMap(parameters); } /** diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/ApplicationDesc.java --- a/netx/net/sourceforge/jnlp/ApplicationDesc.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/ApplicationDesc.java Thu Oct 21 00:21:09 2010 +0100 @@ -58,17 +58,17 @@ * Returns the arguments */ public String[] getArguments() { - return (String[]) arguments.clone(); + return arguments.clone(); } /** * Add an argument to the end of the arguments. */ public void addArgument(String arg) { - ArrayList l = new ArrayList(Arrays.asList(arguments)); + List l = new ArrayList(Arrays.asList(arguments)); l.add(arg); - arguments = (String[]) l.toArray(arguments); + arguments = l.toArray(arguments); } } diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/ExtensionDesc.java --- a/netx/net/sourceforge/jnlp/ExtensionDesc.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/ExtensionDesc.java Thu Oct 21 00:21:09 2010 +0100 @@ -45,10 +45,10 @@ private JNLPFile file; /** map from ext-part to local part */ - private Map extToPart = new HashMap(); + private Map extToPart = new HashMap(); /** eager ext parts */ - private List eagerExtParts = new ArrayList(); + private List eagerExtParts = new ArrayList(); /** diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/InformationDesc.java --- a/netx/net/sourceforge/jnlp/InformationDesc.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/InformationDesc.java Thu Oct 21 00:21:09 2010 +0100 @@ -52,7 +52,7 @@ private Locale locales[]; /** the data as list of key,value pairs */ - private List info; + private List info; /** the JNLPFile this information is for */ private JNLPFile jnlpFile; @@ -129,9 +129,9 @@ * @return an array of zero of more IconDescs of the specified icon type */ public IconDesc[] getIcons(Object kind) { - List icons = getItems("icon-"+kind); + List icons = getItems("icon-"+kind); - return (IconDesc[]) icons.toArray(new IconDesc[icons.size()]); + return icons.toArray(new IconDesc[icons.size()]); }; /** @@ -204,9 +204,9 @@ * Returns the associations specified in the JNLP file */ public AssociationDesc[] getAssociations() { - List associations = getItems("association"); + List associations = getItems("association"); - return (AssociationDesc[]) associations.toArray(new AssociationDesc[associations.size()]); + return associations.toArray(new AssociationDesc[associations.size()]); } /** @@ -220,17 +220,16 @@ * Returns the related-contents specified by this JNLP file */ public RelatedContentDesc[] getRelatedContents() { - List relatedContents = getItems("related-content"); + List relatedContents = getItems("related-content"); - return (RelatedContentDesc[]) relatedContents.toArray( - new RelatedContentDesc[relatedContents.size()]); + return relatedContents.toArray(new RelatedContentDesc[relatedContents.size()]); } /** * Returns the last item matching the specified key. */ protected Object getItem(Object key) { - List items = getItems(key); + List items = getItems(key); if (items.size() == 0) return null; else @@ -240,11 +239,11 @@ /** * Returns all items matching the specified key. */ - protected List getItems(Object key) { + protected List getItems(Object key) { if (info == null) - return Collections.EMPTY_LIST; + return Collections.emptyList(); - List result = new ArrayList(); + List result = new ArrayList(); for (int i=0; i < info.size(); i+=2) if (info.get(i).equals(key)) result.add( info.get(i+1) ); @@ -258,7 +257,7 @@ */ protected void addItem(String key, Object value) { if (info == null) - info = new ArrayList(); + info = new ArrayList(); info.add(key); info.add(value); diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/JNLPFile.java --- a/netx/net/sourceforge/jnlp/JNLPFile.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/JNLPFile.java Thu Oct 21 00:21:09 2010 +0100 @@ -86,7 +86,7 @@ protected UpdateDesc update; /** resources */ - protected List resources; + protected List resources; /** additional resources not in JNLP file (from command line) */ protected ResourcesDesc sharedResources = new ResourcesDesc(this, null, null, null); @@ -330,8 +330,8 @@ */ public InformationDesc getInformation(final Locale locale) { return new InformationDesc(this, new Locale[] {locale}) { - protected List getItems(Object key) { - List result = new ArrayList(); + protected List getItems(Object key) { + List result = new ArrayList(); for (int i=0; i < info.size(); i++) { InformationDesc infoDesc = (InformationDesc) info.get(i); @@ -375,11 +375,11 @@ */ public ResourcesDesc getResources(final Locale locale, final String os, final String arch) { return new ResourcesDesc(this, new Locale[] {locale}, new String[] {os}, new String[] {arch}) { - public List getResources(Class launchType) { - List result = new ArrayList(); + public List getResources(Class launchType) { + List result = new ArrayList(); for (int i=0; i < resources.size(); i++) { - ResourcesDesc rescDesc = (ResourcesDesc) resources.get(i); + ResourcesDesc rescDesc = resources.get(i); if (localMatches(locale, rescDesc.getLocales()) && stringMatches(os, rescDesc.getOS()) diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/LaunchException.java --- a/netx/net/sourceforge/jnlp/LaunchException.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/LaunchException.java Thu Oct 21 00:21:09 2010 +0100 @@ -146,7 +146,7 @@ * and will be removed once netx no longer supports 1.3. */ public Throwable[] getCauses() { - ArrayList result = new ArrayList(); + ArrayList result = new ArrayList(); Reflect r = new Reflect(); Throwable cause = this.cause; @@ -156,7 +156,7 @@ cause = (Throwable) r.invoke(cause, "getCause"); } - return (Throwable[]) result.toArray(new Throwable[0]); + return result.toArray(new Throwable[0]); } /** diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/Launcher.java --- a/netx/net/sourceforge/jnlp/Launcher.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/Launcher.java Thu Oct 21 00:21:09 2010 +0100 @@ -455,11 +455,11 @@ R("LSFatal"), R("LCClient"), R("LCantDetermineMainClass") , R("LCantDetermineMainClassInfo"))); - Class mainClass = app.getClassLoader().loadClass(mainName); + Class mainClass = app.getClassLoader().loadClass(mainName); - Method main = mainClass.getMethod("main", new Class[] {String[].class} ); + Method main = mainClass.getMethod("main", new Class[] {String[].class} ); String args[] = file.getApplication().getArguments(); - + SwingUtilities.invokeAndWait(new Runnable() { // dummy method to force Event Dispatch Thread creation public void run(){} diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/NetxPanel.java --- a/netx/net/sourceforge/jnlp/NetxPanel.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/NetxPanel.java Thu Oct 21 00:21:09 2010 +0100 @@ -45,13 +45,14 @@ private AppletInstance appInst = null; private boolean appletAlive; - public NetxPanel(URL documentURL, Hashtable atts) + public NetxPanel(URL documentURL, Hashtable atts) { super(documentURL, atts); } // overloaded constructor, called when initialized via plugin - public NetxPanel(URL documentURL, Hashtable atts, boolean exitOnFailure) + public NetxPanel(URL documentURL, Hashtable atts, + boolean exitOnFailure) { this(documentURL, atts); this.exitOnFailure = exitOnFailure; diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/Node.java --- a/netx/net/sourceforge/jnlp/Node.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/Node.java Thu Oct 21 00:21:09 2010 +0100 @@ -47,12 +47,12 @@ Node[] getChildNodes() { if (children == null) { - List list = new ArrayList(); + List list = new ArrayList(); for (Enumeration e = xml.enumerateChildren(); e.hasMoreElements();) list.add( new Node((XMLElement)e.nextElement()) ); - children = (Node[]) list.toArray( new Node[list.size()] ); + children = list.toArray( new Node[list.size()] ); for (int i=0; i < children.length-1; i++) children[i].next = children[i+1]; diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/Parser.java --- a/netx/net/sourceforge/jnlp/Parser.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/Parser.java Thu Oct 21 00:21:09 2010 +0100 @@ -239,8 +239,10 @@ * @param j2se true if the resources are located under a j2se or java node * @throws ParseException if the JNLP file is invalid */ - public List getResources(Node parent, boolean j2se) throws ParseException { - List result = new ArrayList(); + public List getResources(Node parent, boolean j2se) + throws ParseException + { + List result = new ArrayList(); Node resources[] = getChildNodes(parent, "resources"); // ensure that there are at least one information section present @@ -433,8 +435,10 @@ * @param parent the parent node (jnlp) * @throws ParseException if the JNLP file is invalid */ - public List getInfo(Node parent) throws ParseException { - List result = new ArrayList(); + public List getInfo(Node parent) + throws ParseException + { + List result = new ArrayList(); Node info[] = getChildNodes(parent, "information"); // ensure that there are at least one information section present @@ -455,7 +459,7 @@ * @throws ParseException if the JNLP file is invalid */ public InformationDesc getInformationDesc(Node node) throws ParseException { - List descriptionsUsed = new ArrayList(); + List descriptionsUsed = new ArrayList(); // locale Locale locales[] = getLocales(node); @@ -642,7 +646,7 @@ String name = getRequiredAttribute(node, "name", R("PUnknownApplet")); String main = getRequiredAttribute(node, "main-class", null); URL docbase = getURL(node, "documentbase", base); - Map paramMap = new HashMap(); + Map paramMap = new HashMap(); int width = 0; int height = 0; @@ -673,7 +677,7 @@ */ public ApplicationDesc getApplication(Node node) throws ParseException { String main = getAttribute(node, "main-class", null); - List argsList = new ArrayList(); + List argsList = new ArrayList(); // if (main == null) // only ok if can be found in main jar file (can't check here but make a note) @@ -687,8 +691,7 @@ argsList.add( getSpanText(args[i]) ); } - String argStrings[] = - (String[]) argsList.toArray( new String[argsList.size()] ); + String argStrings[] = argsList.toArray( new String[argsList.size()] ); return new ApplicationDesc(main, argStrings); } @@ -825,9 +828,9 @@ if (source == null) return new String[0]; - List result = new ArrayList(); + List result = new ArrayList(); StringTokenizer st = new StringTokenizer(source, " "); - StringBuffer part = new StringBuffer(); + StringBuilder part = new StringBuilder(); while (st.hasMoreTokens()) { part.setLength(0); @@ -849,7 +852,7 @@ result.add( part.toString() ); } - return (String[]) result.toArray(new String[result.size()] ); + return result.toArray(new String[result.size()] ); } /** @@ -858,7 +861,7 @@ * @param node the node with a locale attribute */ public Locale[] getLocales(Node node) { - List locales = new ArrayList(); + List locales = new ArrayList(); String localeParts[] = splitString(getAttribute(node, "locale", "")); @@ -868,7 +871,7 @@ locales.add(l); } - return (Locale[]) locales.toArray(new Locale[locales.size()] ); + return locales.toArray(new Locale[locales.size()] ); } /** @@ -936,7 +939,7 @@ * Returns all child nodes with the specified name. */ public static Node[] getChildNodes(Node node, String name) { - List result = new ArrayList(); + List result = new ArrayList(); Node child = node.getFirstChild(); while (child != null) { @@ -945,7 +948,7 @@ child = child.getNextSibling(); } - return (Node[]) result.toArray( new Node[result.size()] ); + return result.toArray( new Node[result.size()] ); } diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/PluginBridge.java --- a/netx/net/sourceforge/jnlp/PluginBridge.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/PluginBridge.java Thu Oct 21 00:21:09 2010 +0100 @@ -40,64 +40,65 @@ String name; String[] jars = new String[0]; - String[] cache_jars = new String[0]; - String[] cache_ex_jars = new String[0]; - Hashtable atts; + String[] cacheJars = new String[0]; + String[] cacheExJars = new String[0]; + Hashtable atts; public PluginBridge(URL codebase, URL documentBase, String jar, String main, - int width, int height, Hashtable atts) + int width, int height, Hashtable atts) throws Exception { specVersion = new Version("1.0"); fileVersion = new Version("1.1"); this.codeBase = codebase; this.sourceLocation = documentBase; - + if (atts.containsKey("jnlp_href")){ try { - URL jnlp = new URL(codeBase.toExternalForm() + (String) atts.get("jnlp_href")); - JNLPFile jnlp_file = new JNLPFile(jnlp); - Map jnlp_params = jnlp_file.getApplet().getParameters(); - + URL jnlp = new URL(codeBase.toExternalForm() + atts.get("jnlp_href")); + JNLPFile jnlpFile = new JNLPFile(jnlp); + Map jnlpParams = jnlpFile.getApplet().getParameters(); + // Change the parameter name to lowercase to follow conventions. - Iterator it = jnlp_params.keySet().iterator(); - while(it.hasNext()){ - String key = (String) it.next(); - atts.put(key.toLowerCase(), jnlp_params.get(key)); + for (Map.Entry entry : jnlpParams.entrySet()){ + atts.put(entry.getKey().toLowerCase(), entry.getValue()); } } catch (MalformedURLException e) { // Don't fail because we cannot get the jnlp file. Parameters are optional not required. // it is the site developer who should ensure that file exist. - System.err.println("Unable to get JNLP file at: " + codeBase.toExternalForm() - + (String) atts.get("jnlp_href")); + System.err.println("Unable to get JNLP file at: " + codeBase.toExternalForm() + + atts.get("jnlp_href")); } } // also, see if cache_archive is specified - if (atts.get("cache_archive") != null && ((String) atts.get("cache_archive")).length() > 0) { + String cacheArchive = atts.get("cache_archive"); + if (cacheArchive != null && cacheArchive.length() > 0) { String[] versions = new String[0]; // are there accompanying versions? - if (atts.get("cache_version") != null) { - versions = ((String) atts.get("cache_version")).split(","); + String cacheVersion = atts.get("cache_version"); + if (cacheVersion != null) { + versions = cacheVersion.split(","); } - String[] jars = ((String) atts.get("cache_archive")).split(","); - cache_jars = new String[jars.length]; + String[] jars = cacheArchive.split(","); + cacheJars = new String[jars.length]; for (int i=0; i < jars.length; i++) { - cache_jars[i] = jars[i].trim(); + cacheJars[i] = jars[i].trim(); if (versions.length > 0) { - cache_jars[i] += ";" + versions[i].trim(); + cacheJars[i] += ";" + versions[i].trim(); } } } - if (atts.get("cache_archive_ex") != null && ((String) atts.get("cache_archive_ex")).length() > 0) { - cache_ex_jars = ((String) atts.get("cache_archive_ex")).split(","); + String cacheArchiveEx = atts.get("cache_archive_ex"); + if (cacheArchiveEx != null && cacheArchiveEx.length() > 0) { + cacheExJars = cacheArchiveEx.split(","); } if (jar != null && jar.length() > 0) { @@ -109,7 +110,7 @@ } this.atts = atts; - name = (String) atts.get("name"); + name = atts.get("name"); if (name == null) name = "Applet"; else @@ -140,11 +141,10 @@ public InformationDesc getInformation(final Locale locale) { return new InformationDesc(this, new Locale[] {locale}) { - protected List getItems(Object key) + protected List getItems(Object key) { // Should we populate this list with applet attribute tags? - List result = new ArrayList(); - return result; + return new ArrayList(); } }; } @@ -153,102 +153,92 @@ final String arch) { return new ResourcesDesc(this, new Locale[] {locale}, new String[] {os}, - new String[] {arch}) { - public List getResources(Class launchType) + new String[] {arch}) { + @Override + public List getResources(Class launchType) { - List result = new ArrayList(); - result.addAll(sharedResources.getResources(launchType)); - // Need to add the JAR manually... //should this be done to sharedResources on init? - try + if (launchType.equals(JARDesc.class)) { - if (launchType.equals(JARDesc.class)) + try { + List jarDescs = new ArrayList(); + jarDescs.addAll(sharedResources.getResources(JARDesc.class)); + for (int i = 0; i < jars.length; i++) if (jars[i].length() > 0) - result.add(new JARDesc(new URL(codeBase, jars[i]), + jarDescs.add(new JARDesc(new URL(codeBase, jars[i]), null, null, false, true, false, true)); boolean cacheable = true; - if (atts.get("cache_option") != null && - ((String) atts.get("cache_option")).equalsIgnoreCase("no")) + String cacheOption = atts.get("cache_option"); + if (cacheOption != null && cacheOption.equalsIgnoreCase("no")) cacheable = false; - for (int i = 0; i < cache_jars.length; i++) { + for (int i = 0; i < cacheJars.length; i++) { - String[] jar_and_ver = cache_jars[i].split(";"); + String[] jarAndVer = cacheJars[i].split(";"); - String jar = jar_and_ver[0]; + String jar = jarAndVer[0]; Version version = null; if (jar.length() == 0) continue; - if (jar_and_ver.length > 1) { - version = new Version(jar_and_ver[1]); + if (jarAndVer.length > 1) { + version = new Version(jarAndVer[1]); } - result.add(new JARDesc(new URL(codeBase, jar), + jarDescs.add(new JARDesc(new URL(codeBase, jar), version, null, false, true, false, cacheable)); } - for (int i = 0; i < cache_ex_jars.length; i++) { + for (int i = 0; i < cacheExJars.length; i++) { - if (cache_ex_jars[i].length() == 0) + if (cacheExJars[i].length() == 0) continue; - String[] jar_info = cache_ex_jars[i].split(";"); + String[] jarInfo = cacheExJars[i].split(";"); - String jar = jar_info[0].trim(); + String jar = jarInfo[0].trim(); Version version = null; boolean lazy = true; - if (jar_info.length > 1) { + if (jarInfo.length > 1) { // format is name[[;preload];version] - if (jar_info[1].equals("preload")) { + if (jarInfo[1].equals("preload")) { lazy = false; } else { - version = new Version(jar_info[1].trim()); + version = new Version(jarInfo[1].trim()); } - if (jar_info.length > 2) { + if (jarInfo.length > 2) { lazy = false; - version = new Version(jar_info[2].trim()); + version = new Version(jarInfo[2].trim()); } } - result.add(new JARDesc(new URL(codeBase, jar), + jarDescs.add(new JARDesc(new URL(codeBase, jar), version, null, lazy, true, false, false)); } + // We know this is a safe list of JarDesc objects + @SuppressWarnings("unchecked") + List result = (List) jarDescs; + return result; } + catch (MalformedURLException ex) { /* Ignored */ } } - catch (MalformedURLException ex) - { } - return result; - } + return sharedResources.getResources(launchType); + } + @Override public JARDesc[] getJARs() { - List resources = getResources(JARDesc.class); - ArrayList jars = new ArrayList(); - - //Only get the JARDescs - for (int i = 0; i < resources.size(); i++) { - Object resource = resources.get(i); - if (resource instanceof JARDesc) - jars.add((JARDesc) resource); - } - - Object[] objectArray = jars.toArray(); - JARDesc[] jarArray = new JARDesc[objectArray.length]; - - for (int i = 0; i < objectArray.length; i++) - jarArray[i] = (JARDesc) objectArray[i]; - - return jarArray; + List jarDescs = getResources(JARDesc.class); + return jarDescs.toArray(new JARDesc[jarDescs.size()]); } public void addResource(Object resource) diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/ResourcesDesc.java --- a/netx/net/sourceforge/jnlp/ResourcesDesc.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/ResourcesDesc.java Thu Oct 21 00:21:09 2010 +0100 @@ -43,8 +43,8 @@ private JNLPFile jnlpFile; /** list of jars, packages, properties, and extensions */ - private List resources = new ArrayList(); // mixed list makes easier for lookup code - + private List resources = new ArrayList(); + // mixed list makes easier for lookup code /** * Create a representation of one information section of the @@ -66,8 +66,8 @@ * Returns the JVMs. */ public JREDesc[] getJREs() { - List resources = getResources(JREDesc.class); - return (JREDesc[]) resources.toArray( new JREDesc[resources.size()] ); + List resources = getResources(JREDesc.class); + return resources.toArray( new JREDesc[resources.size()] ); } /** @@ -92,8 +92,8 @@ * Returns all of the JARs. */ public JARDesc[] getJARs() { - List resources = getResources(JARDesc.class); - return (JARDesc[]) resources.toArray( new JARDesc[resources.size()] ); + List resources = getResources(JARDesc.class); + return resources.toArray( new JARDesc[resources.size()] ); } /** @@ -102,32 +102,32 @@ * @param partName the part name, null and "" equivalent */ public JARDesc[] getJARs(String partName) { - List resources = getResources(JARDesc.class); + List resources = getResources(JARDesc.class); for (int i = resources.size(); i-- > 0;) { - JARDesc jar = (JARDesc) resources.get(i); + JARDesc jar = resources.get(i); if (!(""+jar.getPart()).equals(""+partName)) resources.remove(i); } - return (JARDesc[]) resources.toArray( new JARDesc[resources.size()] ); + return resources.toArray( new JARDesc[resources.size()] ); } /** * Returns the Extensions. */ public ExtensionDesc[] getExtensions() { - List resources = getResources(ExtensionDesc.class); - return (ExtensionDesc[]) resources.toArray( new ExtensionDesc[resources.size()] ); + List resources = getResources(ExtensionDesc.class); + return resources.toArray( new ExtensionDesc[resources.size()] ); } /** * Returns the Packages. */ public PackageDesc[] getPackages() { - List resources = getResources(PackageDesc.class); - return (PackageDesc[]) resources.toArray( new PackageDesc[resources.size()] ); + List resources = getResources(PackageDesc.class); + return resources.toArray( new PackageDesc[resources.size()] ); } /** @@ -137,34 +137,34 @@ * @return the PackageDesc objects matching the class name */ public PackageDesc[] getPackages(String className) { - List resources = getResources(PackageDesc.class); + List resources = getResources(PackageDesc.class); for (int i = resources.size(); i-- > 0;) { - PackageDesc pk = (PackageDesc) resources.get(i); + PackageDesc pk = resources.get(i); if (!pk.matches(className)) resources.remove(i); } - return (PackageDesc[]) resources.toArray( new PackageDesc[resources.size()] ); + return resources.toArray( new PackageDesc[resources.size()] ); } /** * Returns the Properties as a list. */ public PropertyDesc[] getProperties() { - List resources = getResources(PropertyDesc.class); - return (PropertyDesc[]) resources.toArray( new PropertyDesc[resources.size()] ); + List resources = getResources(PropertyDesc.class); + return resources.toArray( new PropertyDesc[resources.size()] ); } /** * Returns the properties as a map. */ - public Map getPropertiesMap() { - Properties properties = new Properties(); - List resources = getResources(PropertyDesc.class); + public Map getPropertiesMap() { + Map properties = new HashMap(); + List resources = getResources(PropertyDesc.class); for (int i=0; i < resources.size(); i++) { - PropertyDesc prop = (PropertyDesc) resources.get(i); + PropertyDesc prop = resources.get(i); properties.put( prop.getKey(), prop.getValue() ); } @@ -205,12 +205,12 @@ /** * Returns all resources of the specified type. */ - public List getResources(Class type) { - List result = new ArrayList(); + public List getResources(Class type) { + List result = new ArrayList(); for (int i=0; i < resources.size(); i++) if ( type.isAssignableFrom(resources.get(i).getClass()) ) - result.add(resources.get(i)); + result.add(type.cast(resources.get(i))); return result; } diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/Version.java --- a/netx/net/sourceforge/jnlp/Version.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/Version.java Thu Oct 21 00:21:09 2010 +0100 @@ -94,10 +94,10 @@ * @param version a Version object */ public boolean matches(Version version) { - List versionStrings = version.getVersionStrings(); + List versionStrings = version.getVersionStrings(); for (int i=0; i < versionStrings.size(); i++) { - if (!this.matchesSingle( (String)versionStrings.get(i) )) + if (!this.matchesSingle(versionStrings.get(i) )) return false; } @@ -122,10 +122,10 @@ * @param version a Version object */ public boolean matchesAny(Version version) { - List versionStrings = version.getVersionStrings(); + List versionStrings = version.getVersionStrings(); for (int i=0; i < versionStrings.size(); i++) { - if (this.matchesSingle( (String)versionStrings.get(i) )) + if (this.matchesSingle( versionStrings.get(i) )) return true; } @@ -139,9 +139,9 @@ * @param version a non-compound version of the form "1.2.3[+*]" */ private boolean matchesSingle(String version) { - List versionStrings = this.getVersionStrings(); + List versionStrings = this.getVersionStrings(); for (int i=0; i < versionStrings.size(); i++) { - if ( matches(version, (String)versionStrings.get(i)) ) + if ( matches(version, versionStrings.get(i)) ) return true; } return false; @@ -156,14 +156,17 @@ * @param version a non-compound version optionally with "+" or "*" */ private boolean matches(String subversion, String version) { - List subparts = getParts(subversion); - List parts = getParts(version); + List subparts = getParts(subversion); + List parts = getParts(version); int maxLength = Math.max(subversion.length(), version.length()); if (version.endsWith("*")) // star means rest of parts irrelevant: truncate them maxLength = parts.size(); - normalize(new List[] {subparts, parts}, maxLength); + List> versions = new ArrayList>(); + versions.add(subparts); + versions.add(parts); + normalize(versions, maxLength); if (equal(subparts, parts)) return true; @@ -181,9 +184,9 @@ * @param parts1 normalized version parts * @param parts2 normalized version parts */ - protected boolean equal(List parts1, List parts2) { + protected boolean equal(List parts1, List parts2) { for (int i=0; i < parts1.size(); i++) { - if ( 0 != compare((String)parts1.get(i), (String)parts2.get(i)) ) + if ( 0 != compare(parts1.get(i), parts2.get(i)) ) return false; } @@ -197,16 +200,16 @@ * @param parts1 normalized version parts * @param parts2 normalized version parts */ - protected boolean greater(List parts1, List parts2) { + protected boolean greater(List parts1, List parts2) { //if (true) return false; for (int i=0; i < parts1.size(); i++) { // if part1 > part2 then it's a later version, so return true - if (compare((String)parts1.get(i), (String)parts2.get(i)) > 0) + if (compare(parts1.get(i), parts2.get(i)) > 0) return true; // if part1 < part2 then it's a ealier version, so return false - if (compare((String)parts1.get(i), (String)parts2.get(i)) < 0) + if (compare(parts1.get(i), parts2.get(i)) < 0) return false; // if equal go to next part @@ -229,8 +232,8 @@ * @return comparison of the two parts */ protected int compare(String part1, String part2) { - Integer number1 = new Integer(0); - Integer number2 = new Integer(0); + Integer number1 = Integer.valueOf(0); + Integer number2 = Integer.valueOf(0); // compare as integers try { @@ -261,30 +264,30 @@ * @param versions list array of parts of a version string * @param maxLength truncate lists to this maximum length */ - protected void normalize(List versions[], int maxLength) { + protected void normalize(List> versions, int maxLength) { int length = 0; - for (int i=0; i < versions.length; i++) - length = Math.max(length, versions[i].size()); + for (List vers : versions) + length = Math.max(length, vers.size()); if (length > maxLength) length = maxLength; - for (int i=0; i < versions.length; i++) { + for (List vers : versions) { // remove excess elements - while (versions[i].size() > length) - versions[i].remove( versions[i].size()-1 ); + while (vers.size() > length) + vers.remove( vers.size()-1 ); // add in empty pad elements - while (versions[i].size() < length) - versions[i].add( emptyString ); + while (vers.size() < length) + vers.add( emptyString ); } } /** * Return the individual version strings that make up a Version. */ - protected List getVersionStrings() { - ArrayList strings = new ArrayList(); + protected List getVersionStrings() { + ArrayList strings = new ArrayList(); StringTokenizer st = new StringTokenizer(versionString, " "); while (st.hasMoreTokens()) @@ -298,8 +301,8 @@ * * @param oneVersion a single version id string (not compound) */ - protected List getParts(String oneVersion) { - ArrayList strings = new ArrayList(); + protected List getParts(String oneVersion) { + ArrayList strings = new ArrayList(); StringTokenizer st = new StringTokenizer(oneVersion, seperators+"+*"); while (st.hasMoreTokens()) { diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/cache/CacheUtil.java --- a/netx/net/sourceforge/jnlp/cache/CacheUtil.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/cache/CacheUtil.java Thu Oct 21 00:21:09 2010 +0100 @@ -400,12 +400,12 @@ return; // only resources not starting out downloaded are displayed - List urlList = new ArrayList(); + List urlList = new ArrayList(); for (int i=0; i < resources.length; i++) { if (!tracker.checkResource(resources[i])) urlList.add(resources[i]); } - URL undownloaded[] = (URL[]) urlList.toArray( new URL[urlList.size()] ); + URL undownloaded[] = urlList.toArray( new URL[urlList.size()] ); listener = indicator.getListener(app, title, undownloaded); diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java --- a/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java Thu Oct 21 00:21:09 2010 +0100 @@ -118,7 +118,7 @@ screen.height-frame.getHeight()); } - frame.show(); + frame.setVisible(true); return result; } @@ -135,7 +135,7 @@ ActionListener hider = new ActionListener() { public void actionPerformed(ActionEvent evt) { if (frame.getContentPane().getComponentCount() == 1) - frame.hide(); + frame.setVisible(false); frame.getContentPane().remove((DownloadPanel) listener); frame.pack(); @@ -161,10 +161,10 @@ private JLabel header = new JLabel(); /** list of URLs being downloaded */ - private List urls = new ArrayList(); + private List urls = new ArrayList(); /** list of ProgressPanels */ - private List panels = new ArrayList(); + private List panels = new ArrayList(); /** @@ -199,7 +199,9 @@ /** * Update the download progress of a url. */ - protected void update(final URL url, final String version, final long readSoFar, final long total, final int overallPercent) { + protected void update(final URL url, final String version, + final long readSoFar, final long total, + final int overallPercent) { Runnable r = new Runnable() { public void run() { if (!urls.contains(url)) @@ -207,7 +209,7 @@ setOverallPercent(overallPercent); - ProgressPanel panel = (ProgressPanel) panels.get(urls.indexOf(url)); + ProgressPanel panel = panels.get(urls.indexOf(url)); panel.setProgress(readSoFar, total); panel.repaint(); } diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/cache/Resource.java --- a/netx/net/sourceforge/jnlp/cache/Resource.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/cache/Resource.java Thu Oct 21 00:21:09 2010 +0100 @@ -60,10 +60,10 @@ public static final int STARTED = 128; // enqueued or being worked on /** list of weak references of resources currently in use */ - private static WeakList resources = new WeakList(); + private static WeakList resources = new WeakList(); /** weak list of trackers monitoring this resource */ - private WeakList trackers = new WeakList(); + private WeakList trackers = new WeakList(); /** the remote location of the resource */ URL location; @@ -111,7 +111,7 @@ int index = resources.indexOf(resource); if (index >= 0) { // return existing object - Resource result = (Resource) resources.get(index); + Resource result = resources.get(index); if (result != null) return result; } @@ -136,9 +136,9 @@ */ ResourceTracker getTracker() { synchronized (trackers) { - List t = trackers.hardList(); + List t = trackers.hardList(); if (t.size() > 0) - return (ResourceTracker) t.get(0); + return t.get(0); return null; } @@ -225,7 +225,8 @@ */ public void addTracker(ResourceTracker tracker) { synchronized (trackers) { - List t = trackers.hardList(); // prevent GC between contains and add + // prevent GC between contains and add + List t = trackers.hardList(); if (!t.contains(tracker)) trackers.add(tracker); @@ -238,14 +239,14 @@ * download event. */ protected void fireDownloadEvent() { - List send; + List send; synchronized (trackers) { send = trackers.hardList(); } for (int i=0; i < send.size(); i++) { - ResourceTracker rt = (ResourceTracker) send.get(i); + ResourceTracker rt = send.get(i); rt.fireDownloadEvent(this); } } diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/cache/ResourceTracker.java --- a/netx/net/sourceforge/jnlp/cache/ResourceTracker.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/cache/ResourceTracker.java Thu Oct 21 00:21:09 2010 +0100 @@ -113,19 +113,21 @@ private static int threads = 0; /** weak list of resource trackers with resources to prefetch */ - private static WeakList prefetchTrackers = new WeakList(); + private static WeakList prefetchTrackers = + new WeakList(); /** resources requested to be downloaded */ - private static ArrayList queue = new ArrayList(); + private static ArrayList queue = new ArrayList(); /** resource trackers threads are working for (used for load balancing across multi-tracker downloads) */ - private static ArrayList active = new ArrayList(); // + private static ArrayList active = + new ArrayList(); // /** the resources known about by this resource tracker */ - private List resources = new ArrayList(); + private List resources = new ArrayList(); /** download listeners for this tracker */ - private List listeners = new ArrayList(); + private List listeners = new ArrayList(); /** whether to download parts before requested */ private boolean prefetch; @@ -293,7 +295,7 @@ protected void fireDownloadEvent(Resource resource) { DownloadListener l[] = null; synchronized (listeners) { - l = (DownloadListener[]) listeners.toArray(new DownloadListener[0]); + l = listeners.toArray(new DownloadListener[0]); } int status; @@ -865,7 +867,7 @@ // first find one to initialize synchronized (prefetchTrackers) { for (int i=0; i < prefetchTrackers.size() && result == null; i++) { - ResourceTracker tracker = (ResourceTracker) prefetchTrackers.get(i); + ResourceTracker tracker = prefetchTrackers.get(i); if (tracker == null) continue; @@ -907,12 +909,13 @@ * Calls to this method should be synchronized on lock and * source list.

*/ - private static Resource selectByFlag(List source, int flag, int notflag) { + private static Resource selectByFlag(List source, int flag, + int notflag) { Resource result = null; int score = Integer.MAX_VALUE; for (int i=0; i < source.size(); i++) { - Resource resource = (Resource) source.get(i); + Resource resource = source.get(i); boolean selectable = false; synchronized (resource) { @@ -924,7 +927,7 @@ int activeCount = 0; for (int j=0; j < active.size(); j++) - if ((ResourceTracker)active.get(j) == resource.getTracker()) + if (active.get(j) == resource.getTracker()) activeCount++; // try to spread out the downloads so that a slow host @@ -947,7 +950,7 @@ private Resource getResource(URL location) { synchronized (resources) { for (int i=0; i < resources.size(); i++) { - Resource resource = (Resource) resources.get(i); + Resource resource = resources.get(i); if (CacheUtil.urlEquals(resource.location, location)) return resource; diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java --- a/netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java Thu Oct 21 00:21:09 2010 +0100 @@ -57,7 +57,7 @@ private Container cont; /** weak references to the audio clips */ - private WeakList weakClips = new WeakList(); + private WeakList weakClips = new WeakList(); /** whether the applet has been started / displayed */ private boolean appletStarted = false; @@ -121,9 +121,9 @@ public void destroy() { destroyed = true; - List clips = weakClips.hardList(); + List clips = weakClips.hardList(); for (int i = 0; i < clips.size(); i++) { - ((AppletAudioClip)clips.get(i)).dispose(); + clips.get(i).dispose(); } } @@ -217,7 +217,7 @@ * Returns an enumeration that contains only the applet * from the JNLP file. */ - public Enumeration getApplets() { + public Enumeration getApplets() { checkDestroyed(); return Collections.enumeration( Arrays.asList(new Applet[] { applet }) ); @@ -293,7 +293,7 @@ /** * Required for JRE1.4, but not implemented yet. */ - public Iterator getStreamKeys() { + public Iterator getStreamKeys() { checkDestroyed(); return null; diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java --- a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Thu Oct 21 00:21:09 2010 +0100 @@ -77,7 +77,7 @@ private boolean stopped = false; /** weak list of windows opened by the application */ - private WeakList weakWindows = new WeakList(); + private WeakList weakWindows = new WeakList(); /** list of application listeners */ private EventListenerList listeners = new EventListenerList(); @@ -193,7 +193,7 @@ // Add to hashmap AccessControlContext acc = new AccessControlContext(new ProtectionDomain[] {pd}); - PrivilegedAction installProps = new PrivilegedAction() { + PrivilegedAction installProps = new PrivilegedAction() { public Object run() { for (int i=0; i < props.length; i++) { System.setProperty(props[i].getKey(), props[i].getValue()); @@ -236,7 +236,7 @@ try { // destroy resources for (int i=0; i < weakWindows.size(); i++) { - Window w = (Window) weakWindows.get(i); + Window w = weakWindows.get(i); if (w != null) w.dispose(); } diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/runtime/Boot.java --- a/netx/net/sourceforge/jnlp/runtime/Boot.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/runtime/Boot.java Thu Oct 21 00:21:09 2010 +0100 @@ -58,7 +58,7 @@ * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.21 $ */ -public final class Boot implements PrivilegedAction { +public final class Boot implements PrivilegedAction { // todo: decide whether a spawned netx (external launch) // should inherit the same options as this instance (store argv?) @@ -199,7 +199,7 @@ /** * The privileged part (jdk1.3 compatibility). */ - public Object run() { + public Void run() { JNLPRuntime.setBaseDir(getBaseDir()); JNLPRuntime.setSecurityEnabled(null == getOption("-nosecurity")); JNLPRuntime.initialize(true); @@ -418,7 +418,7 @@ * returned once for each occurrence. */ private static String[] getOptions(String option) { - List result = new ArrayList(); + List result = new ArrayList(); for (int i=0; i < args.length; i++) { if (option.equals(args[i])) { @@ -433,7 +433,7 @@ i++; } - return (String[]) result.toArray( new String[result.size()] ); + return result.toArray( new String[result.size()] ); } /** diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/runtime/Boot13.java --- a/netx/net/sourceforge/jnlp/runtime/Boot13.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/runtime/Boot13.java Thu Oct 21 00:21:09 2010 +0100 @@ -93,8 +93,8 @@ Thread.currentThread().setContextClassLoader(b); // try to prevent getting the non-policy version of classes - Class c = b.loadClass("net.sourceforge.jnlp.runtime.Boot"); - Method main = c.getDeclaredMethod("main", new Class[] {String[].class} ); + Class c = b.loadClass("net.sourceforge.jnlp.runtime.Boot"); + Method main = c.getDeclaredMethod("main", new Class[] {String[].class} ); main.invoke(null, new Object[] { args } ); } diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Thu Oct 21 00:21:09 2010 +0100 @@ -81,7 +81,8 @@ private static String R(String key) { return JNLPRuntime.getMessage(key); } /** map from JNLPFile url to shared classloader */ - private static Map urlToLoader = new HashMap(); // never garbage collected! + private static Map urlToLoader = + new HashMap(); // never garbage collected! /** the directory for native code */ private File nativeDir = null; // if set, some native code exists @@ -93,7 +94,7 @@ private AccessControlContext acc = AccessController.getContext(); /** the permissions for the cached jar files */ - private List resourcePermissions; + private List resourcePermissions; /** the app */ private ApplicationInstance app = null; // here for faster lookup in security manager @@ -123,27 +124,28 @@ private ArrayList runtimePermissions = new ArrayList(); /** all jars not yet part of classloader or active */ - private List available = new ArrayList(); + private List available = new ArrayList(); - /** all of the jar files that were verified */ - private ArrayList verifiedJars = null; + /** all of the jar files that were verified */ + private ArrayList verifiedJars = null; - /** all of the jar files that were not verified */ - private ArrayList unverifiedJars = null; + /** all of the jar files that were not verified */ + private ArrayList unverifiedJars = null; - /** the jarsigner tool to verify our jars */ - private JarSigner js = null; + /** the jarsigner tool to verify our jars */ + private JarSigner js = null; - private boolean signing = false; + private boolean signing = false; - /** ArrayList containing jar indexes for various jars available to this classloader */ - private ArrayList jarIndexes = new ArrayList(); + /** ArrayList containing jar indexes for various jars available to this classloader */ + private ArrayList jarIndexes = new ArrayList(); - /** File entries in the jar files available to this classloader */ - private TreeSet jarEntries = new TreeSet(); + /** File entries in the jar files available to this classloader */ + private TreeSet jarEntries = new TreeSet(); - /** Map of specific codesources to securitydesc */ - private HashMap jarLocationSecurityMap = new HashMap(); + /** Map of specific codesources to securitydesc */ + private HashMap jarLocationSecurityMap = + new HashMap(); /** * Create a new JNLPClassLoader from the specified file. @@ -273,7 +275,7 @@ String uniqueKey = file.getUniqueKey(); if (uniqueKey != null) - baseLoader = (JNLPClassLoader) urlToLoader.get(uniqueKey); + baseLoader = urlToLoader.get(uniqueKey); try { @@ -286,7 +288,7 @@ // New loader init may have caused extentions to create a // loader for this unique key. Check. - JNLPClassLoader extLoader = (JNLPClassLoader) urlToLoader.get(uniqueKey); + JNLPClassLoader extLoader = urlToLoader.get(uniqueKey); if (extLoader != null && extLoader != loader) { if (loader.signing && !extLoader.signing) @@ -328,7 +330,7 @@ */ public static JNLPClassLoader getInstance(URL location, String uniqueKey, Version version, UpdatePolicy policy) throws IOException, ParseException, LaunchException { - JNLPClassLoader loader = (JNLPClassLoader) urlToLoader.get(uniqueKey); + JNLPClassLoader loader = urlToLoader.get(uniqueKey); if (loader == null || !location.equals(loader.getJNLPFile().getFileLocation())) loader = getInstance(new JNLPFile(location, uniqueKey, version, false, policy), policy); @@ -342,7 +344,7 @@ void initializeExtensions() { ExtensionDesc[] ext = resources.getExtensions(); - List loaderList = new ArrayList(); + List loaderList = new ArrayList(); loaderList.add(this); @@ -359,14 +361,14 @@ } //} - loaders = (JNLPClassLoader[]) loaderList.toArray(new JNLPClassLoader[ loaderList.size()]); + loaders = loaderList.toArray(new JNLPClassLoader[loaderList.size()]); } /** * Make permission objects for the classpath. */ void initializePermissions() { - resourcePermissions = new ArrayList(); + resourcePermissions = new ArrayList(); JARDesc jars[] = resources.getJARs(); for (int i=0; i < jars.length; i++) { @@ -398,7 +400,7 @@ R("LCInit"), R("LFatalVerification"), "No jars!"); } */ - List initialJars = new ArrayList(); + List initialJars = new ArrayList(); for (int i=0; i < jars.length; i++) { @@ -585,7 +587,7 @@ // add in permission to read the cached JAR files for (int i=0; i < resourcePermissions.size(); i++) - result.add((Permission) resourcePermissions.get(i)); + result.add(resourcePermissions.get(i)); // add in the permissions that the user granted. for (int i=0; i < runtimePermissions.size(); i++) @@ -603,12 +605,12 @@ * to be loaded at the same time as the JARs specified (ie, are * in the same part). */ - protected void fillInPartJars(List jars) { + protected void fillInPartJars(List jars) { for (int i=0; i < jars.size(); i++) { - String part = ((JARDesc) jars.get(i)).getPart(); + String part = jars.get(i).getPart(); for (int a=0; a < available.size(); a++) { - JARDesc jar = (JARDesc) available.get(a); + JARDesc jar = available.get(a); if (part != null && part.equals(jar.getPart())) if (!jars.contains(jar)) @@ -625,15 +627,15 @@ * * @param jars the list of jars to load */ - protected void activateJars(final List jars) { - PrivilegedAction activate = new PrivilegedAction() { + protected void activateJars(final List jars) { + PrivilegedAction activate = new PrivilegedAction() { - public Object run() { + public Void run() { // transfer the Jars waitForJars(jars); for (int i=0; i < jars.size(); i++) { - JARDesc jar = (JARDesc) jars.get(i); + JARDesc jar = jars.get(i); available.remove(jar); @@ -653,10 +655,9 @@ // particularly when using The FileManager applet from Webmin. JarFile jarFile = new JarFile(localFile); - Enumeration e = jarFile.entries(); + Enumeration e = jarFile.entries(); while (e.hasMoreElements()) { - - JarEntry je = (JarEntry) e.nextElement(); + JarEntry je = e.nextElement(); // another jar in my jar? it is more likely than you think if (je.getName().endsWith(".jar")) { @@ -683,10 +684,10 @@ is.close(); extractedJar.close(); - + // 0 byte file? skip if (fileSize <= 0) { - continue; + continue; } JarSigner signer = new JarSigner(); @@ -739,8 +740,8 @@ // there is currently no mechanism to cache files per // instance.. so only index cached files if (localFile != null) { - JarIndex index = JarIndex.getJarIndex(new JarFile(localFile.getAbsolutePath()), null); - + JarIndex index = JarIndex.getJarIndex(new JarFile(localFile.getAbsolutePath()), + null); if (index != null) jarIndexes.add(index); } @@ -945,9 +946,9 @@ * classloader, or one of the classloaders for the JNLP file's * extensions. */ - public Class loadClass(String name) throws ClassNotFoundException { + public Class loadClass(String name) throws ClassNotFoundException { - Class result = findLoadedClassAll(name); + Class result = findLoadedClassAll(name); // try parent classloader if (result == null) { @@ -975,7 +976,9 @@ // Currently this loads jars directly from the site. We cannot cache it because this // call is initiated from within the applet, which does not have disk read/write permissions for (JarIndex index: jarIndexes) { - LinkedList jarList = index.get(name.replace('.', '/')); + // Non-generic code in sun.misc.JarIndex + @SuppressWarnings("unchecked") + LinkedList jarList = index.get(name.replace('.', '/')); if (jarList != null) { for (String jarName: jarList) { @@ -1090,11 +1093,12 @@ * Finds the resource in this, the parent, or the extension * class loaders. */ - public Enumeration findResources(String name) throws IOException { - Vector resources = new Vector(); + @Override + public Enumeration findResources(String name) throws IOException { + Vector resources = new Vector(); for (int i=0; i < loaders.length; i++) { - Enumeration e; + Enumeration e; if (loaders[i] == this) e = super.findResources(name); @@ -1151,13 +1155,11 @@ } // add jar - List jars = new ArrayList(); + List jars = new ArrayList(); jars.add(available.get(0)); fillInPartJars(jars); - - - activateJars(jars); + activateJars(jars); return this; } @@ -1166,6 +1168,7 @@ /** * @deprecated */ + @Deprecated public String getExtensionName() { String result = file.getInformation().getTitle(); @@ -1182,6 +1185,7 @@ /** * @deprecated */ + @Deprecated public String getExtensionHREF() { return file.getFileLocation().toString(); } diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java Thu Oct 21 00:21:09 2010 +0100 @@ -98,10 +98,11 @@ new SecurityException(JNLPRuntime.getMessage("RShutdown")); /** weak list of windows created */ - private WeakList weakWindows = new WeakList(); + private WeakList weakWindows = new WeakList(); /** weak list of applications corresponding to window list */ - private WeakList weakApplications = new WeakList(); + private WeakList weakApplications = + new WeakList(); /** weak reference to most app who's windows was most recently activated */ private WeakReference activeApplication = null; @@ -182,14 +183,14 @@ */ protected ApplicationInstance getApplication(Window window) { for (int i = weakWindows.size(); i-->0;) { - Window w = (Window) weakWindows.get(i); + Window w = weakWindows.get(i); if (w == null) { weakWindows.remove(i); weakApplications.remove(i); } if (w == window) - return (ApplicationInstance) weakApplications.get(i); + return weakApplications.get(i); } return null; @@ -436,7 +437,7 @@ if (JNLPRuntime.isDebug()) System.err.println("SM: app: "+app.getTitle()+" is adding a window: "+window); - weakWindows.add(window); // for mapping window -> app + weakWindows.add(w); // for mapping window -> app weakApplications.add(app); app.addWindow(w); diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/services/ServiceUtil.java --- a/netx/net/sourceforge/jnlp/services/ServiceUtil.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/services/ServiceUtil.java Thu Oct 21 00:21:09 2010 +0100 @@ -182,7 +182,7 @@ System.err.println(" arg: "+args[i]); } - PrivilegedExceptionAction invoker = new PrivilegedExceptionAction() { + PrivilegedExceptionAction invoker = new PrivilegedExceptionAction() { public Object run() throws Exception { return method.invoke(receiver, args); } diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/services/XPersistenceService.java --- a/netx/net/sourceforge/jnlp/services/XPersistenceService.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/services/XPersistenceService.java Thu Oct 21 00:21:09 2010 +0100 @@ -138,7 +138,7 @@ if (!file.isDirectory()) return new String[0]; - List result = new ArrayList(); + List result = new ArrayList(); // check whether this is right: only add files and not directories. File entries[] = file.listFiles(); @@ -146,7 +146,7 @@ if (entries[i].isFile()) result.add(entries[i].getName()); - return (String[]) result.toArray(new String[result.size()]); + return result.toArray(new String[result.size()]); } /** diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/tools/JarSigner.java --- a/netx/net/sourceforge/jnlp/tools/JarSigner.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/tools/JarSigner.java Thu Oct 21 00:21:09 2010 +0100 @@ -204,7 +204,7 @@ certs = new ArrayList(); for (int i = 0; i < jars.size(); i++) { - JARDesc jar = (JARDesc) jars.get(i); + JARDesc jar = jars.get(i); verifiedJars = new ArrayList(); unverifiedJars = new ArrayList(); diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/util/WeakList.java --- a/netx/net/sourceforge/jnlp/util/WeakList.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/util/WeakList.java Thu Oct 21 00:21:09 2010 +0100 @@ -32,10 +32,10 @@ * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.3 $ */ -public class WeakList extends AbstractList { +public class WeakList extends AbstractList { /* list of weak references */ - private ArrayList refs = new ArrayList(); + private ArrayList> refs = new ArrayList>(); /** @@ -47,9 +47,9 @@ /** * Extract the hard reference out of a weak reference. */ - private Object deref(Object o) { - if (o != null && o instanceof WeakReference) - return ((WeakReference)o).get(); + private E deref(WeakReference o) { + if (o != null) + return o.get(); else return null; } @@ -58,7 +58,7 @@ * Returns the object at the specified index, or null if the * object has been collected. */ - public Object get(int index) { + public E get(int index) { return deref(refs.get(index)); } @@ -75,23 +75,23 @@ * previous object at that position or null if it was already * collected. */ - public Object set(int index, Object element) { - return deref(refs.set(index, new WeakReference(element))); + public E set(int index, E element) { + return deref(refs.set(index, new WeakReference(element))); } /** * Inserts the object at the specified position in the list. * Automatically creates a weak reference to the object. */ - public void add(int index, Object element) { - refs.add(index, new WeakReference(element)); + public void add(int index, E element) { + refs.add(index, new WeakReference(element)); } /** * Removes the object at the specified position and returns it * or returns null if it was already collected. */ - public Object remove(int index) { + public E remove(int index) { return deref(refs.remove(index)); } @@ -100,11 +100,11 @@ * returned list does not include the collected elements, so its * indices do not necessarily correlate with those of this list. */ - public List hardList() { - List result = new ArrayList(); + public List hardList() { + List result = new ArrayList(); for (int i=0; i < size(); i++) { - Object tmp = get(i); + E tmp = get(i); if (tmp != null) result.add(tmp); diff -r 1b3abd2b1e4f netx/net/sourceforge/nanoxml/XMLElement.java --- a/netx/net/sourceforge/nanoxml/XMLElement.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/nanoxml/XMLElement.java Thu Oct 21 00:21:09 2010 +0100 @@ -106,7 +106,7 @@ *
  • The keys and the values are strings. * */ - private Hashtable attributes; + private Hashtable attributes; /** @@ -119,7 +119,7 @@ * or a subclass of XMLElement. * */ - private Vector children; + private Vector children; /** @@ -162,7 +162,7 @@ *
  • The values are char arrays * */ - private Hashtable entities; + private Hashtable entities; /** @@ -242,7 +242,7 @@ */ public XMLElement() { - this(new Hashtable(), false, true, true); + this(new Hashtable(), false, true, true); } @@ -284,7 +284,7 @@ *
    * */ - protected XMLElement(Hashtable entities, + protected XMLElement(Hashtable entities, boolean skipLeadingWhitespace, boolean fillBasicConversionTable, boolean ignoreCase) @@ -293,17 +293,16 @@ this.ignoreCase = ignoreCase; this.name = null; this.contents = ""; - this.attributes = new Hashtable(); - this.children = new Vector(); + this.attributes = new Hashtable(); + this.children = new Vector(); this.entities = entities; this.lineNr = 0; - Enumeration e = this.entities.keys(); + Enumeration e = this.entities.keys(); while (e.hasMoreElements()) { - Object key = e.nextElement(); + String key = e.nextElement(); Object value = this.entities.get(key); if (value instanceof String) { - value = ((String) value).toCharArray(); - this.entities.put(key, value); + entities.put(key, ((String) value).toCharArray()); } } if (fillBasicConversionTable) { @@ -1096,7 +1095,7 @@ } buf.append(ch); } else { - char[] value = (char[]) this.entities.get(key); + char[] value = entities.get(key); if (value == null) { throw this.unknownEntity(key); } From ahughes at redhat.com Wed Oct 20 16:24:09 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Thu, 21 Oct 2010 00:24:09 +0100 Subject: [patch, icedtea-web] Don't include copies of jni.h and jni_md.h In-Reply-To: <4CBF6BE4.3030803@ubuntu.com> References: <4CBF6BE4.3030803@ubuntu.com> Message-ID: <20101020232409.GJ24339@rivendell.middle-earth.co.uk> On 00:23 Thu 21 Oct , Matthias Klose wrote: > These headers are included in every JDK_HOME, no need to carry local copies. > > Matthias My worry with doing this is that we rely on the bootstrap JDK for these files. I've encountered issues with using the gcj versions for example, though gcj isn't supported for other reasons too at present (masses of internal Oracle code usage). But if it works reliably, please commit. It would be better if the new include was on the next line as that line is a bit wide as is. > diff -r 1b3abd2b1e4f ChangeLog > --- a/ChangeLog Wed Oct 20 16:52:44 2010 -0400 > +++ b/ChangeLog Thu Oct 21 00:17:46 2010 +0200 > @@ -1,3 +1,8 @@ > +2010-10-20 Matthias Klose > + > + * Makefile.am (LAUNCHER_FLAGS): Add -I$(BOOT_DIR)/include. > + * launcher/jni.h, launcher/jni_md.h: Remove. > + > 2010-10-20 Omair Majid > > * AUTHORS: Add Francis Kung, Andrew Su, Joshua Sumali, Mark Wielaard and > diff -r 1b3abd2b1e4f Makefile.am > --- a/Makefile.am Wed Oct 20 16:52:44 2010 -0400 > +++ b/Makefile.am Thu Oct 21 00:17:46 2010 +0200 > @@ -96,7 +96,7 @@ > PLUGIN_LAUNCHER_OBJECTS = $(addprefix $(PLUGIN_DIR)/launcher/,$(LAUNCHER_OBJECTS)) > NETX_LAUNCHER_OBJECTS = $(addprefix $(NETX_DIR)/launcher/,$(LAUNCHER_OBJECTS)) > LAUNCHER_FLAGS = -O2 -fno-strict-aliasing -fPIC -W -Wall -Wno-unused -Wno-parentheses -pipe -fno-omit-frame-pointer \ > - -g -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT -DLAUNCHER_NAME='"java"' -I$(LAUNCHER_SRCDIR) \ > + -g -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT -DLAUNCHER_NAME='"java"' -I$(LAUNCHER_SRCDIR) -I$(BOOT_DIR)/include \ > -DJDK_MAJOR_VERSION='"1"' -DJDK_MINOR_VERSION='"6"' -DLIBARCHNAME='"$(JRE_ARCH_DIR)"' > LAUNCHER_LINK = -o $@ -Xlinker -O1 -Xlinker -z -Xlinker defs -L$(BOOT_DIR)/lib/$(INSTALL_ARCH_DIR) \ > -Wl,-soname=lib.so -L $(BOOT_DIR)/jre/lib/$(INSTALL_ARCH_DIR)/jli -Wl,-z -Wl,origin \ -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From bugzilla-daemon at icedtea.classpath.org Thu Oct 21 01:45:37 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 21 Oct 2010 08:45:37 +0000 Subject: [Bug 579] New: hs19 fails to build on powerpc Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=579 Summary: hs19 fails to build on powerpc Product: IcedTea Version: 6-hg Platform: all OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: Zero AssignedTo: unassigned at icedtea.classpath.org ReportedBy: doko at ubuntu.com dl failure on line 696Error: failed /build/buildd/openjdk-6-6b20-1.10~pre2/build/openjdk.build-ecj/j2sdk-image/jre/lib/ppc/server/libjvm.so, because /build/buildd/openjdk-6-6b20-1.10~pre2/build/openjdk.build-ecj/j2sdk-image/jre/lib/ppc/server/libjvm.so: undefined symbol: _ZNK5frame29interpreter_frame_mirror_addrEv /build/buildd/openjdk-6-6b20-1.10~pre2/build/bootstrap/jdk1.6.0/bin/java cannot be found or is corrupted. make[1]: *** [stamps/bootstrap-directory-symlink.stamp] Error 1 src/share/vm/runtime/frame.hpp has: #ifdef PPC oop* interpreter_frame_mirror_addr() const; #endif and it's used in frame.cpp (oops_interpreted_do), not defined anywhere. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From ahughes at redhat.com Thu Oct 21 03:29:07 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Thu, 21 Oct 2010 11:29:07 +0100 Subject: The Road to 1.10 Message-ID: <20101021102907.GA5809@bree.redhat.com> OpenJDK b21 should be available sometime in the next month or so. I'd like us to release IcedTea6 1.10 about a week after, allowing time for testing, etc. With the change to HotSpot 19 as default (added on Tuesday), current IcedTea6 HEAD is now pretty much inline with b21, through this and our other patches. So the b21 bump will be just a matter of switching to the new tarball. You can track progress on b21 using the hg branch: http://icedtea.classpath.org/hg/icedtea6-hg. Major changes in 1.10: * Upgrade to HotSpot 19 (on HEAD) and OpenJDK6 b21 (imminent) * NetX and plugin removed; now in the IcedTea6 web project (on HEAD) * Shark removed; part of HotSpot 19 (on the hg branch). * Split of --with-openjdk into --with-jdk-home and --disable-bootstrap options (on HEAD). I plan on doing a long-delayed sweep of patch and macro names for consistency, but other than that, any further build changes will now be delayed until 1.11. When b21 is released, we'll switch to it on HEAD and then branch for testing of 1.10. Deepak, I'd like the first release of IcedTea-Web (1.0) to happen in the same timeframe (preferably before the 1.10 release) so we don't end up with an orphaned plugin and NetX implementation. For my part, I still need to add some configure checks and documentation generation to the repository which I'll try and get done over the next week. -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From doko at ubuntu.com Thu Oct 21 04:44:57 2010 From: doko at ubuntu.com (Matthias Klose) Date: Thu, 21 Oct 2010 13:44:57 +0200 Subject: The Road to 1.10 In-Reply-To: <20101021102907.GA5809@bree.redhat.com> References: <20101021102907.GA5809@bree.redhat.com> Message-ID: <4CC027B9.6090200@ubuntu.com> On 21.10.2010 12:29, Dr Andrew John Hughes wrote: > OpenJDK b21 should be available sometime in the next month or so. I'd > like us to release IcedTea6 1.10 about a week after, allowing time for > testing, etc. > > With the change to HotSpot 19 as default (added on Tuesday), current > IcedTea6 HEAD is now pretty much inline with b21, through this and our > other patches. So the b21 bump will be just a matter of switching to > the new tarball. You can track progress on b21 using the hg branch: > http://icedtea.classpath.org/hg/icedtea6-hg. > > Major changes in 1.10: > > * Upgrade to HotSpot 19 (on HEAD) and OpenJDK6 b21 (imminent) which fails to build on powerpc. looks like an upstream issue. see icedtea#579. Matthias From bugzilla-daemon at icedtea.classpath.org Thu Oct 21 05:11:33 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 21 Oct 2010 12:11:33 +0000 Subject: [Bug 579] hs19 fails to build on powerpc Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=579 gnu_andrew at member.fsf.org changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |blocker Status|NEW |ASSIGNED Platform|all |ppc Target Milestone|--- |6-1.10 ------- Comment #1 from gnu_andrew at member.fsf.org 2010-10-21 12:11 ------- Confirmed: rm -f /home/andrew/builder/icedtea6/bootstrap/jdk1.6.0 ln -sf /home/andrew/builder/icedtea6/bootstrap/icedtea /home/andrew/builder/icedtea6/bootstrap/jdk1.6.0; \ if ! /home/andrew/builder/icedtea6/bootstrap/jdk1.6.0/bin/java -version ; \ then \ echo "/home/andrew/builder/icedtea6/bootstrap/jdk1.6.0/bin/java" \ "cannot be found or is corrupted." ; \ exit 1; \ fi dl failure on line 696Error: failed /mnt/builder/icedtea6/openjdk.build-ecj/j2sdk-image/jre/lib/ppc/server/libjvm.so, because /mnt/builder/icedtea6/openjdk.build-ecj/j2sdk-image/jre/lib/ppc/server/libjvm.so: undefined symbol: _ZNK5frame29interpreter_frame_mirror_addrEv /home/andrew/builder/icedtea6/bootstrap/jdk1.6.0/bin/java cannot be found or is corrupted. make: *** [stamps/bootstrap-directory-symlink.stamp] Error 1 Assigning to Gary and moving to blocker status; we can't release 1.10 with this issue. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Thu Oct 21 05:11:53 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 21 Oct 2010 12:11:53 +0000 Subject: [Bug 579] hs19 fails to build on powerpc Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=579 gnu_andrew at member.fsf.org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at icedtea.classpath|gbenson at redhat.com |.org | Status|ASSIGNED |NEW -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. You are the assignee for the bug, or are watching the assignee. From omajid at redhat.com Thu Oct 21 07:21:41 2010 From: omajid at redhat.com (Omair Majid) Date: Thu, 21 Oct 2010 10:21:41 -0400 Subject: [icedtea-web] RFC: Fix warnings generated by NetX code In-Reply-To: <20101020232118.GI24339@rivendell.middle-earth.co.uk> References: <20101020232118.GI24339@rivendell.middle-earth.co.uk> Message-ID: <4CC04C75.8050105@redhat.com> Hi, On 10/20/2010 07:21 PM, Dr Andrew John Hughes wrote: > The attached patch cuts the warnings for NetX down from over 100 to a > paltry 11 (and some of those are caused by Oracle's code). > Thanks for doing this. This should make the code much easier to read and understand. > Ok for HEAD? > Looks good to me. Please go ahead and commit. Thanks! Omair From omajid at redhat.com Thu Oct 21 07:33:09 2010 From: omajid at redhat.com (Omair Majid) Date: Thu, 21 Oct 2010 10:33:09 -0400 Subject: [RFC] netx: add support for parsing and saving deployment.config files In-Reply-To: <4CBC6C17.6090602@redhat.com> References: <4CBC6C17.6090602@redhat.com> Message-ID: <4CC04F25.9040906@redhat.com> On 10/18/2010 11:47 AM, Omair Majid wrote: > Hi, > > As described on [1], The Java Plug-in and Java Web Start support using > various deployment.properties and deployment.config files to set > behaviour of these tools. The patch adds support for parsing and saving > these files to netx. This patch does not actually use any of these > settings; it just adds support so other parts of netx can start using them. > > This was filed as a bug by someone against the original netx project [2]. > > Any comments or concerns? > > Thanks, > Omair > > [1] > http://download.oracle.com/javase/1.5.0/docs/guide/deployment/deployment-guide/properties.html > > [2] > http://sourceforge.net/tracker/?func=detail&aid=2832947&group_id=72541&atid=534854 > Anyone? Any comments? Thanks, Omair From dbhole at redhat.com Thu Oct 21 07:41:23 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Thu, 21 Oct 2010 10:41:23 -0400 Subject: The Road to 1.10 In-Reply-To: <20101021102907.GA5809@bree.redhat.com> References: <20101021102907.GA5809@bree.redhat.com> Message-ID: <20101021144122.GB24712@redhat.com> * Dr Andrew John Hughes [2010-10-21 06:29]: > OpenJDK b21 should be available sometime in the next month or so. I'd > like us to release IcedTea6 1.10 about a week after, allowing time for > testing, etc. > > With the change to HotSpot 19 as default (added on Tuesday), current > IcedTea6 HEAD is now pretty much inline with b21, through this and our > other patches. So the b21 bump will be just a matter of switching to > the new tarball. You can track progress on b21 using the hg branch: > http://icedtea.classpath.org/hg/icedtea6-hg. > > Major changes in 1.10: > > * Upgrade to HotSpot 19 (on HEAD) and OpenJDK6 b21 (imminent) > * NetX and plugin removed; now in the IcedTea6 web project (on HEAD) > * Shark removed; part of HotSpot 19 (on the hg branch). > * Split of --with-openjdk into --with-jdk-home and --disable-bootstrap options (on HEAD). > > I plan on doing a long-delayed sweep of patch and macro names for consistency, > but other than that, any further build changes will now be delayed until 1.11. > > When b21 is released, we'll switch to it on HEAD and then branch for testing of 1.10. > > Deepak, I'd like the first release of IcedTea-Web (1.0) to happen in the same timeframe > (preferably before the 1.10 release) so we don't end up with an orphaned plugin and NetX > implementation. For my part, I still need to add some configure checks and documentation > generation to the repository which I'll try and get done over the next week. Agreed. I think it'd be good to release a 1.0 for the plugin/webstart to coincide with icedtea 1.10 as well. There have been some nice improvements since 1.9 in the plugin and webstart, worthy of a tag. Cheers, Deepak > -- > Andrew :) > > Free Java Software Engineer > Red Hat, Inc. (http://www.redhat.com) > > Support Free Java! > Contribute to GNU Classpath and the OpenJDK > http://www.gnu.org/software/classpath > http://openjdk.java.net > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From andrew at icedtea.classpath.org Thu Oct 21 07:45:06 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Thu, 21 Oct 2010 14:45:06 +0000 Subject: /hg/icedtea6-hg: 4 new changesets Message-ID: changeset a85679cc93f4 in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=a85679cc93f4 author: Andrew John Hughes date: Tue Oct 19 19:55:35 2010 +0100 Move NetX and the plugin to the IcedTea-Web project. 2010-10-19 Andrew John Hughes Move NetX and the plugin to the IcedTea-Web project: http://icedtea.classpath.org/hg/icedtea-web * extra/net/sourceforge/jnlp/about/HTMLPanel.java, * extra/net/sourceforge/jnlp/about/Main.java, * extra/net/sourceforge/jnlp/about/resources/about.html, * extra/net/sourceforge/jnlp/about/resources/applications.html, * extra/net/sourceforge/jnlp/about/resources/notes.html, * javaws.desktop, * netx/javaws.1, * netx/javax/jnlp/BasicService.java, * netx/javax/jnlp/ClipboardService.java, * netx/javax/jnlp/DownloadService.java, * netx/javax/jnlp/DownloadServiceListener.java, * netx/javax/jnlp/ExtendedService.java, * netx/javax/jnlp/ExtensionInstallerService.java, * netx/javax/jnlp/FileContents.java, * netx/javax/jnlp/FileOpenService.java, * netx/javax/jnlp/FileSaveService.java, * netx/javax/jnlp/JNLPRandomAccessFile.java, * netx/javax/jnlp/PersistenceService.java, * netx/javax/jnlp/PrintService.java, * netx/javax/jnlp/ServiceManager.java, * netx/javax/jnlp/ServiceManagerStub.java, * netx/javax/jnlp/SingleInstanceListener.java, * netx/javax/jnlp/SingleInstanceService.java, * netx/javax/jnlp/UnavailableServiceException.java, * netx/net/sourceforge/jnlp/AppletDesc.java, * netx/net/sourceforge/jnlp/ApplicationDesc.java, * netx/net/sourceforge/jnlp/AssociationDesc.java, * netx/net/sourceforge/jnlp/ComponentDesc.java, * netx/net/sourceforge/jnlp/DefaultLaunchHandler.java, * netx/net/sourceforge/jnlp/ExtensionDesc.java, * netx/net/sourceforge/jnlp/IconDesc.java, * netx/net/sourceforge/jnlp/InformationDesc.java, * netx/net/sourceforge/jnlp/InstallerDesc.java, * netx/net/sourceforge/jnlp/JARDesc.java, * netx/net/sourceforge/jnlp/JNLPFile.java, * netx/net/sourceforge/jnlp/JNLPSplashScreen.java, * netx/net/sourceforge/jnlp/JREDesc.java, * netx/net/sourceforge/jnlp/LaunchException.java, * netx/net/sourceforge/jnlp/LaunchHandler.java, * netx/net/sourceforge/jnlp/Launcher.java, * netx/net/sourceforge/jnlp/MenuDesc.java, * netx/net/sourceforge/jnlp/NetxPanel.java, * netx/net/sourceforge/jnlp/Node.java, * netx/net/sourceforge/jnlp/PackageDesc.java, * netx/net/sourceforge/jnlp/ParseException.java, * netx/net/sourceforge/jnlp/Parser.java, * netx/net/sourceforge/jnlp/PluginBridge.java, * netx/net/sourceforge/jnlp/PropertyDesc.java, * netx/net/sourceforge/jnlp/RelatedContentDesc.java, * netx/net/sourceforge/jnlp/ResourcesDesc.java, * netx/net/sourceforge/jnlp/SecurityDesc.java, * netx/net/sourceforge/jnlp/ShortcutDesc.java, * netx/net/sourceforge/jnlp/StreamEater.java, * netx/net/sourceforge/jnlp/UpdateDesc.java, * netx/net/sourceforge/jnlp/Version.java, * netx/net/sourceforge/jnlp/cache/CacheEntry.java, * netx/net/sourceforge/jnlp/cache/CacheUtil.java, * netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java, * netx/net/sourceforge/jnlp/cache/DownloadIndicator.java, * netx/net/sourceforge/jnlp/cache/Resource.java, * netx/net/sourceforge/jnlp/cache/ResourceTracker.java, * netx/net/sourceforge/jnlp/cache/UpdatePolicy.java, * netx/net/sourceforge/jnlp/cache/package.html, * netx/net/sourceforge/jnlp/event/ApplicationEvent.java, * netx/net/sourceforge/jnlp/event/ApplicationListener.java, * netx/net/sourceforge/jnlp/event/DownloadEvent.java, * netx/net/sourceforge/jnlp/event/DownloadListener.java, * netx/net/sourceforge/jnlp/event/package.html, * netx/net/sourceforge/jnlp/package.html, * netx/net/sourceforge/jnlp/resources/Manifest.mf, * netx/net/sourceforge/jnlp/resources/Messages.properties, * netx/net/sourceforge/jnlp/resources/about.jnlp, * netx/net/sourceforge/jnlp/resources/default.jnlp, * netx/net/sourceforge/jnlp/runtime/AppThreadGroup.java, * netx/net/sourceforge/jnlp/runtime/AppletAudioClip.java, * netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java, * netx/net/sourceforge/jnlp/runtime/AppletInstance.java, * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java, * netx/net/sourceforge/jnlp/runtime/Boot.java, * netx/net/sourceforge/jnlp/runtime/Boot13.java, * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java, * netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java, * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java, * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java, * netx/net/sourceforge/jnlp/runtime/package.html, * netx/net/sourceforge/jnlp/security/AccessWarningPane.java, * netx/net/sourceforge/jnlp/security/AppletWarningPane.java, * netx/net/sourceforge/jnlp/security/CertVerifier.java, * netx/net/sourceforge/jnlp/security/CertWarningPane.java, * netx/net/sourceforge/jnlp/security/CertsInfoPane.java, * netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java, * netx/net/sourceforge/jnlp/security/MoreInfoPane.java, * netx/net/sourceforge/jnlp/security/NotAllSignedWarningPane.java, * netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java, * netx/net/sourceforge/jnlp/security/SecurityUtil.java, * netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java, * netx/net/sourceforge/jnlp/security/SingleCertInfoPane.java, * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java, * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java, * netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java, * netx/net/sourceforge/jnlp/services/ExtendedSingleInstanceService.jav a, * netx/net/sourceforge/jnlp/services/InstanceExistsException.java, * netx/net/sourceforge/jnlp/services/ServiceUtil.java, * netx/net/sourceforge/jnlp/services/SingleInstanceLock.java, * netx/net/sourceforge/jnlp/services/XBasicService.java, * netx/net/sourceforge/jnlp/services/XClipboardService.java, * netx/net/sourceforge/jnlp/services/XDownloadService.java, * netx/net/sourceforge/jnlp/services/XExtendedService.java, * netx/net/sourceforge/jnlp/services/XExtensionInstallerService.java, * netx/net/sourceforge/jnlp/services/XFileContents.java, * netx/net/sourceforge/jnlp/services/XFileOpenService.java, * netx/net/sourceforge/jnlp/services/XFileSaveService.java, * netx/net/sourceforge/jnlp/services/XJNLPRandomAccessFile.java, * netx/net/sourceforge/jnlp/services/XPersistenceService.java, * netx/net/sourceforge/jnlp/services/XPrintService.java, * netx/net/sourceforge/jnlp/services/XServiceManagerStub.java, * netx/net/sourceforge/jnlp/services/XSingleInstanceService.java, * netx/net/sourceforge/jnlp/services/package.html, * netx/net/sourceforge/jnlp/tools/CharacterEncoder.java, * netx/net/sourceforge/jnlp/tools/HexDumpEncoder.java, * netx/net/sourceforge/jnlp/tools/JarRunner.java, * netx/net/sourceforge/jnlp/tools/JarSigner.java, * netx/net/sourceforge/jnlp/tools/JarSignerResources.java, * netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java, * netx/net/sourceforge/jnlp/tools/KeyTool.java, * netx/net/sourceforge/jnlp/util/FileUtils.java, * netx/net/sourceforge/jnlp/util/PropertiesFile.java, * netx/net/sourceforge/jnlp/util/Reflect.java, * netx/net/sourceforge/jnlp/util/WeakList.java, * netx/net/sourceforge/jnlp/util/XDesktopEntry.java, * netx/net/sourceforge/nanoxml/XMLElement.java, * netx/net/sourceforge/nanoxml/XMLParseException.java, * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc, * plugin/icedteanp/IcedTeaJavaRequestProcessor.h, * plugin/icedteanp/IcedTeaNPPlugin.cc, * plugin/icedteanp/IcedTeaNPPlugin.h, * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc, * plugin/icedteanp/IcedTeaPluginRequestProcessor.h, * plugin/icedteanp/IcedTeaPluginUtils.cc, * plugin/icedteanp/IcedTeaPluginUtils.h, * plugin/icedteanp/IcedTeaRunnable.cc, * plugin/icedteanp/IcedTeaRunnable.h, * plugin/icedteanp/IcedTeaScriptablePluginObject.cc, * plugin/icedteanp/IcedTeaScriptablePluginObject.h, * plugin/icedteanp/java/netscape/javascript/JSException.java, * plugin/icedteanp/java/netscape/javascript/JSObject.java, * plugin/icedteanp/java/netscape/javascript/JSObjectCreatePermission.j ava, * plugin/icedteanp/java/netscape/javascript/JSProxy.java, * plugin/icedteanp/java/netscape/javascript/JSRunnable.java, * plugin/icedteanp/java/netscape/javascript/JSUtil.java, * plugin/icedteanp/java/netscape/security/ForbiddenTargetException.jav a, * plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java, * plugin/icedteanp/java/sun/applet/GetMemberPluginCallRequest.java, * plugin/icedteanp/java/sun/applet/GetWindowPluginCallRequest.java, * plugin/icedteanp/java/sun/applet/JavaConsole.java, * plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java, * plugin/icedteanp/java/sun/applet/PasswordAuthenticationDialog.java, * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java, * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java, * plugin/icedteanp/java/sun/applet/PluginCallRequest.java, * plugin/icedteanp/java/sun/applet/PluginCallRequestFactory.java, * plugin/icedteanp/java/sun/applet/PluginClassLoader.java, * plugin/icedteanp/java/sun/applet/PluginCookieInfoRequest.java, * plugin/icedteanp/java/sun/applet/PluginCookieManager.java, * plugin/icedteanp/java/sun/applet/PluginDebug.java, * plugin/icedteanp/java/sun/applet/PluginException.java, * plugin/icedteanp/java/sun/applet/PluginMain.java, * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java, * plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java, * plugin/icedteanp/java/sun/applet/PluginObjectStore.java, * plugin/icedteanp/java/sun/applet/PluginProxyInfoRequest.java, * plugin/icedteanp/java/sun/applet/PluginProxySelector.java, * plugin/icedteanp/java/sun/applet/PluginStreamHandler.java, * plugin/icedteanp/java/sun/applet/RequestQueue.java, * plugin/icedteanp/java/sun/applet/TestEnv.java, * plugin/icedteanp/java/sun/applet/VoidPluginCallRequest.java, * plugin/tests/LiveConnect/DummyObject.java, * plugin/tests/LiveConnect/OverloadTestHelper1.java, * plugin/tests/LiveConnect/OverloadTestHelper2.java, * plugin/tests/LiveConnect/OverloadTestHelper3.java, * plugin/tests/LiveConnect/PluginTest.java, * plugin/tests/LiveConnect/build, * plugin/tests/LiveConnect/common.js, * plugin/tests/LiveConnect/index.html, * plugin/tests/LiveConnect/jjs_eval_test.js, * plugin/tests/LiveConnect/jjs_func_parameters_tests.js, * plugin/tests/LiveConnect/jjs_func_rettype_tests.js, * plugin/tests/LiveConnect/jjs_get_tests.js, * plugin/tests/LiveConnect/jjs_set_tests.js, * plugin/tests/LiveConnect/jsj_func_overload_tests.js, * plugin/tests/LiveConnect/jsj_func_parameters_tests.js, * plugin/tests/LiveConnect/jsj_func_rettype_tests.js, * plugin/tests/LiveConnect/jsj_get_tests.js, * plugin/tests/LiveConnect/jsj_set_tests.js, * plugin/tests/LiveConnect/jsj_type_casting_tests.js, * plugin/tests/LiveConnect/jsj_type_conversion_tests.js, * patches/extensions/liveconnect.patch: Removed. * Makefile.am: Removed aliases for dead targets. (NETX_SRCDIR): Removed. (NETX_RESOURCE_DIR): Likewise. (NETX_EXTRA_DIR): Likewise. (NETX_BOOTSTRAP_CLASSES): Likewise. (PLUGIN_BOOTSTRAP_CLASSES): Likewise. (NETX_SUN_CLASSES): Likewise. (PLUGIN_SUN_CLASSES): Likewise. (ICEDTEA_BOOTSTRAP_CLASSES): Remove above four variables. (ICEDTEAPLUGIN_CLEAN): Removed. (LIVECONNECT_DIR): Removed. (PLUGIN_DIR): Removed. (PLUGIN_SRCDIR): Removed. (LIVECONNECT_SRCS): Removed. (ICEDTEAPLUGIN_TARGET): Removed. (PLUGIN_TEST_SRCS): Removed. (ICEDTEA_PATCHES): Drop liveconnect.patch. (PLUGIN_VERSION): Removed. (EXTRA_DIST): Drop extra javaws.png javaws.desktop plugin netx. (clean-local): Remove dead targets. (.PHONY): Likewise. (icedtea-against- icedtea): Likewise. (clean-icedtea-against-icedtea): Likewise. (icedtea-debug-against-icedtea): Likewise. (clean-icedtea-debug-against-icedtea): Likewise. (add- plugin): Dropped. (clean-add-plugin): Likewise. (add-plugin-debug): Likewise. (clean-add-plugin-debug): Likewise. (add-netx): Dropped. (clean-add-netx): Likewise. (add-netx-debug): Likewise. (clean-add- netx-debug): Likewise. (icedtea-against-ecj): Drop dead targets. (clean-icedtea-against-ecj): Likewise. (add-plugin-ecj): Likewise. (clean-add-plugin-ecj): Likewise. (add-netx-ecj): Dropped. (clean-add-netx- ecj): Likewise. (PLUGIN_SRC): Removed. (PLUGIN_OBJECTS): Removed. ($(PLUGIN_DIR)/%.o)): Removed. ($(PLUGIN_DIR)/IcedTeaPlugin.so): Removed. (clean- IcedTeaPlugin): Likewise. (plugin): Likewise. (clean-plugin): Likewise. (liveconnect-source-files.txt): Likewise. (liveconnect): Likewise. (liveconnect- dist): Likewise. (clean-liveconnect): Likewise. (netx-source-files.txt): Likewise. (netx): Likewise. (netx-dist): Likewise. (clean-netx): Likewise. (extra-source-files.txt): Likewise. (extra-class-files): Likewise. (clean-extra): Likewise. (extra- lib/about.jar): Likewise. (ADD_ZERO_CONFIGURE_ARGS): Remove dead --disable-plugin. (plugin-tests): Removed. * acinclude.m4: (IT_CHECK_PLUGIN): Removed. (IT_CHECK_PLUGIN_DEPENDENCIES): Likewise. (IT_CHECK_XULRUNNER_VERSION): Likewise. * configure.ac: Don't call IT_CHECK_XULRUNNER_VERSION. changeset 5327c5405c78 in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=5327c5405c78 author: Andrew John Hughes date: Tue Oct 19 21:27:47 2010 +0100 Make HotSpot 19 the default. Update documentation to reflect recent changes. 2010-10-19 Andrew John Hughes * INSTALL: Drop plugin dependencies. Document new JDK detection. Drop removed options from VisualVM and the plugin. Mention new hs19 default. * README: Updated. Remove sections on plugin and NetX. Update Zero&Shark section. * NEWS: Add HotSpot 19, NetX & plugin removal, Shark upstreaming and JDK detection/bootstrapping changes. * acinclude.m4: (AC_CHECK_WITH_HOTSPOT_BUILD): Set DEFAULT_BUILD to hs19 rather than the non-existent hs16 (used when --with-hotspot-build or --with-hotspot-build=yes is passed). Introduce ALTERNATE_BUILD to refer to the build enabled by --with- hotspot-build, which is 'original' (hs17) at present. changeset 0bfb4898c039 in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=0bfb4898c039 author: Andrew John Hughes date: Wed Oct 20 14:45:55 2010 +0100 Don't abuse DEFAULT_BUILD in the HotSpot build macro. 2010-10-19 Andrew John Hughes * INSTALL: Clarify HotSpot build documentation. * acinclude.m4: (AC_CHECK_WITH_HOTSPOT_BUILD): Don't abuse DEFAULT_BUILD. Introduce ORIGINAL_BUILD to represent the ORIGINAL BUILD and use that in the conditional and for --without-hotspot-build. Use DEFAULT_BUILD only for when the option is not specified. changeset 60d2b331f239 in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=60d2b331f239 author: Andrew John Hughes date: Thu Oct 21 12:54:55 2010 +0100 Merge diffstat: 297 files changed, 944 insertions(+), 65632 deletions(-) ChangeLog | 455 + INSTALL | 100 Makefile.am | 524 -- NEWS | 5 README | 44 acinclude.m4 | 59 configure.ac | 1 extra/net/sourceforge/jnlp/about/HTMLPanel.java | 59 extra/net/sourceforge/jnlp/about/Main.java | 135 extra/net/sourceforge/jnlp/about/resources/about.html | 28 extra/net/sourceforge/jnlp/about/resources/applications.html | 36 extra/net/sourceforge/jnlp/about/resources/notes.html | 82 hotspot.map | 1 javaws.desktop | 11 netx/javaws.1 | 123 netx/javax/jnlp/BasicService.java | 12 netx/javax/jnlp/ClipboardService.java | 10 netx/javax/jnlp/DownloadService.java | 24 netx/javax/jnlp/DownloadServiceListener.java | 12 netx/javax/jnlp/ExtendedService.java | 51 netx/javax/jnlp/ExtensionInstallerService.java | 21 netx/javax/jnlp/FileContents.java | 17 netx/javax/jnlp/FileOpenService.java | 10 netx/javax/jnlp/FileSaveService.java | 10 netx/javax/jnlp/JNLPRandomAccessFile.java | 45 netx/javax/jnlp/PersistenceService.java | 17 netx/javax/jnlp/PrintService.java | 12 netx/javax/jnlp/ServiceManager.java | 53 netx/javax/jnlp/ServiceManagerStub.java | 10 netx/javax/jnlp/SingleInstanceListener.java | 35 netx/javax/jnlp/SingleInstanceService.java | 46 netx/javax/jnlp/UnavailableServiceException.java | 15 netx/net/sourceforge/jnlp/AppletDesc.java | 122 netx/net/sourceforge/jnlp/ApplicationDesc.java | 74 netx/net/sourceforge/jnlp/AssociationDesc.java | 56 netx/net/sourceforge/jnlp/ComponentDesc.java | 40 netx/net/sourceforge/jnlp/DefaultLaunchHandler.java | 112 netx/net/sourceforge/jnlp/ExtensionDesc.java | 143 netx/net/sourceforge/jnlp/IconDesc.java | 135 netx/net/sourceforge/jnlp/InformationDesc.java | 267 - netx/net/sourceforge/jnlp/InstallerDesc.java | 52 netx/net/sourceforge/jnlp/JARDesc.java | 141 netx/net/sourceforge/jnlp/JNLPFile.java | 633 -- netx/net/sourceforge/jnlp/JNLPSplashScreen.java | 99 netx/net/sourceforge/jnlp/JREDesc.java | 165 netx/net/sourceforge/jnlp/LaunchException.java | 188 netx/net/sourceforge/jnlp/LaunchHandler.java | 66 netx/net/sourceforge/jnlp/Launcher.java | 883 --- netx/net/sourceforge/jnlp/MenuDesc.java | 38 netx/net/sourceforge/jnlp/NetxPanel.java | 168 netx/net/sourceforge/jnlp/Node.java | 146 netx/net/sourceforge/jnlp/PackageDesc.java | 102 netx/net/sourceforge/jnlp/ParseException.java | 92 netx/net/sourceforge/jnlp/Parser.java | 1320 ----- netx/net/sourceforge/jnlp/PluginBridge.java | 253 - netx/net/sourceforge/jnlp/PropertyDesc.java | 64 netx/net/sourceforge/jnlp/RelatedContentDesc.java | 93 netx/net/sourceforge/jnlp/ResourcesDesc.java | 230 netx/net/sourceforge/jnlp/SecurityDesc.java | 201 netx/net/sourceforge/jnlp/ShortcutDesc.java | 70 netx/net/sourceforge/jnlp/StreamEater.java | 45 netx/net/sourceforge/jnlp/UpdateDesc.java | 70 netx/net/sourceforge/jnlp/Version.java | 352 - netx/net/sourceforge/jnlp/cache/CacheEntry.java | 172 netx/net/sourceforge/jnlp/cache/CacheUtil.java | 450 - netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java | 320 - netx/net/sourceforge/jnlp/cache/DownloadIndicator.java | 91 netx/net/sourceforge/jnlp/cache/Resource.java | 269 - netx/net/sourceforge/jnlp/cache/ResourceTracker.java | 1049 ---- netx/net/sourceforge/jnlp/cache/UpdatePolicy.java | 88 netx/net/sourceforge/jnlp/cache/package.html | 28 netx/net/sourceforge/jnlp/event/ApplicationEvent.java | 55 netx/net/sourceforge/jnlp/event/ApplicationListener.java | 37 netx/net/sourceforge/jnlp/event/DownloadEvent.java | 70 netx/net/sourceforge/jnlp/event/DownloadListener.java | 50 netx/net/sourceforge/jnlp/event/package.html | 28 netx/net/sourceforge/jnlp/package.html | 30 netx/net/sourceforge/jnlp/resources/Manifest.mf | 6 netx/net/sourceforge/jnlp/resources/Messages.properties | 182 netx/net/sourceforge/jnlp/resources/about.jnlp | 20 netx/net/sourceforge/jnlp/resources/default.jnlp | 20 netx/net/sourceforge/jnlp/runtime/AppThreadGroup.java | 68 netx/net/sourceforge/jnlp/runtime/AppletAudioClip.java | 107 netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java | 354 - netx/net/sourceforge/jnlp/runtime/AppletInstance.java | 138 netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java | 319 - netx/net/sourceforge/jnlp/runtime/Boot.java | 463 - netx/net/sourceforge/jnlp/runtime/Boot13.java | 102 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | 1198 ---- netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java | 103 netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java | 572 -- netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java | 541 -- netx/net/sourceforge/jnlp/runtime/package.html | 29 netx/net/sourceforge/jnlp/security/AccessWarningPane.java | 209 netx/net/sourceforge/jnlp/security/AppletWarningPane.java | 115 netx/net/sourceforge/jnlp/security/CertVerifier.java | 92 netx/net/sourceforge/jnlp/security/CertWarningPane.java | 254 - netx/net/sourceforge/jnlp/security/CertsInfoPane.java | 341 - netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java | 238 netx/net/sourceforge/jnlp/security/MoreInfoPane.java | 110 netx/net/sourceforge/jnlp/security/NotAllSignedWarningPane.java | 120 netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java | 134 netx/net/sourceforge/jnlp/security/SecurityUtil.java | 285 - netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java | 474 - netx/net/sourceforge/jnlp/security/SingleCertInfoPane.java | 77 netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java | 314 - netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java | 335 - netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java | 120 netx/net/sourceforge/jnlp/services/ExtendedSingleInstanceService.java | 49 netx/net/sourceforge/jnlp/services/InstanceExistsException.java | 35 netx/net/sourceforge/jnlp/services/ServiceUtil.java | 293 - netx/net/sourceforge/jnlp/services/SingleInstanceLock.java | 194 netx/net/sourceforge/jnlp/services/XBasicService.java | 232 netx/net/sourceforge/jnlp/services/XClipboardService.java | 81 netx/net/sourceforge/jnlp/services/XDownloadService.java | 179 netx/net/sourceforge/jnlp/services/XExtendedService.java | 56 netx/net/sourceforge/jnlp/services/XExtensionInstallerService.java | 121 netx/net/sourceforge/jnlp/services/XFileContents.java | 121 netx/net/sourceforge/jnlp/services/XFileOpenService.java | 113 netx/net/sourceforge/jnlp/services/XFileSaveService.java | 140 netx/net/sourceforge/jnlp/services/XJNLPRandomAccessFile.java | 203 netx/net/sourceforge/jnlp/services/XPersistenceService.java | 177 netx/net/sourceforge/jnlp/services/XPrintService.java | 123 netx/net/sourceforge/jnlp/services/XServiceManagerStub.java | 106 netx/net/sourceforge/jnlp/services/XSingleInstanceService.java | 236 netx/net/sourceforge/jnlp/services/package.html | 29 netx/net/sourceforge/jnlp/tools/CharacterEncoder.java | 354 - netx/net/sourceforge/jnlp/tools/HexDumpEncoder.java | 120 netx/net/sourceforge/jnlp/tools/JarRunner.java | 15 netx/net/sourceforge/jnlp/tools/JarSigner.java | 553 -- netx/net/sourceforge/jnlp/tools/JarSignerResources.java | 212 netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java | 69 netx/net/sourceforge/jnlp/tools/KeyTool.java | 461 - netx/net/sourceforge/jnlp/util/FileUtils.java | 159 netx/net/sourceforge/jnlp/util/PropertiesFile.java | 146 netx/net/sourceforge/jnlp/util/Reflect.java | 146 netx/net/sourceforge/jnlp/util/WeakList.java | 126 netx/net/sourceforge/jnlp/util/XDesktopEntry.java | 213 netx/net/sourceforge/nanoxml/XMLElement.java | 1334 ----- netx/net/sourceforge/nanoxml/XMLParseException.java | 130 patches/alpha-fixes.patch | 21 patches/extensions/liveconnect.patch | 87 patches/gcc-suffix.patch | 31 patches/hotspot/hs19/alpha-fixes.patch | 21 patches/hotspot/hs19/gcc-suffix.patch | 31 patches/hotspot/hs19/params-cast-size_t.patch | 264 - patches/hotspot/hs19/print_lsb_release.patch | 49 patches/hotspot/hs19/update-bootclasspath.patch | 13 patches/hotspot/original/alpha-fixes.patch | 31 patches/hotspot/original/gcc-suffix.patch | 25 patches/hotspot/original/params-cast-size_t.patch | 274 - patches/hotspot/original/print_lsb_release.patch | 48 patches/hotspot/original/update-bootclasspath.patch | 13 patches/icedtea-jtreg-jrunscript.patch | 12 patches/icedtea-lcms.patch | 25 patches/icedtea-shark-build.patch | 16 patches/openjdk/4356282-opentype.patch | 227 patches/openjdk/6438179-systray_check.patch | 92 patches/openjdk/6678385-window_movement_crasher.patch | 1241 ----- patches/openjdk/6721088-awt_window_size.patch | 67 patches/openjdk/6795060-icu_crash.patch | 95 patches/openjdk/6951319-sparc_build_fixes.patch | 24 patches/openjdk/6954424-opentype_javadoc.patch | 23 patches/openjdk/6961732-negative_leading.patch | 45 patches/openjdk/6969395-net_bugs.patch | 461 - patches/openjdk/6985992-test_6933784.patch | 43 patches/params-cast-size_t.patch | 264 + patches/print_lsb_release.patch | 49 patches/security/20101012/6559775.patch | 317 - patches/security/20101012/6622002.patch | 64 patches/security/20101012/6623943.patch | 138 patches/security/20101012/6891766.patch | 1147 ---- patches/security/20101012/6914943.patch | 2129 -------- patches/security/20101012/6925710.patch | 198 patches/security/20101012/6938813.patch | 196 patches/security/20101012/6952017.patch | 50 patches/security/20101012/6952603.patch | 38 patches/security/20101012/6957564.patch | 77 patches/security/20101012/6958060.patch | 15 patches/security/20101012/6961084.patch | 325 - patches/security/20101012/6963023.patch | 95 patches/security/20101012/6963285.patch | 20 patches/security/20101012/6963489.patch | 31 patches/security/20101012/6966692.patch | 91 patches/security/20101012/6981426.patch | 24 patches/security/20101012/6990437.patch | 116 patches/update-bootclasspath.patch | 13 plugin/icedteanp/IcedTeaJavaRequestProcessor.cc | 1392 ----- plugin/icedteanp/IcedTeaJavaRequestProcessor.h | 233 plugin/icedteanp/IcedTeaNPPlugin.cc | 2453 ---------- plugin/icedteanp/IcedTeaNPPlugin.h | 136 plugin/icedteanp/IcedTeaPluginRequestProcessor.cc | 988 ---- plugin/icedteanp/IcedTeaPluginRequestProcessor.h | 146 plugin/icedteanp/IcedTeaPluginUtils.cc | 1047 ---- plugin/icedteanp/IcedTeaPluginUtils.h | 296 - plugin/icedteanp/IcedTeaRunnable.cc | 75 plugin/icedteanp/IcedTeaRunnable.h | 104 plugin/icedteanp/IcedTeaScriptablePluginObject.cc | 897 --- plugin/icedteanp/IcedTeaScriptablePluginObject.h | 212 plugin/icedteanp/java/netscape/javascript/JSException.java | 140 plugin/icedteanp/java/netscape/javascript/JSObject.java | 297 - plugin/icedteanp/java/netscape/javascript/JSObjectCreatePermission.java | 47 plugin/icedteanp/java/netscape/javascript/JSProxy.java | 58 plugin/icedteanp/java/netscape/javascript/JSRunnable.java | 72 plugin/icedteanp/java/netscape/javascript/JSUtil.java | 59 plugin/icedteanp/java/netscape/security/ForbiddenTargetException.java | 52 plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java | 71 plugin/icedteanp/java/sun/applet/GetMemberPluginCallRequest.java | 63 plugin/icedteanp/java/sun/applet/GetWindowPluginCallRequest.java | 65 plugin/icedteanp/java/sun/applet/JavaConsole.java | 365 - plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java | 696 -- plugin/icedteanp/java/sun/applet/PasswordAuthenticationDialog.java | 241 plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java | 1505 ------ plugin/icedteanp/java/sun/applet/PluginAppletViewer.java | 2056 -------- plugin/icedteanp/java/sun/applet/PluginCallRequest.java | 89 plugin/icedteanp/java/sun/applet/PluginCallRequestFactory.java | 61 plugin/icedteanp/java/sun/applet/PluginClassLoader.java | 51 plugin/icedteanp/java/sun/applet/PluginCookieInfoRequest.java | 74 plugin/icedteanp/java/sun/applet/PluginCookieManager.java | 88 plugin/icedteanp/java/sun/applet/PluginDebug.java | 51 plugin/icedteanp/java/sun/applet/PluginException.java | 53 plugin/icedteanp/java/sun/applet/PluginMain.java | 319 - plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java | 268 - plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java | 147 plugin/icedteanp/java/sun/applet/PluginObjectStore.java | 132 plugin/icedteanp/java/sun/applet/PluginProxyInfoRequest.java | 81 plugin/icedteanp/java/sun/applet/PluginProxySelector.java | 195 plugin/icedteanp/java/sun/applet/PluginStreamHandler.java | 454 - plugin/icedteanp/java/sun/applet/RequestQueue.java | 77 plugin/icedteanp/java/sun/applet/TestEnv.java | 172 plugin/icedteanp/java/sun/applet/VoidPluginCallRequest.java | 54 plugin/tests/LiveConnect/DummyObject.java | 15 plugin/tests/LiveConnect/OverloadTestHelper1.java | 1 plugin/tests/LiveConnect/OverloadTestHelper2.java | 1 plugin/tests/LiveConnect/OverloadTestHelper3.java | 1 plugin/tests/LiveConnect/PluginTest.java | 710 -- plugin/tests/LiveConnect/build | 18 plugin/tests/LiveConnect/common.js | 219 plugin/tests/LiveConnect/index.html | 91 plugin/tests/LiveConnect/jjs_eval_test.js | 57 plugin/tests/LiveConnect/jjs_func_parameters_tests.js | 107 plugin/tests/LiveConnect/jjs_func_rettype_tests.js | 61 plugin/tests/LiveConnect/jjs_get_tests.js | 114 plugin/tests/LiveConnect/jjs_set_tests.js | 314 - plugin/tests/LiveConnect/jsj_func_overload_tests.js | 181 plugin/tests/LiveConnect/jsj_func_parameters_tests.js | 216 plugin/tests/LiveConnect/jsj_func_rettype_tests.js | 262 - plugin/tests/LiveConnect/jsj_get_tests.js | 260 - plugin/tests/LiveConnect/jsj_set_tests.js | 318 - plugin/tests/LiveConnect/jsj_type_casting_tests.js | 825 --- plugin/tests/LiveConnect/jsj_type_conversion_tests.js | 825 --- shark/hotspot/make/linux/makefiles/shark.make | 32 shark/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp | 62 shark/hotspot/src/share/vm/includeDB_shark | 369 - shark/hotspot/src/share/vm/shark/llvmHeaders.hpp | 82 shark/hotspot/src/share/vm/shark/llvmValue.hpp | 62 shark/hotspot/src/share/vm/shark/sharkBlock.cpp | 1260 ----- shark/hotspot/src/share/vm/shark/sharkBlock.hpp | 281 - shark/hotspot/src/share/vm/shark/sharkBuilder.cpp | 591 -- shark/hotspot/src/share/vm/shark/sharkBuilder.hpp | 209 shark/hotspot/src/share/vm/shark/sharkCacheDecache.cpp | 259 - shark/hotspot/src/share/vm/shark/sharkCacheDecache.hpp | 417 - shark/hotspot/src/share/vm/shark/sharkCodeBuffer.hpp | 87 shark/hotspot/src/share/vm/shark/sharkCompiler.cpp | 340 - shark/hotspot/src/share/vm/shark/sharkCompiler.hpp | 119 shark/hotspot/src/share/vm/shark/sharkConstant.cpp | 128 shark/hotspot/src/share/vm/shark/sharkConstant.hpp | 64 shark/hotspot/src/share/vm/shark/sharkContext.cpp | 180 shark/hotspot/src/share/vm/shark/sharkContext.hpp | 187 shark/hotspot/src/share/vm/shark/sharkEntry.hpp | 58 shark/hotspot/src/share/vm/shark/sharkFunction.cpp | 188 shark/hotspot/src/share/vm/shark/sharkFunction.hpp | 111 shark/hotspot/src/share/vm/shark/sharkInliner.cpp | 749 --- shark/hotspot/src/share/vm/shark/sharkInliner.hpp | 32 shark/hotspot/src/share/vm/shark/sharkIntrinsics.cpp | 277 - shark/hotspot/src/share/vm/shark/sharkIntrinsics.hpp | 54 shark/hotspot/src/share/vm/shark/sharkInvariants.cpp | 37 shark/hotspot/src/share/vm/shark/sharkInvariants.hpp | 167 shark/hotspot/src/share/vm/shark/sharkMemoryManager.cpp | 116 shark/hotspot/src/share/vm/shark/sharkMemoryManager.hpp | 88 shark/hotspot/src/share/vm/shark/sharkNativeWrapper.cpp | 352 - shark/hotspot/src/share/vm/shark/sharkNativeWrapper.hpp | 182 shark/hotspot/src/share/vm/shark/sharkRuntime.cpp | 251 - shark/hotspot/src/share/vm/shark/sharkRuntime.hpp | 83 shark/hotspot/src/share/vm/shark/sharkStack.cpp | 263 - shark/hotspot/src/share/vm/shark/sharkStack.hpp | 290 - shark/hotspot/src/share/vm/shark/sharkState.cpp | 389 - shark/hotspot/src/share/vm/shark/sharkState.hpp | 188 shark/hotspot/src/share/vm/shark/sharkStateScanner.cpp | 99 shark/hotspot/src/share/vm/shark/sharkStateScanner.hpp | 75 shark/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp | 1991 -------- shark/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp | 430 - shark/hotspot/src/share/vm/shark/sharkType.hpp | 112 shark/hotspot/src/share/vm/shark/sharkValue.cpp | 260 - shark/hotspot/src/share/vm/shark/sharkValue.hpp | 332 - shark/hotspot/src/share/vm/shark/shark_globals.cpp | 29 shark/hotspot/src/share/vm/shark/shark_globals.hpp | 54 diffs (truncated from 68280 to 500 lines): diff -r afdd3f284524 -r 60d2b331f239 ChangeLog --- a/ChangeLog Mon Oct 18 21:29:09 2010 +0100 +++ b/ChangeLog Thu Oct 21 12:54:55 2010 +0100 @@ -1,3 +1,407 @@ 2010-10-18 Andrew John Hughes + + * INSTALL: Clarify HotSpot build documentation. + * acinclude.m4: + (AC_CHECK_WITH_HOTSPOT_BUILD): Don't abuse + DEFAULT_BUILD. Introduce ORIGINAL_BUILD to + represent the ORIGINAL BUILD and use that in + the conditional and for --without-hotspot-build. + Use DEFAULT_BUILD only for when the option is + not specified. + +2010-10-19 Andrew John Hughes + + * patches/security/20101012/6559775.patch, + * patches/security/20101012/6622002.patch, + * patches/security/20101012/6891766.patch, + * patches/security/20101012/6914943.patch, + * patches/security/20101012/6925710.patch, + * patches/security/20101012/6938813.patch, + * patches/security/20101012/6952017.patch, + * patches/security/20101012/6952603.patch, + * patches/security/20101012/6957564.patch, + * patches/security/20101012/6958060.patch, + * patches/security/20101012/6961084.patch, + * patches/security/20101012/6963023.patch, + * patches/security/20101012/6963285.patch, + * patches/security/20101012/6963489.patch, + * patches/security/20101012/6966692.patch, + * patches/security/20101012/6981426.patch, + * patches/security/20101012/6990437.patch: + Dropped; available upstream. + * Makefile.am: Drop above patches. + * patches/icedtea-lcms.patch: Rejigged against + upstream security patch. + +2010-10-18 Andrew John Hughes + + * patches/hotspot/hs19/alpha-fixes.patch, + * patches/hotspot/hs19/gcc-suffix.patch, + * patches/hotspot/hs19/params-cast-size_t.patch, + * patches/hotspot/hs19/print_lsb_release.patch, + * patches/hotspot/hs19/update-bootclasspath.patch: + Move to patches. hs19 is now the only option. + * patches/hotspot/original/alpha-fixes.patch, + * patches/hotspot/original/gcc-suffix.patch, + * patches/hotspot/original/params-cast-size_t.patch, + * patches/hotspot/original/print_lsb_release.patch, + * patches/hotspot/original/update-bootclasspath.patch: + Dropped; upstream moved from hs17 to hs19. + * patches/icedtea-shark-build.patch: + Applied upstream by Gary Benson. + * patches/security/20101012/6623943.patch: + Applied upstream by Omair Majid. + * shark/hotspot/make/linux/makefiles/shark.make, + * shark/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp, + * shark/hotspot/src/share/vm/includeDB_shark, + * shark/hotspot/src/share/vm/shark/llvmHeaders.hpp, + * shark/hotspot/src/share/vm/shark/llvmValue.hpp, + * shark/hotspot/src/share/vm/shark/sharkBlock.cpp, + * shark/hotspot/src/share/vm/shark/sharkBlock.hpp, + * shark/hotspot/src/share/vm/shark/sharkBuilder.cpp, + * shark/hotspot/src/share/vm/shark/sharkBuilder.hpp, + * shark/hotspot/src/share/vm/shark/sharkCacheDecache.cpp, + * shark/hotspot/src/share/vm/shark/sharkCacheDecache.hpp, + * shark/hotspot/src/share/vm/shark/sharkCodeBuffer.hpp, + * shark/hotspot/src/share/vm/shark/sharkCompiler.cpp, + * shark/hotspot/src/share/vm/shark/sharkCompiler.hpp, + * shark/hotspot/src/share/vm/shark/sharkConstant.cpp, + * shark/hotspot/src/share/vm/shark/sharkConstant.hpp, + * shark/hotspot/src/share/vm/shark/sharkContext.cpp, + * shark/hotspot/src/share/vm/shark/sharkContext.hpp, + * shark/hotspot/src/share/vm/shark/sharkEntry.hpp, + * shark/hotspot/src/share/vm/shark/sharkFunction.cpp, + * shark/hotspot/src/share/vm/shark/sharkFunction.hpp, + * shark/hotspot/src/share/vm/shark/sharkInliner.cpp, + * shark/hotspot/src/share/vm/shark/sharkInliner.hpp, + * shark/hotspot/src/share/vm/shark/sharkIntrinsics.cpp, + * shark/hotspot/src/share/vm/shark/sharkIntrinsics.hpp, + * shark/hotspot/src/share/vm/shark/sharkInvariants.cpp, + * shark/hotspot/src/share/vm/shark/sharkInvariants.hpp, + * shark/hotspot/src/share/vm/shark/sharkMemoryManager.cpp, + * shark/hotspot/src/share/vm/shark/sharkMemoryManager.hpp, + * shark/hotspot/src/share/vm/shark/sharkNativeWrapper.cpp, + * shark/hotspot/src/share/vm/shark/sharkNativeWrapper.hpp, + * shark/hotspot/src/share/vm/shark/sharkRuntime.cpp, + * shark/hotspot/src/share/vm/shark/sharkRuntime.hpp, + * shark/hotspot/src/share/vm/shark/sharkStack.cpp, + * shark/hotspot/src/share/vm/shark/sharkStack.hpp, + * shark/hotspot/src/share/vm/shark/sharkState.cpp, + * shark/hotspot/src/share/vm/shark/sharkState.hpp, + * shark/hotspot/src/share/vm/shark/sharkStateScanner.cpp, + * shark/hotspot/src/share/vm/shark/sharkStateScanner.hpp, + * shark/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp, + * shark/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp, + * shark/hotspot/src/share/vm/shark/sharkType.hpp, + * shark/hotspot/src/share/vm/shark/sharkValue.cpp, + * shark/hotspot/src/share/vm/shark/sharkValue.hpp, + * shark/hotspot/src/share/vm/shark/shark_globals.cpp, + * shark/hotspot/src/share/vm/shark/shark_globals.hpp: + Shark is in HotSpot 19. + * Makefile.am: + (ICEDTEA_PATCHES): Remove $(HSBUILD) special casing. + Remove conditional !WITH_ALT_HSBUILD patches. + (ports): Drop !WITH_ALT_HSBUILD block. + (clean-ports): Likewise. + * hotspot.map: Remove hs19. + * patches/alpha-fixes.patch, + * patches/gcc-suffix.patch, + * patches/params-cast-size_t.patch, + * patches/print_lsb_release.patch, + * patches/update-bootclasspath.patch: + The hs19 patches moved above. + * acinclude.m4: + (AC_CHECK_WITH_HOTSPOT_BUILD): Default to original. + +2010-10-19 Andrew John Hughes + + * INSTALL: Drop plugin dependencies. + Document new JDK detection. Drop removed + options from VisualVM and the plugin. + Mention new hs19 default. + * README: Updated. Remove sections on + plugin and NetX. Update Zero&Shark section. + * NEWS: Add HotSpot 19, NetX & plugin removal, + Shark upstreaming and JDK detection/bootstrapping + changes. + * acinclude.m4: + (AC_CHECK_WITH_HOTSPOT_BUILD): Set + DEFAULT_BUILD to hs19 rather than the + non-existent hs16 (used when + --with-hotspot-build or + --with-hotspot-build=yes is passed). + Introduce ALTERNATE_BUILD to refer to + the build enabled by --with-hotspot-build, + which is 'original' (hs17) at present. + +2010-10-19 Andrew John Hughes + + Move NetX and the plugin to the IcedTea-Web project: + http://icedtea.classpath.org/hg/icedtea-web + * extra/net/sourceforge/jnlp/about/HTMLPanel.java, + * extra/net/sourceforge/jnlp/about/Main.java, + * extra/net/sourceforge/jnlp/about/resources/about.html, + * extra/net/sourceforge/jnlp/about/resources/applications.html, + * extra/net/sourceforge/jnlp/about/resources/notes.html, + * javaws.desktop, + * netx/javaws.1, + * netx/javax/jnlp/BasicService.java, + * netx/javax/jnlp/ClipboardService.java, + * netx/javax/jnlp/DownloadService.java, + * netx/javax/jnlp/DownloadServiceListener.java, + * netx/javax/jnlp/ExtendedService.java, + * netx/javax/jnlp/ExtensionInstallerService.java, + * netx/javax/jnlp/FileContents.java, + * netx/javax/jnlp/FileOpenService.java, + * netx/javax/jnlp/FileSaveService.java, + * netx/javax/jnlp/JNLPRandomAccessFile.java, + * netx/javax/jnlp/PersistenceService.java, + * netx/javax/jnlp/PrintService.java, + * netx/javax/jnlp/ServiceManager.java, + * netx/javax/jnlp/ServiceManagerStub.java, + * netx/javax/jnlp/SingleInstanceListener.java, + * netx/javax/jnlp/SingleInstanceService.java, + * netx/javax/jnlp/UnavailableServiceException.java, + * netx/net/sourceforge/jnlp/AppletDesc.java, + * netx/net/sourceforge/jnlp/ApplicationDesc.java, + * netx/net/sourceforge/jnlp/AssociationDesc.java, + * netx/net/sourceforge/jnlp/ComponentDesc.java, + * netx/net/sourceforge/jnlp/DefaultLaunchHandler.java, + * netx/net/sourceforge/jnlp/ExtensionDesc.java, + * netx/net/sourceforge/jnlp/IconDesc.java, + * netx/net/sourceforge/jnlp/InformationDesc.java, + * netx/net/sourceforge/jnlp/InstallerDesc.java, + * netx/net/sourceforge/jnlp/JARDesc.java, + * netx/net/sourceforge/jnlp/JNLPFile.java, + * netx/net/sourceforge/jnlp/JNLPSplashScreen.java, + * netx/net/sourceforge/jnlp/JREDesc.java, + * netx/net/sourceforge/jnlp/LaunchException.java, + * netx/net/sourceforge/jnlp/LaunchHandler.java, + * netx/net/sourceforge/jnlp/Launcher.java, + * netx/net/sourceforge/jnlp/MenuDesc.java, + * netx/net/sourceforge/jnlp/NetxPanel.java, + * netx/net/sourceforge/jnlp/Node.java, + * netx/net/sourceforge/jnlp/PackageDesc.java, + * netx/net/sourceforge/jnlp/ParseException.java, + * netx/net/sourceforge/jnlp/Parser.java, + * netx/net/sourceforge/jnlp/PluginBridge.java, + * netx/net/sourceforge/jnlp/PropertyDesc.java, + * netx/net/sourceforge/jnlp/RelatedContentDesc.java, + * netx/net/sourceforge/jnlp/ResourcesDesc.java, + * netx/net/sourceforge/jnlp/SecurityDesc.java, + * netx/net/sourceforge/jnlp/ShortcutDesc.java, + * netx/net/sourceforge/jnlp/StreamEater.java, + * netx/net/sourceforge/jnlp/UpdateDesc.java, + * netx/net/sourceforge/jnlp/Version.java, + * netx/net/sourceforge/jnlp/cache/CacheEntry.java, + * netx/net/sourceforge/jnlp/cache/CacheUtil.java, + * netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java, + * netx/net/sourceforge/jnlp/cache/DownloadIndicator.java, + * netx/net/sourceforge/jnlp/cache/Resource.java, + * netx/net/sourceforge/jnlp/cache/ResourceTracker.java, + * netx/net/sourceforge/jnlp/cache/UpdatePolicy.java, + * netx/net/sourceforge/jnlp/cache/package.html, + * netx/net/sourceforge/jnlp/event/ApplicationEvent.java, + * netx/net/sourceforge/jnlp/event/ApplicationListener.java, + * netx/net/sourceforge/jnlp/event/DownloadEvent.java, + * netx/net/sourceforge/jnlp/event/DownloadListener.java, + * netx/net/sourceforge/jnlp/event/package.html, + * netx/net/sourceforge/jnlp/package.html, + * netx/net/sourceforge/jnlp/resources/Manifest.mf, + * netx/net/sourceforge/jnlp/resources/Messages.properties, + * netx/net/sourceforge/jnlp/resources/about.jnlp, + * netx/net/sourceforge/jnlp/resources/default.jnlp, + * netx/net/sourceforge/jnlp/runtime/AppThreadGroup.java, + * netx/net/sourceforge/jnlp/runtime/AppletAudioClip.java, + * netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java, + * netx/net/sourceforge/jnlp/runtime/AppletInstance.java, + * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java, + * netx/net/sourceforge/jnlp/runtime/Boot.java, + * netx/net/sourceforge/jnlp/runtime/Boot13.java, + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java, + * netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java, + * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java, + * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java, + * netx/net/sourceforge/jnlp/runtime/package.html, + * netx/net/sourceforge/jnlp/security/AccessWarningPane.java, + * netx/net/sourceforge/jnlp/security/AppletWarningPane.java, + * netx/net/sourceforge/jnlp/security/CertVerifier.java, + * netx/net/sourceforge/jnlp/security/CertWarningPane.java, + * netx/net/sourceforge/jnlp/security/CertsInfoPane.java, + * netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java, + * netx/net/sourceforge/jnlp/security/MoreInfoPane.java, + * netx/net/sourceforge/jnlp/security/NotAllSignedWarningPane.java, + * netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java, + * netx/net/sourceforge/jnlp/security/SecurityUtil.java, + * netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java, + * netx/net/sourceforge/jnlp/security/SingleCertInfoPane.java, + * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java, + * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java, + * netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java, + * netx/net/sourceforge/jnlp/services/ExtendedSingleInstanceService.java, + * netx/net/sourceforge/jnlp/services/InstanceExistsException.java, + * netx/net/sourceforge/jnlp/services/ServiceUtil.java, + * netx/net/sourceforge/jnlp/services/SingleInstanceLock.java, + * netx/net/sourceforge/jnlp/services/XBasicService.java, + * netx/net/sourceforge/jnlp/services/XClipboardService.java, + * netx/net/sourceforge/jnlp/services/XDownloadService.java, + * netx/net/sourceforge/jnlp/services/XExtendedService.java, + * netx/net/sourceforge/jnlp/services/XExtensionInstallerService.java, + * netx/net/sourceforge/jnlp/services/XFileContents.java, + * netx/net/sourceforge/jnlp/services/XFileOpenService.java, + * netx/net/sourceforge/jnlp/services/XFileSaveService.java, + * netx/net/sourceforge/jnlp/services/XJNLPRandomAccessFile.java, + * netx/net/sourceforge/jnlp/services/XPersistenceService.java, + * netx/net/sourceforge/jnlp/services/XPrintService.java, + * netx/net/sourceforge/jnlp/services/XServiceManagerStub.java, + * netx/net/sourceforge/jnlp/services/XSingleInstanceService.java, + * netx/net/sourceforge/jnlp/services/package.html, + * netx/net/sourceforge/jnlp/tools/CharacterEncoder.java, + * netx/net/sourceforge/jnlp/tools/HexDumpEncoder.java, + * netx/net/sourceforge/jnlp/tools/JarRunner.java, + * netx/net/sourceforge/jnlp/tools/JarSigner.java, + * netx/net/sourceforge/jnlp/tools/JarSignerResources.java, + * netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java, + * netx/net/sourceforge/jnlp/tools/KeyTool.java, + * netx/net/sourceforge/jnlp/util/FileUtils.java, + * netx/net/sourceforge/jnlp/util/PropertiesFile.java, + * netx/net/sourceforge/jnlp/util/Reflect.java, + * netx/net/sourceforge/jnlp/util/WeakList.java, + * netx/net/sourceforge/jnlp/util/XDesktopEntry.java, + * netx/net/sourceforge/nanoxml/XMLElement.java, + * netx/net/sourceforge/nanoxml/XMLParseException.java, + * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc, + * plugin/icedteanp/IcedTeaJavaRequestProcessor.h, + * plugin/icedteanp/IcedTeaNPPlugin.cc, + * plugin/icedteanp/IcedTeaNPPlugin.h, + * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc, + * plugin/icedteanp/IcedTeaPluginRequestProcessor.h, + * plugin/icedteanp/IcedTeaPluginUtils.cc, + * plugin/icedteanp/IcedTeaPluginUtils.h, + * plugin/icedteanp/IcedTeaRunnable.cc, + * plugin/icedteanp/IcedTeaRunnable.h, + * plugin/icedteanp/IcedTeaScriptablePluginObject.cc, + * plugin/icedteanp/IcedTeaScriptablePluginObject.h, + * plugin/icedteanp/java/netscape/javascript/JSException.java, + * plugin/icedteanp/java/netscape/javascript/JSObject.java, + * plugin/icedteanp/java/netscape/javascript/JSObjectCreatePermission.java, + * plugin/icedteanp/java/netscape/javascript/JSProxy.java, + * plugin/icedteanp/java/netscape/javascript/JSRunnable.java, + * plugin/icedteanp/java/netscape/javascript/JSUtil.java, + * plugin/icedteanp/java/netscape/security/ForbiddenTargetException.java, + * plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java, + * plugin/icedteanp/java/sun/applet/GetMemberPluginCallRequest.java, + * plugin/icedteanp/java/sun/applet/GetWindowPluginCallRequest.java, + * plugin/icedteanp/java/sun/applet/JavaConsole.java, + * plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java, + * plugin/icedteanp/java/sun/applet/PasswordAuthenticationDialog.java, + * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java, + * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java, + * plugin/icedteanp/java/sun/applet/PluginCallRequest.java, + * plugin/icedteanp/java/sun/applet/PluginCallRequestFactory.java, + * plugin/icedteanp/java/sun/applet/PluginClassLoader.java, + * plugin/icedteanp/java/sun/applet/PluginCookieInfoRequest.java, + * plugin/icedteanp/java/sun/applet/PluginCookieManager.java, + * plugin/icedteanp/java/sun/applet/PluginDebug.java, + * plugin/icedteanp/java/sun/applet/PluginException.java, + * plugin/icedteanp/java/sun/applet/PluginMain.java, + * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java, + * plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java, + * plugin/icedteanp/java/sun/applet/PluginObjectStore.java, + * plugin/icedteanp/java/sun/applet/PluginProxyInfoRequest.java, + * plugin/icedteanp/java/sun/applet/PluginProxySelector.java, + * plugin/icedteanp/java/sun/applet/PluginStreamHandler.java, + * plugin/icedteanp/java/sun/applet/RequestQueue.java, + * plugin/icedteanp/java/sun/applet/TestEnv.java, + * plugin/icedteanp/java/sun/applet/VoidPluginCallRequest.java, + * plugin/tests/LiveConnect/DummyObject.java, + * plugin/tests/LiveConnect/OverloadTestHelper1.java, + * plugin/tests/LiveConnect/OverloadTestHelper2.java, + * plugin/tests/LiveConnect/OverloadTestHelper3.java, + * plugin/tests/LiveConnect/PluginTest.java, + * plugin/tests/LiveConnect/build, + * plugin/tests/LiveConnect/common.js, + * plugin/tests/LiveConnect/index.html, + * plugin/tests/LiveConnect/jjs_eval_test.js, + * plugin/tests/LiveConnect/jjs_func_parameters_tests.js, + * plugin/tests/LiveConnect/jjs_func_rettype_tests.js, + * plugin/tests/LiveConnect/jjs_get_tests.js, + * plugin/tests/LiveConnect/jjs_set_tests.js, + * plugin/tests/LiveConnect/jsj_func_overload_tests.js, + * plugin/tests/LiveConnect/jsj_func_parameters_tests.js, + * plugin/tests/LiveConnect/jsj_func_rettype_tests.js, + * plugin/tests/LiveConnect/jsj_get_tests.js, + * plugin/tests/LiveConnect/jsj_set_tests.js, + * plugin/tests/LiveConnect/jsj_type_casting_tests.js, + * plugin/tests/LiveConnect/jsj_type_conversion_tests.js, + * patches/extensions/liveconnect.patch: + Removed. + * Makefile.am: + Removed aliases for dead targets. + (NETX_SRCDIR): Removed. + (NETX_RESOURCE_DIR): Likewise. + (NETX_EXTRA_DIR): Likewise. + (NETX_BOOTSTRAP_CLASSES): Likewise. + (PLUGIN_BOOTSTRAP_CLASSES): Likewise. + (NETX_SUN_CLASSES): Likewise. + (PLUGIN_SUN_CLASSES): Likewise. + (ICEDTEA_BOOTSTRAP_CLASSES): Remove above four variables. + (ICEDTEAPLUGIN_CLEAN): Removed. + (LIVECONNECT_DIR): Removed. + (PLUGIN_DIR): Removed. + (PLUGIN_SRCDIR): Removed. + (LIVECONNECT_SRCS): Removed. + (ICEDTEAPLUGIN_TARGET): Removed. + (PLUGIN_TEST_SRCS): Removed. + (ICEDTEA_PATCHES): Drop liveconnect.patch. + (PLUGIN_VERSION): Removed. + (EXTRA_DIST): Drop extra javaws.png javaws.desktop plugin netx. + (clean-local): Remove dead targets. + (.PHONY): Likewise. + (icedtea-against-icedtea): Likewise. + (clean-icedtea-against-icedtea): Likewise. + (icedtea-debug-against-icedtea): Likewise. + (clean-icedtea-debug-against-icedtea): Likewise. + (add-plugin): Dropped. + (clean-add-plugin): Likewise. + (add-plugin-debug): Likewise. + (clean-add-plugin-debug): Likewise. + (add-netx): Dropped. + (clean-add-netx): Likewise. + (add-netx-debug): Likewise. + (clean-add-netx-debug): Likewise. + (icedtea-against-ecj): Drop dead targets. + (clean-icedtea-against-ecj): Likewise. + (add-plugin-ecj): Likewise. + (clean-add-plugin-ecj): Likewise. + (add-netx-ecj): Dropped. + (clean-add-netx-ecj): Likewise. + (PLUGIN_SRC): Removed. + (PLUGIN_OBJECTS): Removed. + ($(PLUGIN_DIR)/%.o)): Removed. + ($(PLUGIN_DIR)/IcedTeaPlugin.so): Removed. + (clean-IcedTeaPlugin): Likewise. + (plugin): Likewise. + (clean-plugin): Likewise. + (liveconnect-source-files.txt): Likewise. + (liveconnect): Likewise. + (liveconnect-dist): Likewise. + (clean-liveconnect): Likewise. + (netx-source-files.txt): Likewise. + (netx): Likewise. + (netx-dist): Likewise. + (clean-netx): Likewise. + (extra-source-files.txt): Likewise. + (extra-class-files): Likewise. + (clean-extra): Likewise. + (extra-lib/about.jar): Likewise. + (ADD_ZERO_CONFIGURE_ARGS): Remove dead --disable-plugin. + (plugin-tests): Removed. + (IT_CHECK_PLUGIN): Removed. + (IT_CHECK_PLUGIN_DEPENDENCIES): Likewise. + (IT_CHECK_XULRUNNER_VERSION): Likewise. + * configure.ac: Don't call IT_CHECK_XULRUNNER_VERSION. + 2010-10-18 Andrew John Hughes * Makefile.am: @@ -254,6 +658,14 @@ 2010-09-23 Andrew John Hughes + + * patches/icedtea-awt-window-size.patch, + * patches/openjdk/6969395-net_bugs.patch, + * patches/openjdk/6985992-test_6933784.patch: + Dropped; upstreamed. + * Makefile.am: Remove above patches. 2010-09-23 Andrew John Hughes @@ -594,6 +1006,15 @@ 2010-09-07 Andrew John Hughes + + * patches/openjdk/6438179-systray_check.patch: + Dropped, applied upstream. + * Makefile.am: Drop above patch and those brought + back by merge. Update JAXP tarball. + * patches/openjdk/6951319-sparc_build_fixes.patch: + Remove upstreamed parts. + 2010-09-03 Pavel Tisnovsky * Makefile.am: Fixed indentation, changes spaces to tab. @@ -643,7 +1064,7 @@ 2010-08-27 Deepak Bhole - * Makefile.am: + * Makefile.am: Add patch. * patches/opengl-jni-fix.patch: Fixed missing JNI link to native function OGLContext.getOGLIdString() which causes @@ -730,6 +1151,22 @@ 2010-08-13 Andrew John Hughes + + * patches/openjdk/4356282-opentype.patch, + * patches/openjdk/6795060-icu_crash.patch, + * patches/openjdk/6954424-opentype_javadoc.patch: + Dropped, applied upstream. + * Makefile.am: + Remove above patches. + +2010-08-12 Andrew John Hughes + + * patches/openjdk/6678385-window_movement_crasher.patch: + Dropped, applied upstream. + * Makefile.am: + Remove above patch. 2010-08-09 Omair Majid @@ -771,7 +1208,7 @@ 2010-08-09 Deepak Bhole @@ -1083,6 +1520,12 @@ 2010-07-28 Matthias Klose * NEWS: Add 1.8.1 entry. + +2010-07-26 Andrew John Hughes + + * patches/icedtea-jtreg-jrunscript.patch: + Regenerate after 50002bfcff96 from dcubed being + added to OpenJDK6. 2010-07-26 Andrew John Hughes @@ -1532,6 +1975,12 @@ 2010-07-08 Andrew John Hughes References: <20101020232118.GI24339@rivendell.middle-earth.co.uk> Message-ID: <20101021144645.GC24712@redhat.com> * Dr Andrew John Hughes [2010-10-20 19:21]: > The attached patch cuts the warnings for NetX down from over 100 to a > paltry 11 (and some of those are caused by Oracle's code). > > Ok for HEAD? > Looks good to me as well. Ok for HEAD! Cheers, Deepak > ChangeLog: > > 2010-10-20 Andrew John Hughes > > * netx/javax/jnlp/ServiceManager.java: > (lookupTable): Add generic types. > * netx/net/sourceforge/jnlp/AppletDesc.java: > (parameters): Likewise. > (AppletDesc(String,String,URL,int,int,Map)): Likewise. > (getParameters()): Likewise. > * netx/net/sourceforge/jnlp/ApplicationDesc.java: > (getArguments()): Remove redundant cast. > (addArgument(String)): Add generic typing. > * netx/net/sourceforge/jnlp/ExtensionDesc.java: > (extToPart): Add generic types. > (eagerExtParts): Likewise. > * netx/net/sourceforge/jnlp/InformationDesc.java: > (info): Likewise. > (getIcons(Object)): Add generic typing. > (getAssociations()): Likewise. > (getRelatedContents()): Likewise. > (getItem(Object)): Likewise. > (getItems(Object)): Likewise. > (addItem(String,Object)): Likewise. > * netx/net/sourceforge/jnlp/JNLPFile.java: > (resources): Likewise. > (InformationDesc.getItems(Object)): Likewise. > (getResources(Class)): Likewise. > * netx/net/sourceforge/jnlp/LaunchException.java: > (getCauses()): Likewise. > * netx/net/sourceforge/jnlp/Launcher.java: > (launchApplication(JNLPFile)): Likewise. > * netx/net/sourceforge/jnlp/NetxPanel.java: > (NetxPanel(URL,Hashtable)): Likewise. > (NetxPanel(URL,Hashtable,boolean)): Likewise. > * netx/net/sourceforge/jnlp/Node.java: > (getChildNodes()): Likewise. > * netx/net/sourceforge/jnlp/Parser.java: > (getResources(Node,boolean)): Likewise. > (getInfo(Node)): Likewise. > (getInformationDesc(Node)): Likewise. > (getApplet(Node)): Likewise. > (getApplication(Node)): Likewise. > (splitString(String)): Likewise. > (getLocales(Node)): Likewise. > (getChildNodes(Node,String)): Likewise. > * netx/net/sourceforge/jnlp/PluginBridge.java: > Fix variable naming and add generic types. > (cacheJars): Changed from cache_jars. > (cacheExJars): Changed from cache_ex-jars. > (atts): Add generic typing. > (PluginBridge(URL,URL,String,String,int,int,Hashtable)): Likewise. > (getInformation(Locale)): Likewise. > (getResources(Locale,String,String)): Likewise. > (getJARs()): Avoid excessive copying; filtering already performed > by getResources in JNLPFile. > * netx/net/sourceforge/jnlp/ResourcesDesc.java: > (resources): Add generic typing. > (getJREs()): Likewise. > (getJARs()): Likewise. > (getJARs(String)): Likewise. > (getExtensions()): Likewise. > (getPackages()): Likewise. > (getPackages(String)): Likewise. > (getProperties()): Likewise. > (getPropertiesMap()): Likewise. > (getResources(Class)): Make generic. > * netx/net/sourceforge/jnlp/Version.java: > (matches(Version)): Add generic types. > (matchesAny(Version)): Likewise. > (matchesSingle(String)): Likewise. > (matches(String,String)): Likewise. > (equal(List,List)): Likewise. > (greater(List,List)): Likewise. > (compare(String,String)): Use Integer.valueOf. > (normalize(List,int)): Add generic types, using > a List of lists rather than an array of lists. > (getVersionStrings()): Add generic types. > (getParts()): Likewise. > * netx/net/sourceforge/jnlp/cache/CacheUtil.java: > (waitForResources(ApplicationInstance,ResourceTracker, > URL,String)): Likewise. > * netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java: > (getListener(ApplicatonInstance,String,URL)): Use setVisible instead > of show(). > (disposeListener(DownloadServiceListener)): Use setVisible instead > of hide(). > (DownloadPanel.urls): Add generic typing. > (DownloadPanel.panels): Likewise. > (DownloadPanel.update(URL,String,long,long,int)): Fix formatting. > Add generic types. > * netx/net/sourceforge/jnlp/cache/Resource.java: > (resources): Add generic typing. > (trackers): Likewise. > (getResource(URL,Version,UpdatePolicy)): Use generic types. > (getTracker()): Likewise. > (addTracker(ResourceTracker)): Likewise. > (fireDownloadEvent()): Likewise. > * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: > (prefetchTrackers): Add generic typing. > (queue): Likewise. > (active): Likewise. > (resources): Likewise. > (listeners): Likewise. > (fireDownloadEvent(Resource)): Remove unneeded cast. > (getPrefetch()): Use generic typing. > (selectByFlag(List,int,int)): Likewise. > (getResource(URL)): Likewise. > * netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java: > (weakClips): Add generic types. > (destroy()): Use generic typing. > (getApplets()): Likewise. > (getStreamKeys()): Likewise. > * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: > (weakWindows): Add generic types. > (installEnvironment()): Likewise. > (destroy()): Remove redundant cast. > * netx/net/sourceforge/jnlp/runtime/Boot.java: > Extend PrivilegedAction. > (run()): Add generic typing. > (getOptions(String)): Likewise. > * netx/net/sourceforge/jnlp/runtime/Boot13.java: > (main(String[]): Likewise. > * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: > Fix formatting. > (urlToLoader): Add generic types. > (resourcePermissions): Likewise. > (available): Likewise. > (jarEntries): Likewise. > (getInstance(JNLPFile,UpdatePolicy)): Remove redundant cast. > (getInstance(URL,String,Version,UpdatePolicy)): Likewise. > (initializeExtensions()): Add generic types. > (initializePermissions()): Likewise. > (initializeResources()): Likewise. > (getPermissions(CodeSource)): Likewise. > (fillInPartJars(List)): Likewise. > (activateJars(List)): Likewise. > (loadClass(String)): Likewise. Suppress warnings due to > sun.misc.JarIndex usage. > (findResources(String)): Mark as overriding. Add generic > types. > (getExtensionName()): Add @Deprecated annotation. > (getExtensionHREF()): Likewise. > * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: > (weakWindows): Add generic typing. > (weakApplications): Likewise. > (getApplication(Window)): Remove redundant casts. Add w, > which is window cast to Window. > * netx/net/sourceforge/jnlp/services/ServiceUtil.java: > (invoke(Object,Method,Object[])): Use generic types. > * netx/net/sourceforge/jnlp/services/XPersistenceService.java: > (getNames(URL)): Likewise. > * netx/net/sourceforge/jnlp/tools/JarSigner.java: > (verifyJars(List,ResourceTracker)): Remove redundant cast. > * netx/net/sourceforge/jnlp/util/WeakList.java: > Redesign as a generic type. > (refs): Add generic types. > (deref(WeakReference)): Likewise. > (get(int)): Likewise. > (set(int,Object)): Likewise. > (add(int,E)): Likewise. > (remove()): Likewise. > (hardList()): Likewise. > * netx/net/sourceforge/nanoxml/XMLElement.java: > (attributes): Add generic typing. > (children): Likewise. > (entities): Likewise. > (XMLElement()): Use generic types. > (XMLElement(Hashtable): Likewise. > (resolveEntity(StringBuffer)): Remove redundant cast. > > -- > Andrew :) > > Free Java Software Engineer > Red Hat, Inc. (http://www.redhat.com) > > Support Free Java! > Contribute to GNU Classpath and the OpenJDK > http://www.gnu.org/software/classpath > http://openjdk.java.net > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 > diff -r 1b3abd2b1e4f netx/javax/jnlp/ServiceManager.java > --- a/netx/javax/jnlp/ServiceManager.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/javax/jnlp/ServiceManager.java Thu Oct 21 00:21:09 2010 +0100 > @@ -10,7 +10,8 @@ > > private static ServiceManagerStub stub = null; > > - private static Map lookupTable = new HashMap(); // ensure lookup is idempotent > + private static Map lookupTable > + = new HashMap(); // ensure lookup is idempotent > > private ServiceManager() { > // says it can't be instantiated > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/AppletDesc.java > --- a/netx/net/sourceforge/jnlp/AppletDesc.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/AppletDesc.java Thu Oct 21 00:21:09 2010 +0100 > @@ -45,7 +45,7 @@ > private int height; > > /** the parameters */ > - private Map parameters; > + private Map parameters; > > > /** > @@ -58,13 +58,14 @@ > * @param height the height > * @param parameters the parameters > */ > - public AppletDesc(String name, String mainClass, URL documentBase, int width, int height, Map parameters) { > + public AppletDesc(String name, String mainClass, URL documentBase, int width, int height, > + Map parameters) { > this.name = name; > this.mainClass = mainClass; > this.documentBase = documentBase; > this.width = width; > this.height = height; > - this.parameters = new HashMap(parameters); > + this.parameters = new HashMap(parameters); > } > > /** > @@ -105,8 +106,8 @@ > /** > * Returns the applet parameters > */ > - public Map getParameters() { > - return new HashMap(parameters); > + public Map getParameters() { > + return new HashMap(parameters); > } > > /** > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/ApplicationDesc.java > --- a/netx/net/sourceforge/jnlp/ApplicationDesc.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/ApplicationDesc.java Thu Oct 21 00:21:09 2010 +0100 > @@ -58,17 +58,17 @@ > * Returns the arguments > */ > public String[] getArguments() { > - return (String[]) arguments.clone(); > + return arguments.clone(); > } > > /** > * Add an argument to the end of the arguments. > */ > public void addArgument(String arg) { > - ArrayList l = new ArrayList(Arrays.asList(arguments)); > + List l = new ArrayList(Arrays.asList(arguments)); > l.add(arg); > > - arguments = (String[]) l.toArray(arguments); > + arguments = l.toArray(arguments); > } > > } > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/ExtensionDesc.java > --- a/netx/net/sourceforge/jnlp/ExtensionDesc.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/ExtensionDesc.java Thu Oct 21 00:21:09 2010 +0100 > @@ -45,10 +45,10 @@ > private JNLPFile file; > > /** map from ext-part to local part */ > - private Map extToPart = new HashMap(); > + private Map extToPart = new HashMap(); > > /** eager ext parts */ > - private List eagerExtParts = new ArrayList(); > + private List eagerExtParts = new ArrayList(); > > > /** > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/InformationDesc.java > --- a/netx/net/sourceforge/jnlp/InformationDesc.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/InformationDesc.java Thu Oct 21 00:21:09 2010 +0100 > @@ -52,7 +52,7 @@ > private Locale locales[]; > > /** the data as list of key,value pairs */ > - private List info; > + private List info; > > /** the JNLPFile this information is for */ > private JNLPFile jnlpFile; > @@ -129,9 +129,9 @@ > * @return an array of zero of more IconDescs of the specified icon type > */ > public IconDesc[] getIcons(Object kind) { > - List icons = getItems("icon-"+kind); > + List icons = getItems("icon-"+kind); > > - return (IconDesc[]) icons.toArray(new IconDesc[icons.size()]); > + return icons.toArray(new IconDesc[icons.size()]); > }; > > /** > @@ -204,9 +204,9 @@ > * Returns the associations specified in the JNLP file > */ > public AssociationDesc[] getAssociations() { > - List associations = getItems("association"); > + List associations = getItems("association"); > > - return (AssociationDesc[]) associations.toArray(new AssociationDesc[associations.size()]); > + return associations.toArray(new AssociationDesc[associations.size()]); > } > > /** > @@ -220,17 +220,16 @@ > * Returns the related-contents specified by this JNLP file > */ > public RelatedContentDesc[] getRelatedContents() { > - List relatedContents = getItems("related-content"); > + List relatedContents = getItems("related-content"); > > - return (RelatedContentDesc[]) relatedContents.toArray( > - new RelatedContentDesc[relatedContents.size()]); > + return relatedContents.toArray(new RelatedContentDesc[relatedContents.size()]); > } > > /** > * Returns the last item matching the specified key. > */ > protected Object getItem(Object key) { > - List items = getItems(key); > + List items = getItems(key); > if (items.size() == 0) > return null; > else > @@ -240,11 +239,11 @@ > /** > * Returns all items matching the specified key. > */ > - protected List getItems(Object key) { > + protected List getItems(Object key) { > if (info == null) > - return Collections.EMPTY_LIST; > + return Collections.emptyList(); > > - List result = new ArrayList(); > + List result = new ArrayList(); > for (int i=0; i < info.size(); i+=2) > if (info.get(i).equals(key)) > result.add( info.get(i+1) ); > @@ -258,7 +257,7 @@ > */ > protected void addItem(String key, Object value) { > if (info == null) > - info = new ArrayList(); > + info = new ArrayList(); > > info.add(key); > info.add(value); > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/JNLPFile.java > --- a/netx/net/sourceforge/jnlp/JNLPFile.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/JNLPFile.java Thu Oct 21 00:21:09 2010 +0100 > @@ -86,7 +86,7 @@ > protected UpdateDesc update; > > /** resources */ > - protected List resources; > + protected List resources; > > /** additional resources not in JNLP file (from command line) */ > protected ResourcesDesc sharedResources = new ResourcesDesc(this, null, null, null); > @@ -330,8 +330,8 @@ > */ > public InformationDesc getInformation(final Locale locale) { > return new InformationDesc(this, new Locale[] {locale}) { > - protected List getItems(Object key) { > - List result = new ArrayList(); > + protected List getItems(Object key) { > + List result = new ArrayList(); > > for (int i=0; i < info.size(); i++) { > InformationDesc infoDesc = (InformationDesc) info.get(i); > @@ -375,11 +375,11 @@ > */ > public ResourcesDesc getResources(final Locale locale, final String os, final String arch) { > return new ResourcesDesc(this, new Locale[] {locale}, new String[] {os}, new String[] {arch}) { > - public List getResources(Class launchType) { > - List result = new ArrayList(); > + public List getResources(Class launchType) { > + List result = new ArrayList(); > > for (int i=0; i < resources.size(); i++) { > - ResourcesDesc rescDesc = (ResourcesDesc) resources.get(i); > + ResourcesDesc rescDesc = resources.get(i); > > if (localMatches(locale, rescDesc.getLocales()) > && stringMatches(os, rescDesc.getOS()) > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/LaunchException.java > --- a/netx/net/sourceforge/jnlp/LaunchException.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/LaunchException.java Thu Oct 21 00:21:09 2010 +0100 > @@ -146,7 +146,7 @@ > * and will be removed once netx no longer supports 1.3. > */ > public Throwable[] getCauses() { > - ArrayList result = new ArrayList(); > + ArrayList result = new ArrayList(); > > Reflect r = new Reflect(); > Throwable cause = this.cause; > @@ -156,7 +156,7 @@ > cause = (Throwable) r.invoke(cause, "getCause"); > } > > - return (Throwable[]) result.toArray(new Throwable[0]); > + return result.toArray(new Throwable[0]); > } > > /** > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/Launcher.java > --- a/netx/net/sourceforge/jnlp/Launcher.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/Launcher.java Thu Oct 21 00:21:09 2010 +0100 > @@ -455,11 +455,11 @@ > R("LSFatal"), R("LCClient"), R("LCantDetermineMainClass") , > R("LCantDetermineMainClassInfo"))); > > - Class mainClass = app.getClassLoader().loadClass(mainName); > + Class mainClass = app.getClassLoader().loadClass(mainName); > > - Method main = mainClass.getMethod("main", new Class[] {String[].class} ); > + Method main = mainClass.getMethod("main", new Class[] {String[].class} ); > String args[] = file.getApplication().getArguments(); > - > + > SwingUtilities.invokeAndWait(new Runnable() { > // dummy method to force Event Dispatch Thread creation > public void run(){} > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/NetxPanel.java > --- a/netx/net/sourceforge/jnlp/NetxPanel.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/NetxPanel.java Thu Oct 21 00:21:09 2010 +0100 > @@ -45,13 +45,14 @@ > private AppletInstance appInst = null; > private boolean appletAlive; > > - public NetxPanel(URL documentURL, Hashtable atts) > + public NetxPanel(URL documentURL, Hashtable atts) > { > super(documentURL, atts); > } > > // overloaded constructor, called when initialized via plugin > - public NetxPanel(URL documentURL, Hashtable atts, boolean exitOnFailure) > + public NetxPanel(URL documentURL, Hashtable atts, > + boolean exitOnFailure) > { > this(documentURL, atts); > this.exitOnFailure = exitOnFailure; > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/Node.java > --- a/netx/net/sourceforge/jnlp/Node.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/Node.java Thu Oct 21 00:21:09 2010 +0100 > @@ -47,12 +47,12 @@ > > Node[] getChildNodes() { > if (children == null) { > - List list = new ArrayList(); > + List list = new ArrayList(); > > for (Enumeration e = xml.enumerateChildren(); e.hasMoreElements();) > list.add( new Node((XMLElement)e.nextElement()) ); > > - children = (Node[]) list.toArray( new Node[list.size()] ); > + children = list.toArray( new Node[list.size()] ); > > for (int i=0; i < children.length-1; i++) > children[i].next = children[i+1]; > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/Parser.java > --- a/netx/net/sourceforge/jnlp/Parser.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/Parser.java Thu Oct 21 00:21:09 2010 +0100 > @@ -239,8 +239,10 @@ > * @param j2se true if the resources are located under a j2se or java node > * @throws ParseException if the JNLP file is invalid > */ > - public List getResources(Node parent, boolean j2se) throws ParseException { > - List result = new ArrayList(); > + public List getResources(Node parent, boolean j2se) > + throws ParseException > + { > + List result = new ArrayList(); > Node resources[] = getChildNodes(parent, "resources"); > > // ensure that there are at least one information section present > @@ -433,8 +435,10 @@ > * @param parent the parent node (jnlp) > * @throws ParseException if the JNLP file is invalid > */ > - public List getInfo(Node parent) throws ParseException { > - List result = new ArrayList(); > + public List getInfo(Node parent) > + throws ParseException > + { > + List result = new ArrayList(); > Node info[] = getChildNodes(parent, "information"); > > // ensure that there are at least one information section present > @@ -455,7 +459,7 @@ > * @throws ParseException if the JNLP file is invalid > */ > public InformationDesc getInformationDesc(Node node) throws ParseException { > - List descriptionsUsed = new ArrayList(); > + List descriptionsUsed = new ArrayList(); > > // locale > Locale locales[] = getLocales(node); > @@ -642,7 +646,7 @@ > String name = getRequiredAttribute(node, "name", R("PUnknownApplet")); > String main = getRequiredAttribute(node, "main-class", null); > URL docbase = getURL(node, "documentbase", base); > - Map paramMap = new HashMap(); > + Map paramMap = new HashMap(); > int width = 0; > int height = 0; > > @@ -673,7 +677,7 @@ > */ > public ApplicationDesc getApplication(Node node) throws ParseException { > String main = getAttribute(node, "main-class", null); > - List argsList = new ArrayList(); > + List argsList = new ArrayList(); > > // if (main == null) > // only ok if can be found in main jar file (can't check here but make a note) > @@ -687,8 +691,7 @@ > argsList.add( getSpanText(args[i]) ); > } > > - String argStrings[] = > - (String[]) argsList.toArray( new String[argsList.size()] ); > + String argStrings[] = argsList.toArray( new String[argsList.size()] ); > > return new ApplicationDesc(main, argStrings); > } > @@ -825,9 +828,9 @@ > if (source == null) > return new String[0]; > > - List result = new ArrayList(); > + List result = new ArrayList(); > StringTokenizer st = new StringTokenizer(source, " "); > - StringBuffer part = new StringBuffer(); > + StringBuilder part = new StringBuilder(); > while (st.hasMoreTokens()) { > part.setLength(0); > > @@ -849,7 +852,7 @@ > result.add( part.toString() ); > } > > - return (String[]) result.toArray(new String[result.size()] ); > + return result.toArray(new String[result.size()] ); > } > > /** > @@ -858,7 +861,7 @@ > * @param node the node with a locale attribute > */ > public Locale[] getLocales(Node node) { > - List locales = new ArrayList(); > + List locales = new ArrayList(); > String localeParts[] = > splitString(getAttribute(node, "locale", "")); > > @@ -868,7 +871,7 @@ > locales.add(l); > } > > - return (Locale[]) locales.toArray(new Locale[locales.size()] ); > + return locales.toArray(new Locale[locales.size()] ); > } > > /** > @@ -936,7 +939,7 @@ > * Returns all child nodes with the specified name. > */ > public static Node[] getChildNodes(Node node, String name) { > - List result = new ArrayList(); > + List result = new ArrayList(); > > Node child = node.getFirstChild(); > while (child != null) { > @@ -945,7 +948,7 @@ > child = child.getNextSibling(); > } > > - return (Node[]) result.toArray( new Node[result.size()] ); > + return result.toArray( new Node[result.size()] ); > } > > > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/PluginBridge.java > --- a/netx/net/sourceforge/jnlp/PluginBridge.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/PluginBridge.java Thu Oct 21 00:21:09 2010 +0100 > @@ -40,64 +40,65 @@ > > String name; > String[] jars = new String[0]; > - String[] cache_jars = new String[0]; > - String[] cache_ex_jars = new String[0]; > - Hashtable atts; > + String[] cacheJars = new String[0]; > + String[] cacheExJars = new String[0]; > + Hashtable atts; > > public PluginBridge(URL codebase, URL documentBase, String jar, String main, > - int width, int height, Hashtable atts) > + int width, int height, Hashtable atts) > throws Exception > { > specVersion = new Version("1.0"); > fileVersion = new Version("1.1"); > this.codeBase = codebase; > this.sourceLocation = documentBase; > - > + > if (atts.containsKey("jnlp_href")){ > try { > - URL jnlp = new URL(codeBase.toExternalForm() + (String) atts.get("jnlp_href")); > - JNLPFile jnlp_file = new JNLPFile(jnlp); > - Map jnlp_params = jnlp_file.getApplet().getParameters(); > - > + URL jnlp = new URL(codeBase.toExternalForm() + atts.get("jnlp_href")); > + JNLPFile jnlpFile = new JNLPFile(jnlp); > + Map jnlpParams = jnlpFile.getApplet().getParameters(); > + > // Change the parameter name to lowercase to follow conventions. > - Iterator it = jnlp_params.keySet().iterator(); > - while(it.hasNext()){ > - String key = (String) it.next(); > - atts.put(key.toLowerCase(), jnlp_params.get(key)); > + for (Map.Entry entry : jnlpParams.entrySet()){ > + atts.put(entry.getKey().toLowerCase(), entry.getValue()); > } > } catch (MalformedURLException e) { > // Don't fail because we cannot get the jnlp file. Parameters are optional not required. > // it is the site developer who should ensure that file exist. > - System.err.println("Unable to get JNLP file at: " + codeBase.toExternalForm() > - + (String) atts.get("jnlp_href")); > + System.err.println("Unable to get JNLP file at: " + codeBase.toExternalForm() > + + atts.get("jnlp_href")); > } > } > > // also, see if cache_archive is specified > - if (atts.get("cache_archive") != null && ((String) atts.get("cache_archive")).length() > 0) { > + String cacheArchive = atts.get("cache_archive"); > + if (cacheArchive != null && cacheArchive.length() > 0) { > > String[] versions = new String[0]; > > // are there accompanying versions? > - if (atts.get("cache_version") != null) { > - versions = ((String) atts.get("cache_version")).split(","); > + String cacheVersion = atts.get("cache_version"); > + if (cacheVersion != null) { > + versions = cacheVersion.split(","); > } > > - String[] jars = ((String) atts.get("cache_archive")).split(","); > - cache_jars = new String[jars.length]; > + String[] jars = cacheArchive.split(","); > + cacheJars = new String[jars.length]; > > for (int i=0; i < jars.length; i++) { > > - cache_jars[i] = jars[i].trim(); > + cacheJars[i] = jars[i].trim(); > > if (versions.length > 0) { > - cache_jars[i] += ";" + versions[i].trim(); > + cacheJars[i] += ";" + versions[i].trim(); > } > } > } > > - if (atts.get("cache_archive_ex") != null && ((String) atts.get("cache_archive_ex")).length() > 0) { > - cache_ex_jars = ((String) atts.get("cache_archive_ex")).split(","); > + String cacheArchiveEx = atts.get("cache_archive_ex"); > + if (cacheArchiveEx != null && cacheArchiveEx.length() > 0) { > + cacheExJars = cacheArchiveEx.split(","); > } > > if (jar != null && jar.length() > 0) { > @@ -109,7 +110,7 @@ > } > this.atts = atts; > > - name = (String) atts.get("name"); > + name = atts.get("name"); > if (name == null) > name = "Applet"; > else > @@ -140,11 +141,10 @@ > public InformationDesc getInformation(final Locale locale) > { > return new InformationDesc(this, new Locale[] {locale}) { > - protected List getItems(Object key) > + protected List getItems(Object key) > { > // Should we populate this list with applet attribute tags? > - List result = new ArrayList(); > - return result; > + return new ArrayList(); > } > }; > } > @@ -153,102 +153,92 @@ > final String arch) > { > return new ResourcesDesc(this, new Locale[] {locale}, new String[] {os}, > - new String[] {arch}) { > - public List getResources(Class launchType) > + new String[] {arch}) { > + @Override > + public List getResources(Class launchType) > { > - List result = new ArrayList(); > - result.addAll(sharedResources.getResources(launchType)); > - > // Need to add the JAR manually... > //should this be done to sharedResources on init? > - try > + if (launchType.equals(JARDesc.class)) > { > - if (launchType.equals(JARDesc.class)) > + try > { > + List jarDescs = new ArrayList(); > + jarDescs.addAll(sharedResources.getResources(JARDesc.class)); > + > for (int i = 0; i < jars.length; i++) > if (jars[i].length() > 0) > - result.add(new JARDesc(new URL(codeBase, jars[i]), > + jarDescs.add(new JARDesc(new URL(codeBase, jars[i]), > null, null, false, true, false, true)); > > boolean cacheable = true; > > - if (atts.get("cache_option") != null && > - ((String) atts.get("cache_option")).equalsIgnoreCase("no")) > + String cacheOption = atts.get("cache_option"); > + if (cacheOption != null && cacheOption.equalsIgnoreCase("no")) > cacheable = false; > > - for (int i = 0; i < cache_jars.length; i++) { > + for (int i = 0; i < cacheJars.length; i++) { > > - String[] jar_and_ver = cache_jars[i].split(";"); > + String[] jarAndVer = cacheJars[i].split(";"); > > - String jar = jar_and_ver[0]; > + String jar = jarAndVer[0]; > Version version = null; > > if (jar.length() == 0) > continue; > > - if (jar_and_ver.length > 1) { > - version = new Version(jar_and_ver[1]); > + if (jarAndVer.length > 1) { > + version = new Version(jarAndVer[1]); > } > > - result.add(new JARDesc(new URL(codeBase, jar), > + jarDescs.add(new JARDesc(new URL(codeBase, jar), > version, null, false, true, false, cacheable)); > } > > - for (int i = 0; i < cache_ex_jars.length; i++) { > + for (int i = 0; i < cacheExJars.length; i++) { > > - if (cache_ex_jars[i].length() == 0) > + if (cacheExJars[i].length() == 0) > continue; > > - String[] jar_info = cache_ex_jars[i].split(";"); > + String[] jarInfo = cacheExJars[i].split(";"); > > - String jar = jar_info[0].trim(); > + String jar = jarInfo[0].trim(); > Version version = null; > boolean lazy = true; > > - if (jar_info.length > 1) { > + if (jarInfo.length > 1) { > > // format is name[[;preload];version] > > - if (jar_info[1].equals("preload")) { > + if (jarInfo[1].equals("preload")) { > lazy = false; > } else { > - version = new Version(jar_info[1].trim()); > + version = new Version(jarInfo[1].trim()); > } > > - if (jar_info.length > 2) { > + if (jarInfo.length > 2) { > lazy = false; > - version = new Version(jar_info[2].trim()); > + version = new Version(jarInfo[2].trim()); > } > } > > - result.add(new JARDesc(new URL(codeBase, jar), > + jarDescs.add(new JARDesc(new URL(codeBase, jar), > version, null, lazy, true, false, false)); > } > + // We know this is a safe list of JarDesc objects > + @SuppressWarnings("unchecked") > + List result = (List) jarDescs; > + return result; > } > + catch (MalformedURLException ex) { /* Ignored */ } > } > - catch (MalformedURLException ex) > - { } > - return result; > - } > + return sharedResources.getResources(launchType); > + } > > + @Override > public JARDesc[] getJARs() { > - List resources = getResources(JARDesc.class); > - ArrayList jars = new ArrayList(); > - > - //Only get the JARDescs > - for (int i = 0; i < resources.size(); i++) { > - Object resource = resources.get(i); > - if (resource instanceof JARDesc) > - jars.add((JARDesc) resource); > - } > - > - Object[] objectArray = jars.toArray(); > - JARDesc[] jarArray = new JARDesc[objectArray.length]; > - > - for (int i = 0; i < objectArray.length; i++) > - jarArray[i] = (JARDesc) objectArray[i]; > - > - return jarArray; > + List jarDescs = getResources(JARDesc.class); > + return jarDescs.toArray(new JARDesc[jarDescs.size()]); > } > > public void addResource(Object resource) > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/ResourcesDesc.java > --- a/netx/net/sourceforge/jnlp/ResourcesDesc.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/ResourcesDesc.java Thu Oct 21 00:21:09 2010 +0100 > @@ -43,8 +43,8 @@ > private JNLPFile jnlpFile; > > /** list of jars, packages, properties, and extensions */ > - private List resources = new ArrayList(); // mixed list makes easier for lookup code > - > + private List resources = new ArrayList(); > + // mixed list makes easier for lookup code > > /** > * Create a representation of one information section of the > @@ -66,8 +66,8 @@ > * Returns the JVMs. > */ > public JREDesc[] getJREs() { > - List resources = getResources(JREDesc.class); > - return (JREDesc[]) resources.toArray( new JREDesc[resources.size()] ); > + List resources = getResources(JREDesc.class); > + return resources.toArray( new JREDesc[resources.size()] ); > } > > /** > @@ -92,8 +92,8 @@ > * Returns all of the JARs. > */ > public JARDesc[] getJARs() { > - List resources = getResources(JARDesc.class); > - return (JARDesc[]) resources.toArray( new JARDesc[resources.size()] ); > + List resources = getResources(JARDesc.class); > + return resources.toArray( new JARDesc[resources.size()] ); > } > > /** > @@ -102,32 +102,32 @@ > * @param partName the part name, null and "" equivalent > */ > public JARDesc[] getJARs(String partName) { > - List resources = getResources(JARDesc.class); > + List resources = getResources(JARDesc.class); > > for (int i = resources.size(); i-- > 0;) { > - JARDesc jar = (JARDesc) resources.get(i); > + JARDesc jar = resources.get(i); > > if (!(""+jar.getPart()).equals(""+partName)) > resources.remove(i); > } > > - return (JARDesc[]) resources.toArray( new JARDesc[resources.size()] ); > + return resources.toArray( new JARDesc[resources.size()] ); > } > > /** > * Returns the Extensions. > */ > public ExtensionDesc[] getExtensions() { > - List resources = getResources(ExtensionDesc.class); > - return (ExtensionDesc[]) resources.toArray( new ExtensionDesc[resources.size()] ); > + List resources = getResources(ExtensionDesc.class); > + return resources.toArray( new ExtensionDesc[resources.size()] ); > } > > /** > * Returns the Packages. > */ > public PackageDesc[] getPackages() { > - List resources = getResources(PackageDesc.class); > - return (PackageDesc[]) resources.toArray( new PackageDesc[resources.size()] ); > + List resources = getResources(PackageDesc.class); > + return resources.toArray( new PackageDesc[resources.size()] ); > } > > /** > @@ -137,34 +137,34 @@ > * @return the PackageDesc objects matching the class name > */ > public PackageDesc[] getPackages(String className) { > - List resources = getResources(PackageDesc.class); > + List resources = getResources(PackageDesc.class); > > for (int i = resources.size(); i-- > 0;) { > - PackageDesc pk = (PackageDesc) resources.get(i); > + PackageDesc pk = resources.get(i); > > if (!pk.matches(className)) > resources.remove(i); > } > > - return (PackageDesc[]) resources.toArray( new PackageDesc[resources.size()] ); > + return resources.toArray( new PackageDesc[resources.size()] ); > } > > /** > * Returns the Properties as a list. > */ > public PropertyDesc[] getProperties() { > - List resources = getResources(PropertyDesc.class); > - return (PropertyDesc[]) resources.toArray( new PropertyDesc[resources.size()] ); > + List resources = getResources(PropertyDesc.class); > + return resources.toArray( new PropertyDesc[resources.size()] ); > } > > /** > * Returns the properties as a map. > */ > - public Map getPropertiesMap() { > - Properties properties = new Properties(); > - List resources = getResources(PropertyDesc.class); > + public Map getPropertiesMap() { > + Map properties = new HashMap(); > + List resources = getResources(PropertyDesc.class); > for (int i=0; i < resources.size(); i++) { > - PropertyDesc prop = (PropertyDesc) resources.get(i); > + PropertyDesc prop = resources.get(i); > properties.put( prop.getKey(), prop.getValue() ); > } > > @@ -205,12 +205,12 @@ > /** > * Returns all resources of the specified type. > */ > - public List getResources(Class type) { > - List result = new ArrayList(); > + public List getResources(Class type) { > + List result = new ArrayList(); > > for (int i=0; i < resources.size(); i++) > if ( type.isAssignableFrom(resources.get(i).getClass()) ) > - result.add(resources.get(i)); > + result.add(type.cast(resources.get(i))); > > return result; > } > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/Version.java > --- a/netx/net/sourceforge/jnlp/Version.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/Version.java Thu Oct 21 00:21:09 2010 +0100 > @@ -94,10 +94,10 @@ > * @param version a Version object > */ > public boolean matches(Version version) { > - List versionStrings = version.getVersionStrings(); > + List versionStrings = version.getVersionStrings(); > > for (int i=0; i < versionStrings.size(); i++) { > - if (!this.matchesSingle( (String)versionStrings.get(i) )) > + if (!this.matchesSingle(versionStrings.get(i) )) > return false; > } > > @@ -122,10 +122,10 @@ > * @param version a Version object > */ > public boolean matchesAny(Version version) { > - List versionStrings = version.getVersionStrings(); > + List versionStrings = version.getVersionStrings(); > > for (int i=0; i < versionStrings.size(); i++) { > - if (this.matchesSingle( (String)versionStrings.get(i) )) > + if (this.matchesSingle( versionStrings.get(i) )) > return true; > } > > @@ -139,9 +139,9 @@ > * @param version a non-compound version of the form "1.2.3[+*]" > */ > private boolean matchesSingle(String version) { > - List versionStrings = this.getVersionStrings(); > + List versionStrings = this.getVersionStrings(); > for (int i=0; i < versionStrings.size(); i++) { > - if ( matches(version, (String)versionStrings.get(i)) ) > + if ( matches(version, versionStrings.get(i)) ) > return true; > } > return false; > @@ -156,14 +156,17 @@ > * @param version a non-compound version optionally with "+" or "*" > */ > private boolean matches(String subversion, String version) { > - List subparts = getParts(subversion); > - List parts = getParts(version); > + List subparts = getParts(subversion); > + List parts = getParts(version); > > int maxLength = Math.max(subversion.length(), version.length()); > if (version.endsWith("*")) // star means rest of parts irrelevant: truncate them > maxLength = parts.size(); > > - normalize(new List[] {subparts, parts}, maxLength); > + List> versions = new ArrayList>(); > + versions.add(subparts); > + versions.add(parts); > + normalize(versions, maxLength); > > if (equal(subparts, parts)) > return true; > @@ -181,9 +184,9 @@ > * @param parts1 normalized version parts > * @param parts2 normalized version parts > */ > - protected boolean equal(List parts1, List parts2) { > + protected boolean equal(List parts1, List parts2) { > for (int i=0; i < parts1.size(); i++) { > - if ( 0 != compare((String)parts1.get(i), (String)parts2.get(i)) ) > + if ( 0 != compare(parts1.get(i), parts2.get(i)) ) > return false; > } > > @@ -197,16 +200,16 @@ > * @param parts1 normalized version parts > * @param parts2 normalized version parts > */ > - protected boolean greater(List parts1, List parts2) { > + protected boolean greater(List parts1, List parts2) { > //if (true) return false; > > for (int i=0; i < parts1.size(); i++) { > // if part1 > part2 then it's a later version, so return true > - if (compare((String)parts1.get(i), (String)parts2.get(i)) > 0) > + if (compare(parts1.get(i), parts2.get(i)) > 0) > return true; > > // if part1 < part2 then it's a ealier version, so return false > - if (compare((String)parts1.get(i), (String)parts2.get(i)) < 0) > + if (compare(parts1.get(i), parts2.get(i)) < 0) > return false; > > // if equal go to next part > @@ -229,8 +232,8 @@ > * @return comparison of the two parts > */ > protected int compare(String part1, String part2) { > - Integer number1 = new Integer(0); > - Integer number2 = new Integer(0); > + Integer number1 = Integer.valueOf(0); > + Integer number2 = Integer.valueOf(0); > > // compare as integers > try { > @@ -261,30 +264,30 @@ > * @param versions list array of parts of a version string > * @param maxLength truncate lists to this maximum length > */ > - protected void normalize(List versions[], int maxLength) { > + protected void normalize(List> versions, int maxLength) { > int length = 0; > - for (int i=0; i < versions.length; i++) > - length = Math.max(length, versions[i].size()); > + for (List vers : versions) > + length = Math.max(length, vers.size()); > > if (length > maxLength) > length = maxLength; > > - for (int i=0; i < versions.length; i++) { > + for (List vers : versions) { > // remove excess elements > - while (versions[i].size() > length) > - versions[i].remove( versions[i].size()-1 ); > + while (vers.size() > length) > + vers.remove( vers.size()-1 ); > > // add in empty pad elements > - while (versions[i].size() < length) > - versions[i].add( emptyString ); > + while (vers.size() < length) > + vers.add( emptyString ); > } > } > > /** > * Return the individual version strings that make up a Version. > */ > - protected List getVersionStrings() { > - ArrayList strings = new ArrayList(); > + protected List getVersionStrings() { > + ArrayList strings = new ArrayList(); > > StringTokenizer st = new StringTokenizer(versionString, " "); > while (st.hasMoreTokens()) > @@ -298,8 +301,8 @@ > * > * @param oneVersion a single version id string (not compound) > */ > - protected List getParts(String oneVersion) { > - ArrayList strings = new ArrayList(); > + protected List getParts(String oneVersion) { > + ArrayList strings = new ArrayList(); > > StringTokenizer st = new StringTokenizer(oneVersion, seperators+"+*"); > while (st.hasMoreTokens()) { > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/cache/CacheUtil.java > --- a/netx/net/sourceforge/jnlp/cache/CacheUtil.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/cache/CacheUtil.java Thu Oct 21 00:21:09 2010 +0100 > @@ -400,12 +400,12 @@ > return; > > // only resources not starting out downloaded are displayed > - List urlList = new ArrayList(); > + List urlList = new ArrayList(); > for (int i=0; i < resources.length; i++) { > if (!tracker.checkResource(resources[i])) > urlList.add(resources[i]); > } > - URL undownloaded[] = (URL[]) urlList.toArray( new URL[urlList.size()] ); > + URL undownloaded[] = urlList.toArray( new URL[urlList.size()] ); > > listener = indicator.getListener(app, title, undownloaded); > > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java > --- a/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java Thu Oct 21 00:21:09 2010 +0100 > @@ -118,7 +118,7 @@ > screen.height-frame.getHeight()); > } > > - frame.show(); > + frame.setVisible(true); > > return result; > } > @@ -135,7 +135,7 @@ > ActionListener hider = new ActionListener() { > public void actionPerformed(ActionEvent evt) { > if (frame.getContentPane().getComponentCount() == 1) > - frame.hide(); > + frame.setVisible(false); > > frame.getContentPane().remove((DownloadPanel) listener); > frame.pack(); > @@ -161,10 +161,10 @@ > private JLabel header = new JLabel(); > > /** list of URLs being downloaded */ > - private List urls = new ArrayList(); > + private List urls = new ArrayList(); > > /** list of ProgressPanels */ > - private List panels = new ArrayList(); > + private List panels = new ArrayList(); > > > /** > @@ -199,7 +199,9 @@ > /** > * Update the download progress of a url. > */ > - protected void update(final URL url, final String version, final long readSoFar, final long total, final int overallPercent) { > + protected void update(final URL url, final String version, > + final long readSoFar, final long total, > + final int overallPercent) { > Runnable r = new Runnable() { > public void run() { > if (!urls.contains(url)) > @@ -207,7 +209,7 @@ > > setOverallPercent(overallPercent); > > - ProgressPanel panel = (ProgressPanel) panels.get(urls.indexOf(url)); > + ProgressPanel panel = panels.get(urls.indexOf(url)); > panel.setProgress(readSoFar, total); > panel.repaint(); > } > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/cache/Resource.java > --- a/netx/net/sourceforge/jnlp/cache/Resource.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/cache/Resource.java Thu Oct 21 00:21:09 2010 +0100 > @@ -60,10 +60,10 @@ > public static final int STARTED = 128; // enqueued or being worked on > > /** list of weak references of resources currently in use */ > - private static WeakList resources = new WeakList(); > + private static WeakList resources = new WeakList(); > > /** weak list of trackers monitoring this resource */ > - private WeakList trackers = new WeakList(); > + private WeakList trackers = new WeakList(); > > /** the remote location of the resource */ > URL location; > @@ -111,7 +111,7 @@ > > int index = resources.indexOf(resource); > if (index >= 0) { // return existing object > - Resource result = (Resource) resources.get(index); > + Resource result = resources.get(index); > if (result != null) > return result; > } > @@ -136,9 +136,9 @@ > */ > ResourceTracker getTracker() { > synchronized (trackers) { > - List t = trackers.hardList(); > + List t = trackers.hardList(); > if (t.size() > 0) > - return (ResourceTracker) t.get(0); > + return t.get(0); > > return null; > } > @@ -225,7 +225,8 @@ > */ > public void addTracker(ResourceTracker tracker) { > synchronized (trackers) { > - List t = trackers.hardList(); // prevent GC between contains and add > + // prevent GC between contains and add > + List t = trackers.hardList(); > if (!t.contains(tracker)) > trackers.add(tracker); > > @@ -238,14 +239,14 @@ > * download event. > */ > protected void fireDownloadEvent() { > - List send; > + List send; > > synchronized (trackers) { > send = trackers.hardList(); > } > > for (int i=0; i < send.size(); i++) { > - ResourceTracker rt = (ResourceTracker) send.get(i); > + ResourceTracker rt = send.get(i); > rt.fireDownloadEvent(this); > } > } > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/cache/ResourceTracker.java > --- a/netx/net/sourceforge/jnlp/cache/ResourceTracker.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/cache/ResourceTracker.java Thu Oct 21 00:21:09 2010 +0100 > @@ -113,19 +113,21 @@ > private static int threads = 0; > > /** weak list of resource trackers with resources to prefetch */ > - private static WeakList prefetchTrackers = new WeakList(); > + private static WeakList prefetchTrackers = > + new WeakList(); > > /** resources requested to be downloaded */ > - private static ArrayList queue = new ArrayList(); > + private static ArrayList queue = new ArrayList(); > > /** resource trackers threads are working for (used for load balancing across multi-tracker downloads) */ > - private static ArrayList active = new ArrayList(); // > + private static ArrayList active = > + new ArrayList(); // > > /** the resources known about by this resource tracker */ > - private List resources = new ArrayList(); > + private List resources = new ArrayList(); > > /** download listeners for this tracker */ > - private List listeners = new ArrayList(); > + private List listeners = new ArrayList(); > > /** whether to download parts before requested */ > private boolean prefetch; > @@ -293,7 +295,7 @@ > protected void fireDownloadEvent(Resource resource) { > DownloadListener l[] = null; > synchronized (listeners) { > - l = (DownloadListener[]) listeners.toArray(new DownloadListener[0]); > + l = listeners.toArray(new DownloadListener[0]); > } > > int status; > @@ -865,7 +867,7 @@ > // first find one to initialize > synchronized (prefetchTrackers) { > for (int i=0; i < prefetchTrackers.size() && result == null; i++) { > - ResourceTracker tracker = (ResourceTracker) prefetchTrackers.get(i); > + ResourceTracker tracker = prefetchTrackers.get(i); > if (tracker == null) > continue; > > @@ -907,12 +909,13 @@ > * Calls to this method should be synchronized on lock and > * source list.

    > */ > - private static Resource selectByFlag(List source, int flag, int notflag) { > + private static Resource selectByFlag(List source, int flag, > + int notflag) { > Resource result = null; > int score = Integer.MAX_VALUE; > > for (int i=0; i < source.size(); i++) { > - Resource resource = (Resource) source.get(i); > + Resource resource = source.get(i); > boolean selectable = false; > > synchronized (resource) { > @@ -924,7 +927,7 @@ > int activeCount = 0; > > for (int j=0; j < active.size(); j++) > - if ((ResourceTracker)active.get(j) == resource.getTracker()) > + if (active.get(j) == resource.getTracker()) > activeCount++; > > // try to spread out the downloads so that a slow host > @@ -947,7 +950,7 @@ > private Resource getResource(URL location) { > synchronized (resources) { > for (int i=0; i < resources.size(); i++) { > - Resource resource = (Resource) resources.get(i); > + Resource resource = resources.get(i); > > if (CacheUtil.urlEquals(resource.location, location)) > return resource; > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java > --- a/netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java Thu Oct 21 00:21:09 2010 +0100 > @@ -57,7 +57,7 @@ > private Container cont; > > /** weak references to the audio clips */ > - private WeakList weakClips = new WeakList(); > + private WeakList weakClips = new WeakList(); > > /** whether the applet has been started / displayed */ > private boolean appletStarted = false; > @@ -121,9 +121,9 @@ > public void destroy() { > destroyed = true; > > - List clips = weakClips.hardList(); > + List clips = weakClips.hardList(); > for (int i = 0; i < clips.size(); i++) { > - ((AppletAudioClip)clips.get(i)).dispose(); > + clips.get(i).dispose(); > } > } > > @@ -217,7 +217,7 @@ > * Returns an enumeration that contains only the applet > * from the JNLP file. > */ > - public Enumeration getApplets() { > + public Enumeration getApplets() { > checkDestroyed(); > > return Collections.enumeration( Arrays.asList(new Applet[] { applet }) ); > @@ -293,7 +293,7 @@ > /** > * Required for JRE1.4, but not implemented yet. > */ > - public Iterator getStreamKeys() { > + public Iterator getStreamKeys() { > checkDestroyed(); > > return null; > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java > --- a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Thu Oct 21 00:21:09 2010 +0100 > @@ -77,7 +77,7 @@ > private boolean stopped = false; > > /** weak list of windows opened by the application */ > - private WeakList weakWindows = new WeakList(); > + private WeakList weakWindows = new WeakList(); > > /** list of application listeners */ > private EventListenerList listeners = new EventListenerList(); > @@ -193,7 +193,7 @@ > // Add to hashmap > AccessControlContext acc = new AccessControlContext(new ProtectionDomain[] {pd}); > > - PrivilegedAction installProps = new PrivilegedAction() { > + PrivilegedAction installProps = new PrivilegedAction() { > public Object run() { > for (int i=0; i < props.length; i++) { > System.setProperty(props[i].getKey(), props[i].getValue()); > @@ -236,7 +236,7 @@ > try { > // destroy resources > for (int i=0; i < weakWindows.size(); i++) { > - Window w = (Window) weakWindows.get(i); > + Window w = weakWindows.get(i); > if (w != null) > w.dispose(); > } > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/runtime/Boot.java > --- a/netx/net/sourceforge/jnlp/runtime/Boot.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/Boot.java Thu Oct 21 00:21:09 2010 +0100 > @@ -58,7 +58,7 @@ > * @author Jon A. Maxwell (JAM) - initial author > * @version $Revision: 1.21 $ > */ > -public final class Boot implements PrivilegedAction { > +public final class Boot implements PrivilegedAction { > > // todo: decide whether a spawned netx (external launch) > // should inherit the same options as this instance (store argv?) > @@ -199,7 +199,7 @@ > /** > * The privileged part (jdk1.3 compatibility). > */ > - public Object run() { > + public Void run() { > JNLPRuntime.setBaseDir(getBaseDir()); > JNLPRuntime.setSecurityEnabled(null == getOption("-nosecurity")); > JNLPRuntime.initialize(true); > @@ -418,7 +418,7 @@ > * returned once for each occurrence. > */ > private static String[] getOptions(String option) { > - List result = new ArrayList(); > + List result = new ArrayList(); > > for (int i=0; i < args.length; i++) { > if (option.equals(args[i])) { > @@ -433,7 +433,7 @@ > i++; > } > > - return (String[]) result.toArray( new String[result.size()] ); > + return result.toArray( new String[result.size()] ); > } > > /** > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/runtime/Boot13.java > --- a/netx/net/sourceforge/jnlp/runtime/Boot13.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/Boot13.java Thu Oct 21 00:21:09 2010 +0100 > @@ -93,8 +93,8 @@ > > Thread.currentThread().setContextClassLoader(b); // try to prevent getting the non-policy version of classes > > - Class c = b.loadClass("net.sourceforge.jnlp.runtime.Boot"); > - Method main = c.getDeclaredMethod("main", new Class[] {String[].class} ); > + Class c = b.loadClass("net.sourceforge.jnlp.runtime.Boot"); > + Method main = c.getDeclaredMethod("main", new Class[] {String[].class} ); > > main.invoke(null, new Object[] { args } ); > } > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Thu Oct 21 00:21:09 2010 +0100 > @@ -81,7 +81,8 @@ > private static String R(String key) { return JNLPRuntime.getMessage(key); } > > /** map from JNLPFile url to shared classloader */ > - private static Map urlToLoader = new HashMap(); // never garbage collected! > + private static Map urlToLoader = > + new HashMap(); // never garbage collected! > > /** the directory for native code */ > private File nativeDir = null; // if set, some native code exists > @@ -93,7 +94,7 @@ > private AccessControlContext acc = AccessController.getContext(); > > /** the permissions for the cached jar files */ > - private List resourcePermissions; > + private List resourcePermissions; > > /** the app */ > private ApplicationInstance app = null; // here for faster lookup in security manager > @@ -123,27 +124,28 @@ > private ArrayList runtimePermissions = new ArrayList(); > > /** all jars not yet part of classloader or active */ > - private List available = new ArrayList(); > + private List available = new ArrayList(); > > - /** all of the jar files that were verified */ > - private ArrayList verifiedJars = null; > + /** all of the jar files that were verified */ > + private ArrayList verifiedJars = null; > > - /** all of the jar files that were not verified */ > - private ArrayList unverifiedJars = null; > + /** all of the jar files that were not verified */ > + private ArrayList unverifiedJars = null; > > - /** the jarsigner tool to verify our jars */ > - private JarSigner js = null; > + /** the jarsigner tool to verify our jars */ > + private JarSigner js = null; > > - private boolean signing = false; > + private boolean signing = false; > > - /** ArrayList containing jar indexes for various jars available to this classloader */ > - private ArrayList jarIndexes = new ArrayList(); > + /** ArrayList containing jar indexes for various jars available to this classloader */ > + private ArrayList jarIndexes = new ArrayList(); > > - /** File entries in the jar files available to this classloader */ > - private TreeSet jarEntries = new TreeSet(); > + /** File entries in the jar files available to this classloader */ > + private TreeSet jarEntries = new TreeSet(); > > - /** Map of specific codesources to securitydesc */ > - private HashMap jarLocationSecurityMap = new HashMap(); > + /** Map of specific codesources to securitydesc */ > + private HashMap jarLocationSecurityMap = > + new HashMap(); > > /** > * Create a new JNLPClassLoader from the specified file. > @@ -273,7 +275,7 @@ > String uniqueKey = file.getUniqueKey(); > > if (uniqueKey != null) > - baseLoader = (JNLPClassLoader) urlToLoader.get(uniqueKey); > + baseLoader = urlToLoader.get(uniqueKey); > > try { > > @@ -286,7 +288,7 @@ > > // New loader init may have caused extentions to create a > // loader for this unique key. Check. > - JNLPClassLoader extLoader = (JNLPClassLoader) urlToLoader.get(uniqueKey); > + JNLPClassLoader extLoader = urlToLoader.get(uniqueKey); > > if (extLoader != null && extLoader != loader) { > if (loader.signing && !extLoader.signing) > @@ -328,7 +330,7 @@ > */ > public static JNLPClassLoader getInstance(URL location, String uniqueKey, Version version, UpdatePolicy policy) > throws IOException, ParseException, LaunchException { > - JNLPClassLoader loader = (JNLPClassLoader) urlToLoader.get(uniqueKey); > + JNLPClassLoader loader = urlToLoader.get(uniqueKey); > > if (loader == null || !location.equals(loader.getJNLPFile().getFileLocation())) > loader = getInstance(new JNLPFile(location, uniqueKey, version, false, policy), policy); > @@ -342,7 +344,7 @@ > void initializeExtensions() { > ExtensionDesc[] ext = resources.getExtensions(); > > - List loaderList = new ArrayList(); > + List loaderList = new ArrayList(); > > loaderList.add(this); > > @@ -359,14 +361,14 @@ > } > //} > > - loaders = (JNLPClassLoader[]) loaderList.toArray(new JNLPClassLoader[ loaderList.size()]); > + loaders = loaderList.toArray(new JNLPClassLoader[loaderList.size()]); > } > > /** > * Make permission objects for the classpath. > */ > void initializePermissions() { > - resourcePermissions = new ArrayList(); > + resourcePermissions = new ArrayList(); > > JARDesc jars[] = resources.getJARs(); > for (int i=0; i < jars.length; i++) { > @@ -398,7 +400,7 @@ > R("LCInit"), R("LFatalVerification"), "No jars!"); > } > */ > - List initialJars = new ArrayList(); > + List initialJars = new ArrayList(); > > for (int i=0; i < jars.length; i++) { > > @@ -585,7 +587,7 @@ > > // add in permission to read the cached JAR files > for (int i=0; i < resourcePermissions.size(); i++) > - result.add((Permission) resourcePermissions.get(i)); > + result.add(resourcePermissions.get(i)); > > // add in the permissions that the user granted. > for (int i=0; i < runtimePermissions.size(); i++) > @@ -603,12 +605,12 @@ > * to be loaded at the same time as the JARs specified (ie, are > * in the same part). > */ > - protected void fillInPartJars(List jars) { > + protected void fillInPartJars(List jars) { > for (int i=0; i < jars.size(); i++) { > - String part = ((JARDesc) jars.get(i)).getPart(); > + String part = jars.get(i).getPart(); > > for (int a=0; a < available.size(); a++) { > - JARDesc jar = (JARDesc) available.get(a); > + JARDesc jar = available.get(a); > > if (part != null && part.equals(jar.getPart())) > if (!jars.contains(jar)) > @@ -625,15 +627,15 @@ > * > * @param jars the list of jars to load > */ > - protected void activateJars(final List jars) { > - PrivilegedAction activate = new PrivilegedAction() { > + protected void activateJars(final List jars) { > + PrivilegedAction activate = new PrivilegedAction() { > > - public Object run() { > + public Void run() { > // transfer the Jars > waitForJars(jars); > > for (int i=0; i < jars.size(); i++) { > - JARDesc jar = (JARDesc) jars.get(i); > + JARDesc jar = jars.get(i); > > available.remove(jar); > > @@ -653,10 +655,9 @@ > // particularly when using The FileManager applet from Webmin. > > JarFile jarFile = new JarFile(localFile); > - Enumeration e = jarFile.entries(); > + Enumeration e = jarFile.entries(); > while (e.hasMoreElements()) { > - > - JarEntry je = (JarEntry) e.nextElement(); > + JarEntry je = e.nextElement(); > > // another jar in my jar? it is more likely than you think > if (je.getName().endsWith(".jar")) { > @@ -683,10 +684,10 @@ > > is.close(); > extractedJar.close(); > - > + > // 0 byte file? skip > if (fileSize <= 0) { > - continue; > + continue; > } > > JarSigner signer = new JarSigner(); > @@ -739,8 +740,8 @@ > // there is currently no mechanism to cache files per > // instance.. so only index cached files > if (localFile != null) { > - JarIndex index = JarIndex.getJarIndex(new JarFile(localFile.getAbsolutePath()), null); > - > + JarIndex index = JarIndex.getJarIndex(new JarFile(localFile.getAbsolutePath()), > + null); > if (index != null) > jarIndexes.add(index); > } > @@ -945,9 +946,9 @@ > * classloader, or one of the classloaders for the JNLP file's > * extensions. > */ > - public Class loadClass(String name) throws ClassNotFoundException { > + public Class loadClass(String name) throws ClassNotFoundException { > > - Class result = findLoadedClassAll(name); > + Class result = findLoadedClassAll(name); > > // try parent classloader > if (result == null) { > @@ -975,7 +976,9 @@ > // Currently this loads jars directly from the site. We cannot cache it because this > // call is initiated from within the applet, which does not have disk read/write permissions > for (JarIndex index: jarIndexes) { > - LinkedList jarList = index.get(name.replace('.', '/')); > + // Non-generic code in sun.misc.JarIndex > + @SuppressWarnings("unchecked") > + LinkedList jarList = index.get(name.replace('.', '/')); > > if (jarList != null) { > for (String jarName: jarList) { > @@ -1090,11 +1093,12 @@ > * Finds the resource in this, the parent, or the extension > * class loaders. > */ > - public Enumeration findResources(String name) throws IOException { > - Vector resources = new Vector(); > + @Override > + public Enumeration findResources(String name) throws IOException { > + Vector resources = new Vector(); > > for (int i=0; i < loaders.length; i++) { > - Enumeration e; > + Enumeration e; > > if (loaders[i] == this) > e = super.findResources(name); > @@ -1151,13 +1155,11 @@ > } > > // add jar > - List jars = new ArrayList(); > + List jars = new ArrayList(); > jars.add(available.get(0)); > > fillInPartJars(jars); > - > - > - activateJars(jars); > + activateJars(jars); > > return this; > } > @@ -1166,6 +1168,7 @@ > /** > * @deprecated > */ > + @Deprecated > public String getExtensionName() { > String result = file.getInformation().getTitle(); > > @@ -1182,6 +1185,7 @@ > /** > * @deprecated > */ > + @Deprecated > public String getExtensionHREF() { > return file.getFileLocation().toString(); > } > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java Thu Oct 21 00:21:09 2010 +0100 > @@ -98,10 +98,11 @@ > new SecurityException(JNLPRuntime.getMessage("RShutdown")); > > /** weak list of windows created */ > - private WeakList weakWindows = new WeakList(); > + private WeakList weakWindows = new WeakList(); > > /** weak list of applications corresponding to window list */ > - private WeakList weakApplications = new WeakList(); > + private WeakList weakApplications = > + new WeakList(); > > /** weak reference to most app who's windows was most recently activated */ > private WeakReference activeApplication = null; > @@ -182,14 +183,14 @@ > */ > protected ApplicationInstance getApplication(Window window) { > for (int i = weakWindows.size(); i-->0;) { > - Window w = (Window) weakWindows.get(i); > + Window w = weakWindows.get(i); > if (w == null) { > weakWindows.remove(i); > weakApplications.remove(i); > } > > if (w == window) > - return (ApplicationInstance) weakApplications.get(i); > + return weakApplications.get(i); > } > > return null; > @@ -436,7 +437,7 @@ > if (JNLPRuntime.isDebug()) > System.err.println("SM: app: "+app.getTitle()+" is adding a window: "+window); > > - weakWindows.add(window); // for mapping window -> app > + weakWindows.add(w); // for mapping window -> app > weakApplications.add(app); > > app.addWindow(w); > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/services/ServiceUtil.java > --- a/netx/net/sourceforge/jnlp/services/ServiceUtil.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/services/ServiceUtil.java Thu Oct 21 00:21:09 2010 +0100 > @@ -182,7 +182,7 @@ > System.err.println(" arg: "+args[i]); > } > > - PrivilegedExceptionAction invoker = new PrivilegedExceptionAction() { > + PrivilegedExceptionAction invoker = new PrivilegedExceptionAction() { > public Object run() throws Exception { > return method.invoke(receiver, args); > } > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/services/XPersistenceService.java > --- a/netx/net/sourceforge/jnlp/services/XPersistenceService.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/services/XPersistenceService.java Thu Oct 21 00:21:09 2010 +0100 > @@ -138,7 +138,7 @@ > if (!file.isDirectory()) > return new String[0]; > > - List result = new ArrayList(); > + List result = new ArrayList(); > > // check whether this is right: only add files and not directories. > File entries[] = file.listFiles(); > @@ -146,7 +146,7 @@ > if (entries[i].isFile()) > result.add(entries[i].getName()); > > - return (String[]) result.toArray(new String[result.size()]); > + return result.toArray(new String[result.size()]); > } > > /** > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/tools/JarSigner.java > --- a/netx/net/sourceforge/jnlp/tools/JarSigner.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/tools/JarSigner.java Thu Oct 21 00:21:09 2010 +0100 > @@ -204,7 +204,7 @@ > certs = new ArrayList(); > for (int i = 0; i < jars.size(); i++) { > > - JARDesc jar = (JARDesc) jars.get(i); > + JARDesc jar = jars.get(i); > verifiedJars = new ArrayList(); > unverifiedJars = new ArrayList(); > > diff -r 1b3abd2b1e4f netx/net/sourceforge/jnlp/util/WeakList.java > --- a/netx/net/sourceforge/jnlp/util/WeakList.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/util/WeakList.java Thu Oct 21 00:21:09 2010 +0100 > @@ -32,10 +32,10 @@ > * @author Jon A. Maxwell (JAM) - initial author > * @version $Revision: 1.3 $ > */ > -public class WeakList extends AbstractList { > +public class WeakList extends AbstractList { > > /* list of weak references */ > - private ArrayList refs = new ArrayList(); > + private ArrayList> refs = new ArrayList>(); > > > /** > @@ -47,9 +47,9 @@ > /** > * Extract the hard reference out of a weak reference. > */ > - private Object deref(Object o) { > - if (o != null && o instanceof WeakReference) > - return ((WeakReference)o).get(); > + private E deref(WeakReference o) { > + if (o != null) > + return o.get(); > else > return null; > } > @@ -58,7 +58,7 @@ > * Returns the object at the specified index, or null if the > * object has been collected. > */ > - public Object get(int index) { > + public E get(int index) { > return deref(refs.get(index)); > } > > @@ -75,23 +75,23 @@ > * previous object at that position or null if it was already > * collected. > */ > - public Object set(int index, Object element) { > - return deref(refs.set(index, new WeakReference(element))); > + public E set(int index, E element) { > + return deref(refs.set(index, new WeakReference(element))); > } > > /** > * Inserts the object at the specified position in the list. > * Automatically creates a weak reference to the object. > */ > - public void add(int index, Object element) { > - refs.add(index, new WeakReference(element)); > + public void add(int index, E element) { > + refs.add(index, new WeakReference(element)); > } > > /** > * Removes the object at the specified position and returns it > * or returns null if it was already collected. > */ > - public Object remove(int index) { > + public E remove(int index) { > return deref(refs.remove(index)); > } > > @@ -100,11 +100,11 @@ > * returned list does not include the collected elements, so its > * indices do not necessarily correlate with those of this list. > */ > - public List hardList() { > - List result = new ArrayList(); > + public List hardList() { > + List result = new ArrayList(); > > for (int i=0; i < size(); i++) { > - Object tmp = get(i); > + E tmp = get(i); > > if (tmp != null) > result.add(tmp); > diff -r 1b3abd2b1e4f netx/net/sourceforge/nanoxml/XMLElement.java > --- a/netx/net/sourceforge/nanoxml/XMLElement.java Wed Oct 20 16:52:44 2010 -0400 > +++ b/netx/net/sourceforge/nanoxml/XMLElement.java Thu Oct 21 00:21:09 2010 +0100 > @@ -106,7 +106,7 @@ > *
  • The keys and the values are strings. > * > */ > - private Hashtable attributes; > + private Hashtable attributes; > > > /** > @@ -119,7 +119,7 @@ > * or a subclass of XMLElement. > * > */ > - private Vector children; > + private Vector children; > > > /** > @@ -162,7 +162,7 @@ > *
  • The values are char arrays > * > */ > - private Hashtable entities; > + private Hashtable entities; > > > /** > @@ -242,7 +242,7 @@ > */ > public XMLElement() > { > - this(new Hashtable(), false, true, true); > + this(new Hashtable(), false, true, true); > } > > > @@ -284,7 +284,7 @@ > *
    > * > */ > - protected XMLElement(Hashtable entities, > + protected XMLElement(Hashtable entities, > boolean skipLeadingWhitespace, > boolean fillBasicConversionTable, > boolean ignoreCase) > @@ -293,17 +293,16 @@ > this.ignoreCase = ignoreCase; > this.name = null; > this.contents = ""; > - this.attributes = new Hashtable(); > - this.children = new Vector(); > + this.attributes = new Hashtable(); > + this.children = new Vector(); > this.entities = entities; > this.lineNr = 0; > - Enumeration e = this.entities.keys(); > + Enumeration e = this.entities.keys(); > while (e.hasMoreElements()) { > - Object key = e.nextElement(); > + String key = e.nextElement(); > Object value = this.entities.get(key); > if (value instanceof String) { > - value = ((String) value).toCharArray(); > - this.entities.put(key, value); > + entities.put(key, ((String) value).toCharArray()); > } > } > if (fillBasicConversionTable) { > @@ -1096,7 +1095,7 @@ > } > buf.append(ch); > } else { > - char[] value = (char[]) this.entities.get(key); > + char[] value = entities.get(key); > if (value == null) { > throw this.unknownEntity(key); > } From andrew at icedtea.classpath.org Thu Oct 21 13:12:27 2010 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Thu, 21 Oct 2010 20:12:27 +0000 Subject: /hg/icedtea-web: Fix most warnings arising from NetX code. Message-ID: changeset 85db7b3a1c93 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=85db7b3a1c93 author: Andrew John Hughes date: Thu Oct 21 21:12:21 2010 +0100 Fix most warnings arising from NetX code. 2010-10-20 Andrew John Hughes * netx/javax/jnlp/ServiceManager.java: (lookupTable): Add generic types. * netx/net/sourceforge/jnlp/AppletDesc.java: (parameters): Likewise. (AppletDesc(String,String,URL,int,int,Map)): Likewise. (getParameters()): Likewise. * netx/net/sourceforge/jnlp/ApplicationDesc.java: (getArguments()): Remove redundant cast. (addArgument(String)): Add generic typing. * netx/net/sourceforge/jnlp/ExtensionDesc.java: (extToPart): Add generic types. (eagerExtParts): Likewise. * netx/net/sourceforge/jnlp/InformationDesc.java: (info): Likewise. (getIcons(Object)): Add generic typing. (getAssociations()): Likewise. (getRelatedContents()): Likewise. (getItem(Object)): Likewise. (getItems(Object)): Likewise. (addItem(String,Object)): Likewise. * netx/net/sourceforge/jnlp/JNLPFile.java: (resources): Likewise. (InformationDesc.getItems(Object)): Likewise. (getResources(Class)): Likewise. * netx/net/sourceforge/jnlp/LaunchException.java: (getCauses()): Likewise. * netx/net/sourceforge/jnlp/Launcher.java: (launchApplication(JNLPFile)): Likewise. * netx/net/sourceforge/jnlp/NetxPanel.java: (NetxPanel(URL,Hashtable)): Likewise. (NetxPanel(URL,Hashtable,boolean)): Likewise. * netx/net/sourceforge/jnlp/Node.java: (getChildNodes()): Likewise. * netx/net/sourceforge/jnlp/Parser.java: (getResources(Node,boolean)): Likewise. (getInfo(Node)): Likewise. (getInformationDesc(Node)): Likewise. (getApplet(Node)): Likewise. (getApplication(Node)): Likewise. (splitString(String)): Likewise. (getLocales(Node)): Likewise. (getChildNodes(Node,String)): Likewise. * netx/net/sourceforge/jnlp/PluginBridge.java: Fix variable naming and add generic types. (cacheJars): Changed from cache_jars. (cacheExJars): Changed from cache_ex-jars. (atts): Add generic typing. (PluginBridge(URL,URL,String,String,int,int,Hashtable)): Likewise. (getInformation(Locale)): Likewise. (getResources(Locale,String,String)): Likewise. (getJARs()): Avoid excessive copying; filtering already performed by getResources in JNLPFile. * netx/net/sourceforge/jnlp/ResourcesDesc.java: (resources): Add generic typing. (getJREs()): Likewise. (getJARs()): Likewise. (getJARs(String)): Likewise. (getExtensions()): Likewise. (getPackages()): Likewise. (getPackages(String)): Likewise. (getProperties()): Likewise. (getPropertiesMap()): Likewise. (getResources(Class)): Make generic. * netx/net/sourceforge/jnlp/Version.java: (matches(Version)): Add generic types. (matchesAny(Version)): Likewise. (matchesSingle(String)): Likewise. (matches(String,String)): Likewise. (equal(List,List)): Likewise. (greater(List,List)): Likewise. (compare(String,String)): Use Integer.valueOf. (normalize(List,int)): Add generic types, using a List of lists rather than an array of lists. (getVersionStrings()): Add generic types. (getParts()): Likewise. * netx/net/sourceforge/jnlp/cache/CacheUtil.java: (waitForResources(ApplicationInstance,ResourceTracker, URL,String)): Likewise. * netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java: (getListener(ApplicatonInstance,String,URL)): Use setVisible instead of show(). (disposeListener(DownloadServiceListener)): Use setVisible instead of hide(). (DownloadPanel.urls): Add generic typing. (DownloadPanel.panels): Likewise. (DownloadPanel.update(URL,String,long,long,int)): Fix formatting. Add generic types. * netx/net/sourceforge/jnlp/cache/Resource.java: (resources): Add generic typing. (trackers): Likewise. (getResource(URL,Version,UpdatePolicy)): Use generic types. (getTracker()): Likewise. (addTracker(ResourceTracker)): Likewise. (fireDownloadEvent()): Likewise. * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: (prefetchTrackers): Add generic typing. (queue): Likewise. (active): Likewise. (resources): Likewise. (listeners): Likewise. (fireDownloadEvent(Resource)): Remove unneeded cast. (getPrefetch()): Use generic typing. (selectByFlag(List,int,int)): Likewise. (getResource(URL)): Likewise. * netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java: (weakClips): Add generic types. (destroy()): Use generic typing. (getApplets()): Likewise. (getStreamKeys()): Likewise. * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: (weakWindows): Add generic types. (installEnvironment()): Likewise. (destroy()): Remove redundant cast. * netx/net/sourceforge/jnlp/runtime/Boot.java: Extend PrivilegedAction. (run()): Add generic typing. (getOptions(String)): Likewise. * netx/net/sourceforge/jnlp/runtime/Boot13.java: (main(String[]): Likewise. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Fix formatting. (urlToLoader): Add generic types. (resourcePermissions): Likewise. (available): Likewise. (jarEntries): Likewise. (getInstance(JNLPFile,UpdatePolicy)): Remove redundant cast. (getInstance(URL,String,Version,UpdatePolicy)): Likewise. (initializeExtensions()): Add generic types. (initializePermissions()): Likewise. (initializeResources()): Likewise. (getPermissions(CodeSource)): Likewise. (fillInPartJars(List)): Likewise. (activateJars(List)): Likewise. (loadClass(String)): Likewise. Suppress warnings due to sun.misc.JarIndex usage. (findResources(String)): Mark as overriding. Add generic types. (getExtensionName()): Add @Deprecated annotation. (getExtensionHREF()): Likewise. * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: (weakWindows): Add generic typing. (weakApplications): Likewise. (getApplication(Window)): Remove redundant casts. Add w, which is window cast to Window. * netx/net/sourceforge/jnlp/services/ServiceUtil.java: (invoke(Object,Method,Object[])): Use generic types. * netx/net/sourceforge/jnlp/services/XPersistenceService.java: (getNames(URL)): Likewise. * netx/net/sourceforge/jnlp/tools/JarSigner.java: (verifyJars(List,ResourceTracker)): Remove redundant cast. * netx/net/sourceforge/jnlp/util/WeakList.java: Redesign as a generic type. (refs): Add generic types. (deref(WeakReference)): Likewise. (get(int)): Likewise. (set(int,Object)): Likewise. (add(int,E)): Likewise. (remove()): Likewise. (hardList()): Likewise. * netx/net/sourceforge/nanoxml/XMLElement.java: (attributes): Add generic typing. (children): Likewise. (entities): Likewise. (XMLElement()): Use generic types. (XMLElement(Hashtable): Likewise. (resolveEntity(StringBuffer)): Remove redundant cast. diffstat: 30 files changed, 484 insertions(+), 307 deletions(-) ChangeLog | 169 ++++++++++ netx/javax/jnlp/ServiceManager.java | 3 netx/net/sourceforge/jnlp/AppletDesc.java | 11 netx/net/sourceforge/jnlp/ApplicationDesc.java | 6 netx/net/sourceforge/jnlp/ExtensionDesc.java | 4 netx/net/sourceforge/jnlp/InformationDesc.java | 25 - netx/net/sourceforge/jnlp/JNLPFile.java | 12 netx/net/sourceforge/jnlp/LaunchException.java | 4 netx/net/sourceforge/jnlp/Launcher.java | 6 netx/net/sourceforge/jnlp/NetxPanel.java | 5 netx/net/sourceforge/jnlp/Node.java | 4 netx/net/sourceforge/jnlp/Parser.java | 35 +- netx/net/sourceforge/jnlp/PluginBridge.java | 140 +++----- netx/net/sourceforge/jnlp/ResourcesDesc.java | 50 +- netx/net/sourceforge/jnlp/Version.java | 59 +-- netx/net/sourceforge/jnlp/cache/CacheUtil.java | 4 netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java | 14 netx/net/sourceforge/jnlp/cache/Resource.java | 17 - netx/net/sourceforge/jnlp/cache/ResourceTracker.java | 25 - netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java | 10 netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java | 6 netx/net/sourceforge/jnlp/runtime/Boot.java | 8 netx/net/sourceforge/jnlp/runtime/Boot13.java | 4 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | 100 +++-- netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java | 11 netx/net/sourceforge/jnlp/services/ServiceUtil.java | 2 netx/net/sourceforge/jnlp/services/XPersistenceService.java | 4 netx/net/sourceforge/jnlp/tools/JarSigner.java | 2 netx/net/sourceforge/jnlp/util/WeakList.java | 28 - netx/net/sourceforge/nanoxml/XMLElement.java | 23 - diffs (truncated from 2010 to 500 lines): diff -r 1b3abd2b1e4f -r 85db7b3a1c93 ChangeLog --- a/ChangeLog Wed Oct 20 16:52:44 2010 -0400 +++ b/ChangeLog Thu Oct 21 21:12:21 2010 +0100 @@ -1,3 +1,172 @@ 2010-10-20 Omair Majid + + * netx/javax/jnlp/ServiceManager.java: + (lookupTable): Add generic types. + * netx/net/sourceforge/jnlp/AppletDesc.java: + (parameters): Likewise. + (AppletDesc(String,String,URL,int,int,Map)): Likewise. + (getParameters()): Likewise. + * netx/net/sourceforge/jnlp/ApplicationDesc.java: + (getArguments()): Remove redundant cast. + (addArgument(String)): Add generic typing. + * netx/net/sourceforge/jnlp/ExtensionDesc.java: + (extToPart): Add generic types. + (eagerExtParts): Likewise. + * netx/net/sourceforge/jnlp/InformationDesc.java: + (info): Likewise. + (getIcons(Object)): Add generic typing. + (getAssociations()): Likewise. + (getRelatedContents()): Likewise. + (getItem(Object)): Likewise. + (getItems(Object)): Likewise. + (addItem(String,Object)): Likewise. + * netx/net/sourceforge/jnlp/JNLPFile.java: + (resources): Likewise. + (InformationDesc.getItems(Object)): Likewise. + (getResources(Class)): Likewise. + * netx/net/sourceforge/jnlp/LaunchException.java: + (getCauses()): Likewise. + * netx/net/sourceforge/jnlp/Launcher.java: + (launchApplication(JNLPFile)): Likewise. + * netx/net/sourceforge/jnlp/NetxPanel.java: + (NetxPanel(URL,Hashtable)): Likewise. + (NetxPanel(URL,Hashtable,boolean)): Likewise. + * netx/net/sourceforge/jnlp/Node.java: + (getChildNodes()): Likewise. + * netx/net/sourceforge/jnlp/Parser.java: + (getResources(Node,boolean)): Likewise. + (getInfo(Node)): Likewise. + (getInformationDesc(Node)): Likewise. + (getApplet(Node)): Likewise. + (getApplication(Node)): Likewise. + (splitString(String)): Likewise. + (getLocales(Node)): Likewise. + (getChildNodes(Node,String)): Likewise. + * netx/net/sourceforge/jnlp/PluginBridge.java: + Fix variable naming and add generic types. + (cacheJars): Changed from cache_jars. + (cacheExJars): Changed from cache_ex-jars. + (atts): Add generic typing. + (PluginBridge(URL,URL,String,String,int,int,Hashtable)): Likewise. + (getInformation(Locale)): Likewise. + (getResources(Locale,String,String)): Likewise. + (getJARs()): Avoid excessive copying; filtering already performed + by getResources in JNLPFile. + * netx/net/sourceforge/jnlp/ResourcesDesc.java: + (resources): Add generic typing. + (getJREs()): Likewise. + (getJARs()): Likewise. + (getJARs(String)): Likewise. + (getExtensions()): Likewise. + (getPackages()): Likewise. + (getPackages(String)): Likewise. + (getProperties()): Likewise. + (getPropertiesMap()): Likewise. + (getResources(Class)): Make generic. + * netx/net/sourceforge/jnlp/Version.java: + (matches(Version)): Add generic types. + (matchesAny(Version)): Likewise. + (matchesSingle(String)): Likewise. + (matches(String,String)): Likewise. + (equal(List,List)): Likewise. + (greater(List,List)): Likewise. + (compare(String,String)): Use Integer.valueOf. + (normalize(List,int)): Add generic types, using + a List of lists rather than an array of lists. + (getVersionStrings()): Add generic types. + (getParts()): Likewise. + * netx/net/sourceforge/jnlp/cache/CacheUtil.java: + (waitForResources(ApplicationInstance,ResourceTracker, + URL,String)): Likewise. + * netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java: + (getListener(ApplicatonInstance,String,URL)): Use setVisible instead + of show(). + (disposeListener(DownloadServiceListener)): Use setVisible instead + of hide(). + (DownloadPanel.urls): Add generic typing. + (DownloadPanel.panels): Likewise. + (DownloadPanel.update(URL,String,long,long,int)): Fix formatting. + Add generic types. + * netx/net/sourceforge/jnlp/cache/Resource.java: + (resources): Add generic typing. + (trackers): Likewise. + (getResource(URL,Version,UpdatePolicy)): Use generic types. + (getTracker()): Likewise. + (addTracker(ResourceTracker)): Likewise. + (fireDownloadEvent()): Likewise. + * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: + (prefetchTrackers): Add generic typing. + (queue): Likewise. + (active): Likewise. + (resources): Likewise. + (listeners): Likewise. + (fireDownloadEvent(Resource)): Remove unneeded cast. + (getPrefetch()): Use generic typing. + (selectByFlag(List,int,int)): Likewise. + (getResource(URL)): Likewise. + * netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java: + (weakClips): Add generic types. + (destroy()): Use generic typing. + (getApplets()): Likewise. + (getStreamKeys()): Likewise. + * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: + (weakWindows): Add generic types. + (installEnvironment()): Likewise. + (destroy()): Remove redundant cast. + * netx/net/sourceforge/jnlp/runtime/Boot.java: + Extend PrivilegedAction. + (run()): Add generic typing. + (getOptions(String)): Likewise. + * netx/net/sourceforge/jnlp/runtime/Boot13.java: + (main(String[]): Likewise. + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: + Fix formatting. + (urlToLoader): Add generic types. + (resourcePermissions): Likewise. + (available): Likewise. + (jarEntries): Likewise. + (getInstance(JNLPFile,UpdatePolicy)): Remove redundant cast. + (getInstance(URL,String,Version,UpdatePolicy)): Likewise. + (initializeExtensions()): Add generic types. + (initializePermissions()): Likewise. + (initializeResources()): Likewise. + (getPermissions(CodeSource)): Likewise. + (fillInPartJars(List)): Likewise. + (activateJars(List)): Likewise. + (loadClass(String)): Likewise. Suppress warnings due to + sun.misc.JarIndex usage. + (findResources(String)): Mark as overriding. Add generic + types. + (getExtensionName()): Add @Deprecated annotation. + (getExtensionHREF()): Likewise. + * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: + (weakWindows): Add generic typing. + (weakApplications): Likewise. + (getApplication(Window)): Remove redundant casts. Add w, + which is window cast to Window. + * netx/net/sourceforge/jnlp/services/ServiceUtil.java: + (invoke(Object,Method,Object[])): Use generic types. + * netx/net/sourceforge/jnlp/services/XPersistenceService.java: + (getNames(URL)): Likewise. + * netx/net/sourceforge/jnlp/tools/JarSigner.java: + (verifyJars(List,ResourceTracker)): Remove redundant cast. + * netx/net/sourceforge/jnlp/util/WeakList.java: + Redesign as a generic type. + (refs): Add generic types. + (deref(WeakReference)): Likewise. + (get(int)): Likewise. + (set(int,Object)): Likewise. + (add(int,E)): Likewise. + (remove()): Likewise. + (hardList()): Likewise. + * netx/net/sourceforge/nanoxml/XMLElement.java: + (attributes): Add generic typing. + (children): Likewise. + (entities): Likewise. + (XMLElement()): Use generic types. + (XMLElement(Hashtable): Likewise. + (resolveEntity(StringBuffer)): Remove redundant cast. + 2010-10-20 Omair Majid * AUTHORS: Add Francis Kung, Andrew Su, Joshua Sumali, Mark Wielaard and diff -r 1b3abd2b1e4f -r 85db7b3a1c93 netx/javax/jnlp/ServiceManager.java --- a/netx/javax/jnlp/ServiceManager.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/javax/jnlp/ServiceManager.java Thu Oct 21 21:12:21 2010 +0100 @@ -10,7 +10,8 @@ public final class ServiceManager { private static ServiceManagerStub stub = null; - private static Map lookupTable = new HashMap(); // ensure lookup is idempotent + private static Map lookupTable + = new HashMap(); // ensure lookup is idempotent private ServiceManager() { // says it can't be instantiated diff -r 1b3abd2b1e4f -r 85db7b3a1c93 netx/net/sourceforge/jnlp/AppletDesc.java --- a/netx/net/sourceforge/jnlp/AppletDesc.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/AppletDesc.java Thu Oct 21 21:12:21 2010 +0100 @@ -45,7 +45,7 @@ public class AppletDesc { private int height; /** the parameters */ - private Map parameters; + private Map parameters; /** @@ -58,13 +58,14 @@ public class AppletDesc { * @param height the height * @param parameters the parameters */ - public AppletDesc(String name, String mainClass, URL documentBase, int width, int height, Map parameters) { + public AppletDesc(String name, String mainClass, URL documentBase, int width, int height, + Map parameters) { this.name = name; this.mainClass = mainClass; this.documentBase = documentBase; this.width = width; this.height = height; - this.parameters = new HashMap(parameters); + this.parameters = new HashMap(parameters); } /** @@ -105,8 +106,8 @@ public class AppletDesc { /** * Returns the applet parameters */ - public Map getParameters() { - return new HashMap(parameters); + public Map getParameters() { + return new HashMap(parameters); } /** diff -r 1b3abd2b1e4f -r 85db7b3a1c93 netx/net/sourceforge/jnlp/ApplicationDesc.java --- a/netx/net/sourceforge/jnlp/ApplicationDesc.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/ApplicationDesc.java Thu Oct 21 21:12:21 2010 +0100 @@ -58,17 +58,17 @@ public class ApplicationDesc { * Returns the arguments */ public String[] getArguments() { - return (String[]) arguments.clone(); + return arguments.clone(); } /** * Add an argument to the end of the arguments. */ public void addArgument(String arg) { - ArrayList l = new ArrayList(Arrays.asList(arguments)); + List l = new ArrayList(Arrays.asList(arguments)); l.add(arg); - arguments = (String[]) l.toArray(arguments); + arguments = l.toArray(arguments); } } diff -r 1b3abd2b1e4f -r 85db7b3a1c93 netx/net/sourceforge/jnlp/ExtensionDesc.java --- a/netx/net/sourceforge/jnlp/ExtensionDesc.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/ExtensionDesc.java Thu Oct 21 21:12:21 2010 +0100 @@ -45,10 +45,10 @@ public class ExtensionDesc { private JNLPFile file; /** map from ext-part to local part */ - private Map extToPart = new HashMap(); + private Map extToPart = new HashMap(); /** eager ext parts */ - private List eagerExtParts = new ArrayList(); + private List eagerExtParts = new ArrayList(); /** diff -r 1b3abd2b1e4f -r 85db7b3a1c93 netx/net/sourceforge/jnlp/InformationDesc.java --- a/netx/net/sourceforge/jnlp/InformationDesc.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/InformationDesc.java Thu Oct 21 21:12:21 2010 +0100 @@ -52,7 +52,7 @@ public class InformationDesc { private Locale locales[]; /** the data as list of key,value pairs */ - private List info; + private List info; /** the JNLPFile this information is for */ private JNLPFile jnlpFile; @@ -129,9 +129,9 @@ public class InformationDesc { * @return an array of zero of more IconDescs of the specified icon type */ public IconDesc[] getIcons(Object kind) { - List icons = getItems("icon-"+kind); + List icons = getItems("icon-"+kind); - return (IconDesc[]) icons.toArray(new IconDesc[icons.size()]); + return icons.toArray(new IconDesc[icons.size()]); }; /** @@ -204,9 +204,9 @@ public class InformationDesc { * Returns the associations specified in the JNLP file */ public AssociationDesc[] getAssociations() { - List associations = getItems("association"); + List associations = getItems("association"); - return (AssociationDesc[]) associations.toArray(new AssociationDesc[associations.size()]); + return associations.toArray(new AssociationDesc[associations.size()]); } /** @@ -220,17 +220,16 @@ public class InformationDesc { * Returns the related-contents specified by this JNLP file */ public RelatedContentDesc[] getRelatedContents() { - List relatedContents = getItems("related-content"); + List relatedContents = getItems("related-content"); - return (RelatedContentDesc[]) relatedContents.toArray( - new RelatedContentDesc[relatedContents.size()]); + return relatedContents.toArray(new RelatedContentDesc[relatedContents.size()]); } /** * Returns the last item matching the specified key. */ protected Object getItem(Object key) { - List items = getItems(key); + List items = getItems(key); if (items.size() == 0) return null; else @@ -240,11 +239,11 @@ public class InformationDesc { /** * Returns all items matching the specified key. */ - protected List getItems(Object key) { + protected List getItems(Object key) { if (info == null) - return Collections.EMPTY_LIST; + return Collections.emptyList(); - List result = new ArrayList(); + List result = new ArrayList(); for (int i=0; i < info.size(); i+=2) if (info.get(i).equals(key)) result.add( info.get(i+1) ); @@ -258,7 +257,7 @@ public class InformationDesc { */ protected void addItem(String key, Object value) { if (info == null) - info = new ArrayList(); + info = new ArrayList(); info.add(key); info.add(value); diff -r 1b3abd2b1e4f -r 85db7b3a1c93 netx/net/sourceforge/jnlp/JNLPFile.java --- a/netx/net/sourceforge/jnlp/JNLPFile.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/JNLPFile.java Thu Oct 21 21:12:21 2010 +0100 @@ -86,7 +86,7 @@ public class JNLPFile { protected UpdateDesc update; /** resources */ - protected List resources; + protected List resources; /** additional resources not in JNLP file (from command line) */ protected ResourcesDesc sharedResources = new ResourcesDesc(this, null, null, null); @@ -330,8 +330,8 @@ public class JNLPFile { */ public InformationDesc getInformation(final Locale locale) { return new InformationDesc(this, new Locale[] {locale}) { - protected List getItems(Object key) { - List result = new ArrayList(); + protected List getItems(Object key) { + List result = new ArrayList(); for (int i=0; i < info.size(); i++) { InformationDesc infoDesc = (InformationDesc) info.get(i); @@ -375,11 +375,11 @@ public class JNLPFile { */ public ResourcesDesc getResources(final Locale locale, final String os, final String arch) { return new ResourcesDesc(this, new Locale[] {locale}, new String[] {os}, new String[] {arch}) { - public List getResources(Class launchType) { - List result = new ArrayList(); + public List getResources(Class launchType) { + List result = new ArrayList(); for (int i=0; i < resources.size(); i++) { - ResourcesDesc rescDesc = (ResourcesDesc) resources.get(i); + ResourcesDesc rescDesc = resources.get(i); if (localMatches(locale, rescDesc.getLocales()) && stringMatches(os, rescDesc.getOS()) diff -r 1b3abd2b1e4f -r 85db7b3a1c93 netx/net/sourceforge/jnlp/LaunchException.java --- a/netx/net/sourceforge/jnlp/LaunchException.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/LaunchException.java Thu Oct 21 21:12:21 2010 +0100 @@ -146,7 +146,7 @@ public class LaunchException extends Exc * and will be removed once netx no longer supports 1.3. */ public Throwable[] getCauses() { - ArrayList result = new ArrayList(); + ArrayList result = new ArrayList(); Reflect r = new Reflect(); Throwable cause = this.cause; @@ -156,7 +156,7 @@ public class LaunchException extends Exc cause = (Throwable) r.invoke(cause, "getCause"); } - return (Throwable[]) result.toArray(new Throwable[0]); + return result.toArray(new Throwable[0]); } /** diff -r 1b3abd2b1e4f -r 85db7b3a1c93 netx/net/sourceforge/jnlp/Launcher.java --- a/netx/net/sourceforge/jnlp/Launcher.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/Launcher.java Thu Oct 21 21:12:21 2010 +0100 @@ -455,11 +455,11 @@ public class Launcher { R("LSFatal"), R("LCClient"), R("LCantDetermineMainClass") , R("LCantDetermineMainClassInfo"))); - Class mainClass = app.getClassLoader().loadClass(mainName); + Class mainClass = app.getClassLoader().loadClass(mainName); - Method main = mainClass.getMethod("main", new Class[] {String[].class} ); + Method main = mainClass.getMethod("main", new Class[] {String[].class} ); String args[] = file.getApplication().getArguments(); - + SwingUtilities.invokeAndWait(new Runnable() { // dummy method to force Event Dispatch Thread creation public void run(){} diff -r 1b3abd2b1e4f -r 85db7b3a1c93 netx/net/sourceforge/jnlp/NetxPanel.java --- a/netx/net/sourceforge/jnlp/NetxPanel.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/NetxPanel.java Thu Oct 21 21:12:21 2010 +0100 @@ -45,13 +45,14 @@ public class NetxPanel extends AppletVie private AppletInstance appInst = null; private boolean appletAlive; - public NetxPanel(URL documentURL, Hashtable atts) + public NetxPanel(URL documentURL, Hashtable atts) { super(documentURL, atts); } // overloaded constructor, called when initialized via plugin - public NetxPanel(URL documentURL, Hashtable atts, boolean exitOnFailure) + public NetxPanel(URL documentURL, Hashtable atts, + boolean exitOnFailure) { this(documentURL, atts); this.exitOnFailure = exitOnFailure; diff -r 1b3abd2b1e4f -r 85db7b3a1c93 netx/net/sourceforge/jnlp/Node.java --- a/netx/net/sourceforge/jnlp/Node.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/Node.java Thu Oct 21 21:12:21 2010 +0100 @@ -47,12 +47,12 @@ class Node { Node[] getChildNodes() { if (children == null) { - List list = new ArrayList(); + List list = new ArrayList(); for (Enumeration e = xml.enumerateChildren(); e.hasMoreElements();) list.add( new Node((XMLElement)e.nextElement()) ); - children = (Node[]) list.toArray( new Node[list.size()] ); + children = list.toArray( new Node[list.size()] ); for (int i=0; i < children.length-1; i++) children[i].next = children[i+1]; diff -r 1b3abd2b1e4f -r 85db7b3a1c93 netx/net/sourceforge/jnlp/Parser.java --- a/netx/net/sourceforge/jnlp/Parser.java Wed Oct 20 16:52:44 2010 -0400 +++ b/netx/net/sourceforge/jnlp/Parser.java Thu Oct 21 21:12:21 2010 +0100 @@ -239,8 +239,10 @@ class Parser { * @param j2se true if the resources are located under a j2se or java node * @throws ParseException if the JNLP file is invalid */ - public List getResources(Node parent, boolean j2se) throws ParseException { - List result = new ArrayList(); + public List getResources(Node parent, boolean j2se) + throws ParseException + { + List result = new ArrayList(); Node resources[] = getChildNodes(parent, "resources"); // ensure that there are at least one information section present @@ -433,8 +435,10 @@ class Parser { * @param parent the parent node (jnlp) * @throws ParseException if the JNLP file is invalid */ - public List getInfo(Node parent) throws ParseException { - List result = new ArrayList(); + public List getInfo(Node parent) + throws ParseException + { + List result = new ArrayList(); Node info[] = getChildNodes(parent, "information"); // ensure that there are at least one information section present @@ -455,7 +459,7 @@ class Parser { * @throws ParseException if the JNLP file is invalid */ public InformationDesc getInformationDesc(Node node) throws ParseException { - List descriptionsUsed = new ArrayList(); + List descriptionsUsed = new ArrayList(); From dbhole at redhat.com Thu Oct 21 14:05:05 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Thu, 21 Oct 2010 17:05:05 -0400 Subject: [RFC] netx: add support for parsing and saving deployment.config files In-Reply-To: <4CBC6C17.6090602@redhat.com> References: <4CBC6C17.6090602@redhat.com> Message-ID: <20101021210504.GE26975@redhat.com> * Omair Majid [2010-10-18 11:48]: > Hi, > > As described on [1], The Java Plug-in and Java Web Start support > using various deployment.properties and deployment.config files to > set behaviour of these tools. The patch adds support for parsing and > saving these files to netx. This patch does not actually use any of > these settings; it just adds support so other parts of netx can > start using them. > > This was filed as a bug by someone against the original netx project [2]. > > Any comments or concerns? > > Thanks, > Omair > > [1] http://download.oracle.com/javase/1.5.0/docs/guide/deployment/deployment-guide/properties.html > [2] http://sourceforge.net/tracker/?func=detail&aid=2832947&group_id=72541&atid=534854 > + > + /** > + * Loads properties properties file, if one exists > + * Minor typo above. > + * @param type the ConfigType to load > + * @param file the File to load Properties from > + /* exit if there is a fatal exception loading the configuration */ > + if (isApplication) { > + System.out.println(getMessage("RConfigurationError")); > + System.exit(-1); Is there a reason you chose negative exit code? NetX uses +1 everywhere else. Cheers, Deepak From omajid at redhat.com Thu Oct 21 14:26:19 2010 From: omajid at redhat.com (Omair Majid) Date: Thu, 21 Oct 2010 17:26:19 -0400 Subject: [RFC] netx: add support for parsing and saving deployment.config files In-Reply-To: <20101021210504.GE26975@redhat.com> References: <4CBC6C17.6090602@redhat.com> <20101021210504.GE26975@redhat.com> Message-ID: <4CC0AFFB.9060601@redhat.com> On 10/21/2010 05:05 PM, Deepak Bhole wrote: > * Omair Majid [2010-10-18 11:48]: >> Hi, >> >> As described on [1], The Java Plug-in and Java Web Start support >> using various deployment.properties and deployment.config files to >> set behaviour of these tools. The patch adds support for parsing and >> saving these files to netx. This patch does not actually use any of >> these settings; it just adds support so other parts of netx can >> start using them. >> >> This was filed as a bug by someone against the original netx project [2]. >> >> Any comments or concerns? >> >> Thanks, >> Omair >> >> [1] http://download.oracle.com/javase/1.5.0/docs/guide/deployment/deployment-guide/properties.html >> [2] http://sourceforge.net/tracker/?func=detail&aid=2832947&group_id=72541&atid=534854 > > > >> + >> + /** >> + * Loads properties properties file, if one exists >> + * > > Minor typo above. Fixed. > >> + * @param type the ConfigType to load >> + * @param file the File to load Properties from > > > >> + /* exit if there is a fatal exception loading the configuration */ >> + if (isApplication) { >> + System.out.println(getMessage("RConfigurationError")); >> + System.exit(-1); > > > Is there a reason you chose negative exit code? NetX uses +1 everywhere > else. > Ah, I didnt see that netx uses 1. I have fixed it now. Thanks for reviewing the patch. Area there other issues I should fix? Thanks, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-web-deployment-config-02.patch Type: text/x-patch Size: 26463 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101021/94d9f3e9/icedtea-web-deployment-config-02.patch From dbhole at redhat.com Thu Oct 21 14:38:16 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Thu, 21 Oct 2010 17:38:16 -0400 Subject: [icedtea-web] RFC: Patch to stabilize applet initialization Message-ID: <20101021213816.GF26975@redhat.com> Hi, The attached patch envelopes fixes for two of Andrew's pending patches (fixing 100% CPU load and the frame pop-up issue). In addition to those, it fixes a lot of other initialization issues, particularly when initializing multiple applets and/or closing other tabs with applets which are being initialized. With this patch, I tested over 200 parallel applet inits, randomly closing tabs, and everything works correctly. One known issue is that if timed correctly, a frame can appear outside for a fraction of a second. It always goes away instantly though, and I will be posting a patch to fix that problem in the near future. Cheers, Deepak -------------- next part -------------- A non-text attachment was scrubbed... Name: plugin-init-fixes.patch Type: text/x-patch Size: 22096 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101021/4ac44c76/plugin-init-fixes.patch From dbhole at redhat.com Thu Oct 21 14:39:40 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Thu, 21 Oct 2010 17:39:40 -0400 Subject: [RFC] netx: add support for parsing and saving deployment.config files In-Reply-To: <4CC0AFFB.9060601@redhat.com> References: <4CBC6C17.6090602@redhat.com> <20101021210504.GE26975@redhat.com> <4CC0AFFB.9060601@redhat.com> Message-ID: <20101021213940.GG26975@redhat.com> * Omair Majid [2010-10-21 17:26]: > On 10/21/2010 05:05 PM, Deepak Bhole wrote: > >* Omair Majid [2010-10-18 11:48]: > >>Hi, > >> > >>As described on [1], The Java Plug-in and Java Web Start support > >>using various deployment.properties and deployment.config files to > >>set behaviour of these tools. The patch adds support for parsing and > >>saving these files to netx. This patch does not actually use any of > >>these settings; it just adds support so other parts of netx can > >>start using them. > >> > >>This was filed as a bug by someone against the original netx project [2]. > >> > >>Any comments or concerns? > >> > >>Thanks, > >>Omair > >> > >>[1] http://download.oracle.com/javase/1.5.0/docs/guide/deployment/deployment-guide/properties.html > >>[2] http://sourceforge.net/tracker/?func=detail&aid=2832947&group_id=72541&atid=534854 > > > > > > > >>+ > >>+ /** > >>+ * Loads properties properties file, if one exists > >>+ * > > > >Minor typo above. > > Fixed. > > > > >>+ * @param type the ConfigType to load > >>+ * @param file the File to load Properties from > > > > > > > >>+ /* exit if there is a fatal exception loading the configuration */ > >>+ if (isApplication) { > >>+ System.out.println(getMessage("RConfigurationError")); > >>+ System.exit(-1); > > > > > >Is there a reason you chose negative exit code? NetX uses +1 everywhere > >else. > > > > Ah, I didnt see that netx uses 1. I have fixed it now. > > Thanks for reviewing the patch. Area there other issues I should fix? > Nope, rest looks fine. Ok for commit to HEAD. Cheers, Deepak > Thanks, > Omair > diff -r 85db7b3a1c93 netx/net/sourceforge/jnlp/ShortcutDesc.java > --- a/netx/net/sourceforge/jnlp/ShortcutDesc.java Thu Oct 21 21:12:21 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/ShortcutDesc.java Thu Oct 21 17:22:25 2010 -0400 > @@ -18,6 +18,18 @@ > > public final class ShortcutDesc { > > + /** Never create a shortcut */ > + public static final String SHORTCUT_NEVER = "NEVER"; > + /** Always create a shortcut */ > + public static final String SHORTCUT_ALWAYS = "ALWAYS"; > + /** Always ask user whether to create a shortcut */ > + public static final String SHORTCUT_ASK_USER = "ASK_USER"; > + /** Ask user whether to create a shortcut but only if jnlp file asks for it */ > + public static final String SHORTCUT_ASK_IF_HINTED = "ASK_IF_HINTED"; > + /** Always create a desktop shortcut (without prompting the user) if the jnlp > + * asks for it */ > + public static final String SHORTCUT_ALWAYS_IF_HINTED = "ALWAYS_IF_HINTED"; > + > /** the application wants to be placed on the desktop */ > private boolean onDesktop = false; > > diff -r 85db7b3a1c93 netx/net/sourceforge/jnlp/resources/Messages.properties > --- a/netx/net/sourceforge/jnlp/resources/Messages.properties Thu Oct 21 21:12:21 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Thu Oct 21 17:22:25 2010 -0400 > @@ -119,6 +119,7 @@ > RNoLockDir=Unable to create locks directory ({0}) > RNestedJarExtration=Unable to extract nested jar. > RUnexpected=Unexpected {0} at {1} > +RConfigurationError=Fatal error while reading the configuration > > # Boot options, message should be shorter than this ----------------> > BOUsage=javaws [-run-options] > diff -r 85db7b3a1c93 netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java Thu Oct 21 17:22:25 2010 -0400 > @@ -0,0 +1,573 @@ > +// Copyright (C) 2010 Red Hat, Inc. > +// > +// This library is free software; you can redistribute it and/or > +// modify it under the terms of the GNU Lesser General Public > +// License as published by the Free Software Foundation; either > +// version 2.1 of the License, or (at your option) any later version. > +// > +// This library is distributed in the hope that it will be useful, > +// but WITHOUT ANY WARRANTY; without even the implied warranty of > +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > +// Lesser General Public License for more details. > +// > +// You should have received a copy of the GNU Lesser General Public > +// License along with this library; if not, write to the Free Software > +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. > + > + > +package net.sourceforge.jnlp.runtime; > + > +import java.io.BufferedOutputStream; > +import java.io.BufferedReader; > +import java.io.File; > +import java.io.FileOutputStream; > +import java.io.FileReader; > +import java.io.IOException; > +import java.io.OutputStream; > +import java.io.PrintStream; > +import java.io.Reader; > +import java.net.MalformedURLException; > +import java.net.URL; > +import java.util.HashMap; > +import java.util.Map; > +import java.util.Properties; > +import java.util.Set; > + > +import javax.naming.ConfigurationException; > + > +import net.sourceforge.jnlp.ShortcutDesc; > + > +/** > + * Manages the various properties and configuration related to deployment. > + * > + * See: > + * http://download.oracle.com/javase/1.5.0/docs/guide/deployment/deployment-guide/properties.html > + */ > +final class DeploymentConfiguration { > + > + /** > + * Represents a value for a configuration. Provides methods to get the value > + * as well as marking the value as locked. > + */ > + private final class ConfigValue { > + > + private String value; > + private boolean locked; > + > + ConfigValue(String value) { > + this(value, false); > + } > + > + ConfigValue(String value, boolean locked) { > + this.value = value; > + this.locked = locked; > + } > + > + ConfigValue(ConfigValue other) { > + this(other.value, other.locked); > + } > + > + String get() { > + return value; > + } > + > + /** > + * Note that setting the value is not enforced - it is the caller's > + * responsibility to check if a value is locked or not before setting a > + * new value > + * > + * @param value the new value > + */ > + void set(String value) { > + this.value = value; > + } > + > + /** > + * @return true if the value has been marked as locked > + */ > + boolean isLocked() { > + return locked; > + } > + > + /** > + * Mark a value as locked > + * @param locked > + */ > + void setLocked(boolean locked) { > + this.locked = locked; > + } > + } > + > + public static final String DEPLOYMENT_DIR = ".netx"; > + public static final String DEPLOYMENT_CONFIG = "deployment.config"; > + public static final String DEPLOYMENT_PROPERTIES = "deployment.properties"; > + > + public static final String DEPLOYMENT_COMMENT = "Netx deployment configuration"; > + > + public static final int JNLP_ASSOCIATION_NEVER = 0; > + public static final int JNLP_ASSOCIATION_NEW_ONLY = 1; > + public static final int JNLP_ASSOCIATION_ASK_USER = 2; > + public static final int JNLP_ASSOCIATION_REPLACE_ASK = 3; > + > + /* > + * FIXME these should be moved into JavaConsole, but there is a strange > + * dependency in the build system. First all of netx is built. Then the > + * plugin is built. So we cannot refer to plugin code in here :( > + */ > + public static final String CONSOLE_HIDE = "HIDE"; > + public static final String CONSOLE_SHOW = "SHOW"; > + public static final String CONSOLE_DISABLE = "DISABLE"; > + > + /* FIXME these should be moved into the proxy class */ > + public static final int PROXY_TYPE_UNKNOWN = -1; > + public static final int PROXY_TYPE_NONE = 0; > + public static final int PROXY_TYPE_MANUAL = 1; > + public static final int PROXY_TYPE_AUTO = 2; > + public static final int PROXY_TYPE_BROWSER = 3; > + > + public enum ConfigType { > + System, User > + } > + > + /** is it mandatory to load the system properties? */ > + private boolean systemPropertiesMandatory = false; > + > + /** The system's deployment.config file */ > + private File systemPropertiesFile = null; > + /** The user's deployment.config file */ > + private File userPropertiesFile = null; > + > + /** the current deployment properties */ > + private Map currentConfiguration; > + > + /** the deployment properties that cannot be changed */ > + private Map unchangeableConfiguration; > + > + public DeploymentConfiguration() { > + > + } > + > + /** > + * Initialize this deployment configuration by reading configuration files. > + * Generally, it will try to continue and ignore errors it finds (such as file not found). > + * > + * @throws DeploymentException if it encounters a fatal error. > + */ > + public void initialize() throws ConfigurationException { > + Map initialProperties = loadDefaultProperties(); > + > + Map systemProperties = null; > + > + /* > + * First, try to read the system's deployment.config file to find if > + * there is a system-level deployment.poperties file > + */ > + > + File systemConfigFile = findSystemConfigFile(); > + if (systemConfigFile != null) { > + if (loadSystemConfiguration(systemConfigFile)) { > + if (JNLPRuntime.isDebug()) { > + System.out.println("System level " + DEPLOYMENT_CONFIG + " is mandatory: " + systemPropertiesMandatory); > + } > + /* Second, read the System level deployment.properties file */ > + systemProperties = loadProperties(ConfigType.System, systemPropertiesFile, > + systemPropertiesMandatory); > + } > + if (systemProperties != null) { > + mergeMaps(initialProperties, systemProperties); > + } > + } > + > + /* need a copy of the original when we have to save */ > + unchangeableConfiguration = new HashMap(); > + Set keys = initialProperties.keySet(); > + for (String key : keys) { > + unchangeableConfiguration.put(key, new ConfigValue(initialProperties.get(key))); > + } > + > + /* > + * Third, read the user's deployment.properties file > + */ > + userPropertiesFile = new File(System.getProperty("user.home") + File.separator + ".netx" > + + File.separator + DEPLOYMENT_PROPERTIES); > + Map userProperties = loadProperties(ConfigType.User, userPropertiesFile, > + false); > + if (userProperties != null) { > + mergeMaps(initialProperties, userProperties); > + } > + > + currentConfiguration = initialProperties; > + } > + > + /** > + * Get the value for the given key > + * > + * @param key the property key > + * @return the value for the key, or null if it can not be found > + */ > + String getProperty(String key) { > + return currentConfiguration.get(key).get(); > + } > + > + /** > + * @return a Set containing all the property names > + */ > + Set getAllPropertyNames() { > + return currentConfiguration.keySet(); > + } > + > + /** > + * Sets the value of corresponding to the key. If the value has been marked > + * as locked, it is not changed > + * > + * @param key the key > + * @param value the value to be associated with the key > + */ > + void setProperty(String key, String value) { > + ConfigValue currentValue = currentConfiguration.get(key); > + if (currentValue != null) { > + if (!currentValue.isLocked()) { > + currentValue.set(value); > + } > + } else { > + currentValue = new ConfigValue(value); > + currentConfiguration.put(key, currentValue); > + } > + } > + > + /** > + * Loads the default properties for deployment > + */ > + private Map loadDefaultProperties() { > + > + final String SYSTEM_HOME = System.getProperty("java.home"); > + final String SYSTEM_SECURITY = SYSTEM_HOME + File.separator + "lib" + File.separator > + + "security"; > + > + final String USER_HOME = System.getProperty("user.home") + File.separator + DEPLOYMENT_DIR; > + final String USER_SECURITY = USER_HOME + File.separator + "security"; > + > + /* > + * This is more or less a straight copy from the deployment > + * configuration page, with occasional replacements of "" or no-defaults > + * with null > + */ > + > + String[][] defaults = new String[][] { > + /* infrastructure */ > + { "deployment.user.cachedir", USER_HOME + File.separator + "cache" }, > + { "deployment.system.cachedir", null }, > + { "deployment.user.logdir", USER_HOME + File.separator + "log" }, > + { "deployment.user.tmp", USER_HOME + File.separator + "tmp" }, > + /* certificates and policy files */ > + { "deployment.user.security.policy", "file://" + USER_SECURITY + File.separator + "java.policy" }, > + { "deployment.user.security.trusted.cacerts", USER_SECURITY + File.separator + "trusted.cacerts" }, > + { "deployment.user.security.trusted.jssecacerts", USER_SECURITY + File.separator + "trusted.jssecacerts" }, > + { "deployment.user.security.trusted.certs", USER_SECURITY + File.separator + "trusted.certs" }, > + { "deployment.user.security.trusted.jssecerts", USER_SECURITY + File.separator + "trusted.jssecerts"}, > + { "deployment.user.security.trusted.clientauthcerts", USER_SECURITY + File.separator + "trusted.clientcerts" }, > + { "deployment.system.security.policy", null }, > + { "deployment.system.security.cacerts", SYSTEM_SECURITY + File.separator + "cacerts" }, > + { "deployment.system.security.jssecacerts", SYSTEM_SECURITY + File.separator + "jssecacerts" }, > + { "deployment.system.security.trusted.certs", SYSTEM_SECURITY + File.separator + "trusted.certs" }, > + { "deployment.system.security.trusted.jssecerts", SYSTEM_SECURITY + File.separator + "trusted.jssecerts" }, > + { "deployment.system.security.trusted.clientautcerts", SYSTEM_SECURITY + File.separator + "trusted.clientcerts" }, > + /* security access and control */ > + { "deployment.security.askgrantdialog.show", String.valueOf(true) }, > + { "deployment.security.askgrantdialog.notinca", String.valueOf(true) }, > + { "deployment.security.notinca.warning", String.valueOf(true) }, > + { "deployment.security.expired.warning", String.valueOf(true) }, > + { "deployment.security.jsse.hostmismatch.warning", String.valueOf(true) }, > + { "deployment.security.trusted.policy", null }, > + { "deployment.security.sandbox.awtwarningwindow", String.valueOf(true) }, > + { "deployment.security.sandbox.jnlp.enhanced", String.valueOf(true) }, > + { "deployment.security.authenticator", String.valueOf(true) }, > + /* networking */ > + { "deployment.proxy.type", String.valueOf(PROXY_TYPE_BROWSER) }, > + { "deployment.proxy.same", String.valueOf(false) }, > + { "deployment.proxy.auto.config.url", null }, > + { "deployment.proxy.bypass.list", null }, > + { "deployment.proxy.bypass.local", null }, > + { "deployment.proxy.http.host", null }, > + { "deployment.proxy.http.port", null }, > + { "deployment.proxy.https.host", null }, > + { "deployment.proxy.https.port", null }, > + { "deployment.proxy.ftp.host", null }, > + { "deployment.proxy.ftp.port", null }, > + { "deployment.proxy.socks.host", null }, > + { "deployment.proxy.socks.port", null }, > + { "deployment.proxy.override.hosts", null }, > + /* cache and optional package repository */ > + { "deployment.cache.max.size", String.valueOf("-1") }, > + { "deployment.cache.jarcompresson", String.valueOf(0) }, > + { "deployment.javapi.cache.enabled", String.valueOf(false) }, > + /* java console */ > + { "deployment.console.startup.mode", CONSOLE_HIDE }, > + /* tracing and logging */ > + { "deployment.trace", String.valueOf(false) }, > + { "deployment.log", String.valueOf(false) }, > + /* JNLP association */ > + { "deployment.javaws.associations", String.valueOf(JNLP_ASSOCIATION_ASK_USER) }, > + /* desktop integration */ > + { "deployment.javaws.shortcut", ShortcutDesc.SHORTCUT_ASK_IF_HINTED }, > + /* jre selection */ > + { "deployment.javaws.installURL", null }, > + /* jre management */ > + { "deployment.javaws.autodownload", null }, > + /* browser selection */ > + { "deployment.browser.path", null }, > + /* check for update timeout */ > + { "deployment.javaws.update.timeout", String.valueOf(500) } > + }; > + > + HashMap result = new HashMap(); > + for (int i = 0; i < defaults.length; i++) { > + String key = defaults[i][0]; > + String actualValue = defaults[i][1]; > + boolean locked = false; > + ConfigValue value = new ConfigValue(actualValue, locked); > + result.put(key, value); > + } > + > + return result; > + } > + > + /** > + * @return the location of system-level deployment.config file, or null if none can be found > + */ > + private File findSystemConfigFile() { > + File etcFile = new File(File.separator + "etc" + File.separator + ".java" + File.separator > + + "deployment" + File.separator + DEPLOYMENT_CONFIG); > + if (etcFile.isFile()) { > + return etcFile; > + } > + > + File jreFile = new File(System.getProperty("java.home") + File.separator + "lib" > + + File.separator + DEPLOYMENT_CONFIG); > + if (jreFile.isFile()) { > + return jreFile; > + } > + > + return null; > + } > + > + /** > + * Reads the system configuration file and sets the relevant > + * system-properties related variables > + */ > + private boolean loadSystemConfiguration(File configFile) { > + > + if (JNLPRuntime.isDebug()) { > + System.out.println("Loading system configuation from: " + configFile); > + } > + > + Map systemConfiguration = new HashMap(); > + try { > + systemConfiguration = parsePropertiesFile(configFile); > + } catch (IOException e) { > + if (JNLPRuntime.isDebug()) { > + System.out.println("No System level " + DEPLOYMENT_PROPERTIES + " found."); > + } > + return false; > + } > + > + /* > + * at this point, we have read the system deployment.config file > + * completely > + */ > + > + try { > + String urlString = systemConfiguration.get("deployment.system.config").get(); > + if (urlString == null) { > + if (JNLPRuntime.isDebug()) { > + System.out.println("No System level " + DEPLOYMENT_PROPERTIES + " found."); > + } > + return false; > + } > + URL url = new URL(urlString); > + if (url.getProtocol().equals("file")) { > + systemPropertiesFile = new File(url.getFile()); > + if (JNLPRuntime.isDebug()) { > + System.out.println("Using System level" + DEPLOYMENT_PROPERTIES + ": " > + + systemPropertiesFile); > + } > + ConfigValue mandatory = systemConfiguration.get("deployment.system.config.mandatory"); > + systemPropertiesMandatory = Boolean.valueOf(mandatory == null? null: mandatory.get()); > + return true; > + } else { > + if (JNLPRuntime.isDebug()) { > + System.out.println("Remote + " + DEPLOYMENT_PROPERTIES + " not supported"); > + } > + return false; > + } > + } catch (MalformedURLException e) { > + if (JNLPRuntime.isDebug()) { > + System.out.println("Invalid url for " + DEPLOYMENT_PROPERTIES); > + } > + return false; > + } > + } > + > + /** > + * Loads the properties file, if one exists > + * > + * @param type the ConfigType to load > + * @param file the File to load Properties from > + * @param mandatory indicates if reading this file is mandatory > + * > + * @throws ConfigurationException if the file is mandatory but cannot be read > + */ > + private Map loadProperties(ConfigType type, File file, boolean mandatory) > + throws ConfigurationException { > + if (file == null || !file.isFile()) { > + if (JNLPRuntime.isDebug()) { > + System.out.println("No " + type.toString() + " level " + DEPLOYMENT_PROPERTIES + " found."); > + } > + if (!mandatory) { > + return null; > + } else { > + throw new ConfigurationException(); > + } > + } > + > + if (JNLPRuntime.isDebug()) { > + System.out.println("Loading " + type.toString() + " level properties from: " + file); > + } > + try { > + return parsePropertiesFile(file); > + } catch (IOException e) { > + return null; > + } > + } > + > + > + /** > + * Saves all properties that are not part of default or system properties > + * > + * @throws IOException > + */ > + void saveProperties() throws IOException { > + if (JNLPRuntime.isDebug()) { > + System.out.println("Saving properties into " + userPropertiesFile.toString()); > + } > + Properties toSave = new Properties(); > + > + for (String key : currentConfiguration.keySet()) { > + String oldValue = unchangeableConfiguration.get(key) == null ? null > + : unchangeableConfiguration.get(key).get(); > + String newValue = currentConfiguration.get(key) == null ? null : currentConfiguration > + .get(key).get(); > + if (oldValue == null && newValue == null) { > + continue; > + } else if (oldValue == null && newValue != null) { > + toSave.setProperty(key, newValue); > + } else if (oldValue != null && newValue == null) { > + toSave.setProperty(key, newValue); > + } else { // oldValue != null && newValue != null > + if (!oldValue.equals(newValue)) { > + toSave.setProperty(key, newValue); > + } > + } > + } > + > + File backupPropertiesFile = new File(userPropertiesFile.toString() + ".old"); > + if (userPropertiesFile.isFile()) { > + if (!userPropertiesFile.renameTo(backupPropertiesFile)) { > + throw new IOException("Error saving backup copy of " + userPropertiesFile); > + } > + } > + > + userPropertiesFile.getParentFile().mkdirs(); > + OutputStream out = new BufferedOutputStream(new FileOutputStream(userPropertiesFile)); > + try { > + toSave.store(out, DEPLOYMENT_COMMENT); > + } finally { > + out.close(); > + } > + } > + > + /** > + * Reads a properties file and returns a map representing the properties > + * > + * @param propertiesFile the file to read Properties from > + * @param destination the map to which all the properties should be added > + * @throws IOException if an IO problem occurs > + */ > + private Map parsePropertiesFile(File propertiesFile) throws IOException { > + Map result = new HashMap(); > + > + Properties properties = new Properties(); > + > + Reader reader = new BufferedReader(new FileReader(propertiesFile)); > + try { > + properties.load(reader); > + } finally { > + reader.close(); > + } > + > + Set keys = properties.stringPropertyNames(); > + for (String key : keys) { > + if (key.endsWith(".locked")) { > + String realKey = key.substring(0, key.length() - ".locked".length()); > + ConfigValue configValue = result.get(realKey); > + if (configValue == null) { > + configValue = new ConfigValue(null, true); > + result.put(realKey, configValue); > + } else { > + configValue.setLocked(true); > + } > + } else { > + /* when parsing a properties we set value without checking if it is locked or not */ > + String newValue = properties.getProperty(key); > + ConfigValue configValue = result.get(key); > + if (configValue == null) { > + configValue = new ConfigValue(newValue); > + result.put(key, configValue); > + } else { > + configValue.set(newValue); > + } > + } > + } > + return result; > + } > + > + /** > + * Merges two maps while respecting whether the values have been locked or > + * not. All values from srcMap are put into finalMap, replacing values in > + * finalMap if necessary, unless the value is present and marked as locked > + * in finalMap > + * > + * @param finalMap the destination for putting values > + * @param srcMap the source for reading key value pairs > + */ > + private void mergeMaps(Map finalMap, Map srcMap) { > + for (String key: srcMap.keySet()) { > + ConfigValue configValue = finalMap.get(key); > + if (configValue == null) { > + configValue = srcMap.get(key); > + finalMap.put(key, configValue); > + } else { > + if (!configValue.isLocked()) { > + configValue.set(srcMap.get(key).get()); > + } > + } > + } > + } > + > + /** > + * Dumps the configuration to the PrintStream > + * > + * @param config a map of key,value pairs representing the configuration to > + * dump > + * @param out the PrintStream to write data to > + */ > + private static void dumpConfiguration(Map config, PrintStream out) { > + System.out.println("KEY: VALUE [Locked]"); > + > + for (String key : config.keySet()) { > + ConfigValue value = config.get(key); > + out.println("'" + key + "': '" + value.get() + "'" > + + (value.isLocked() ? " [LOCKED]" : "")); > + } > + } > +} > diff -r 85db7b3a1c93 netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Thu Oct 21 21:12:21 2010 +0100 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Thu Oct 21 17:22:25 2010 -0400 > @@ -25,6 +25,7 @@ > import java.util.List; > import java.security.*; > import javax.jnlp.*; > +import javax.naming.ConfigurationException; > > import net.sourceforge.jnlp.*; > import net.sourceforge.jnlp.cache.*; > @@ -57,6 +58,8 @@ > /** the localized resource strings */ > private static ResourceBundle resources; > > + private static final DeploymentConfiguration config = new DeploymentConfiguration(); > + > /** the security manager */ > private static JNLPSecurityManager security; > > @@ -176,6 +179,16 @@ > public static void initialize(boolean isApplication) throws IllegalStateException { > checkInitialized(); > > + try { > + config.initialize(); > + } catch (ConfigurationException e) { > + /* exit if there is a fatal exception loading the configuration */ > + if (isApplication) { > + System.out.println(getMessage("RConfigurationError")); > + System.exit(1); > + } > + } > + > isWebstartApplication = isApplication; > > //Setting the system property for javawebstart's version. > @@ -212,6 +225,7 @@ > } > > initialized = true; > + > } > > /** From dbhole at redhat.com Thu Oct 21 14:41:11 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Thu, 21 Oct 2010 17:41:11 -0400 Subject: [icedtea-web] RFC: Patch to stabilize applet initialization In-Reply-To: <20101021213816.GF26975@redhat.com> References: <20101021213816.GF26975@redhat.com> Message-ID: <20101021214110.GH26975@redhat.com> * Deepak Bhole [2010-10-21 17:38]: > Hi, > > The attached patch envelopes fixes for two of Andrew's pending patches > (fixing 100% CPU load and the frame pop-up issue). In addition to those, > it fixes a lot of other initialization issues, particularly when > initializing multiple applets and/or closing other tabs with applets > which are being initialized. > > With this patch, I tested over 200 parallel applet inits, randomly > closing tabs, and everything works correctly. > > One known issue is that if timed correctly, a frame can appear outside > for a fraction of a second. It always goes away instantly though, and I > will be posting a patch to fix that problem in the near future. > > Cheers, > Deepak Please ignore the spacing issues. I will be normalizing all spaces for all of icedtea-web in another commit after all pending patches are in. Cheers, Deepak > diff -r 85db7b3a1c93 plugin/icedteanp/java/sun/applet/PluginAppletViewer.java > --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Thu Oct 21 21:12:21 2010 +0100 > +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Thu Oct 21 17:22:56 2010 -0700 > @@ -136,12 +136,10 @@ > } > } > }); > + > + // create the frame. > + PluginAppletViewer.reFrame(null, identifier, System.out, 0, panel); > > - > - > - // create the frame. > - PluginAppletViewer.reFrame(null, identifier, System.out, handle, panel); > - > panel.init(); > > // Start the applet > @@ -179,15 +177,7 @@ > > // Wait for the panel to initialize > // (happens in a separate thread) > - while (panel.getApplet() == null && > - ((NetxPanel) panel).isAlive()) { > - try { > - Thread.sleep(50); > - PluginDebug.debug("Waiting for applet to initialize..."); > - } catch (InterruptedException ie) { > - // just wait > - } > - } > + PluginAppletViewer.waitForAppletInit((NetxPanel) panel); > > a = panel.getApplet(); > > @@ -317,7 +307,17 @@ > */ > private static String defaultSaveFile = "Applet.ser"; > > - private static enum PAV_INIT_STATUS {PRE_INIT, IN_INIT, INIT_COMPLETE, INACTIVE}; > + > + /** > + * Enumerates the current status of an applet > + * > + * PRE_INIT -> Parsing and initialization phase > + * INIT_COMPLETE -> Initialization complete, reframe pending > + * REFRAME_COMPLETE -> Reframe complete, applet is initialized and usable by the user > + * INACTIVE -> Browser has directed that the applet be destroyed (this state is non-overridable except by DESTROYED) > + * DESTROYED -> Applet has been destroyed > + */ > + private static enum PAV_INIT_STATUS {PRE_INIT, INIT_COMPLETE, REFRAME_COMPLETE, INACTIVE, DESTROYED}; > > /** > * The panel in which the applet is being displayed. > @@ -350,7 +350,6 @@ > > private static HashMap status = > new HashMap(); > - > > private long handle = 0; > private WindowListener windowEventListener = null; > @@ -380,16 +379,20 @@ > return; > > PluginAppletViewer newFrame = new PluginAppletViewer(handle, identifier, statusMsgStream, panel); > - > + > if (oldFrame != null) { > applets.remove(oldFrame.identifier); > oldFrame.removeWindowListener(oldFrame.windowEventListener); > panel.removeAppletListener(oldFrame.appletEventListener); > + > + // Add first, remove later > + newFrame.add("Center", panel); > oldFrame.remove(panel); > oldFrame.dispose(); > + } else { > + newFrame.add("Center", panel); > } > > - newFrame.add("Center", panel); > newFrame.pack(); > > newFrame.appletEventListener = new AppletEventListener(newFrame, newFrame); > @@ -397,11 +400,6 @@ > > applets.put(identifier, newFrame); > > - // dispose oldframe if necessary > - if (oldFrame != null) { > - oldFrame.dispose(); > - } > - > PluginDebug.debug(panel + " reframed"); > } > > @@ -449,7 +447,7 @@ > this.frame = frame; > this.appletViewer = appletViewer; > } > - > + > public void appletStateChanged(AppletEvent evt) > { > AppletPanel src = (AppletPanel)evt.getSource(); > @@ -483,9 +481,9 @@ > AppletPanel.changeFrameAppContext(frame, SunToolkit.targetToAppContext(a)); > else > AppletPanel.changeFrameAppContext(frame, AppContext.getAppContext()); > - > - status.put(appletViewer.identifier, PAV_INIT_STATUS.INIT_COMPLETE); > - > + > + updateStatus(appletViewer.identifier, PAV_INIT_STATUS.INIT_COMPLETE); > + > break; > } > } > @@ -510,7 +508,13 @@ > > try { > if (message.startsWith("handle")) { > - > + > + // If there is a key for this status, it means it > + // was either initialized before, or destroy has been > + // processed. Stop moving further. > + if (updateStatus(identifier, PAV_INIT_STATUS.PRE_INIT) != null) > + return; > + > // Extract the information from the message > String[] msgParts = new String[4]; > for (int i=0; i < 3; i++) { > @@ -519,32 +523,38 @@ > msgParts[i] = message.substring(spaceLocation + 1, nextSpaceLocation); > message = message.substring(nextSpaceLocation + 1); > } > - > + > long handle = Long.parseLong(msgParts[0]); > String width = msgParts[1]; > String height = msgParts[2]; > - > + > int spaceLocation = message.indexOf(' ', "tag".length()+1); > String documentBase = > UrlUtil.decode(message.substring("tag".length() + 1, spaceLocation)); > - String tag = message.substring(spaceLocation+1); > + String tag = message.substring(spaceLocation+1); > + > + // Decode the tag > + tag = tag.replace(">", ">"); > + tag = tag.replace("<", "<"); > + tag = tag.replace("&", "&"); > + tag = tag.replace(" ", "\n"); > + tag = tag.replace(" ", "\r"); > + tag = tag.replace(""", "\""); > > PluginDebug.debug ("Handle = " + handle + "\n" + > "Width = " + width + "\n" + > "Height = " + height + "\n" + > "DocumentBase = " + documentBase + "\n" + > "Tag = " + tag); > - > - status.put(identifier, PAV_INIT_STATUS.PRE_INIT); > + > PluginAppletViewer.parse > (identifier, handle, width, height, > new StringReader(tag), > new URL(documentBase)); > - > > int maxWait = APPLET_TIMEOUT; // wait for applet to fully load > int wait = 0; > - while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && > + while ( !applets.containsKey(identifier) && // Map is populated only by reFrame > (wait < maxWait)) { > > try { > @@ -555,9 +565,44 @@ > } > } > > - if (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE)) > + // If wait exceeded maxWait, we timed out. Throw an exception > + if (wait >= maxWait) > throw new Exception("Applet initialization timeout"); > > + PluginAppletViewer oldFrame = applets.get(identifier); > + > + // We should not try to destroy an applet during > + // initialization. It may cause an inconsistent state, > + // which would bad if it's a trusted applet that > + // read/writes to files > + waitForAppletInit((NetxPanel) applets.get(identifier).panel); > + > + // Should we proceed with reframing? > + if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { > + destroyApplet(identifier); > + return; > + } > + > + // Proceed with re-framing > + reFrame(oldFrame, identifier, System.out, handle, oldFrame.panel); > + > + // There is a slight chance that destroy can happen > + // between the above and below line > + if (updateStatus(identifier, PAV_INIT_STATUS.REFRAME_COMPLETE).equals(PAV_INIT_STATUS.INACTIVE)) { > + destroyApplet(identifier); > + } > + > + } else if (message.startsWith("destroy")) { > + > + // Set it inactive, and try to do cleanup is applicable > + PAV_INIT_STATUS previousStatus = updateStatus(identifier, PAV_INIT_STATUS.INACTIVE); > + PluginDebug.debug("Destroy status set for " + identifier); > + > + if (previousStatus != null && > + previousStatus.equals(PAV_INIT_STATUS.REFRAME_COMPLETE)) { > + destroyApplet(identifier); > + } > + > } else { > PluginDebug.debug ("Handling message: " + message + " instance " + identifier + " " + Thread.currentThread()); > > @@ -568,7 +613,7 @@ > status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT) > ) > ); > - > + > // don't bother processing further for inactive applets > if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) > return; > @@ -580,31 +625,131 @@ > e.printStackTrace(); > > // If an exception happened during pre-init, we need to update status > - if (status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT)) > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > + updateStatus(identifier, PAV_INIT_STATUS.INACTIVE); > > throw new RuntimeException("Failed to handle message: " + > message + " for instance " + identifier, e); > } > } > - > + > + /** > + * Sets the status unless an overriding status is set (e.g. if > + * status is DESTROYED, it may not be overridden). > + * > + * @param identifier The identifier for which the status is to be set > + * @param status The status to switch to > + * @return The previous status > + */ > + private static synchronized PAV_INIT_STATUS updateStatus(int identifier, PAV_INIT_STATUS newStatus) { > + > + PAV_INIT_STATUS prev = status.get(identifier); > + > + // If the status is set > + if (status.containsKey(identifier)) { > + > + // Nothing may override destroyed status > + if (status.get(identifier).equals(PAV_INIT_STATUS.DESTROYED)) { > + return prev; > + } > + > + // If status is inactive, only DESTROYED may override it > + if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { > + if (!newStatus.equals(PAV_INIT_STATUS.DESTROYED)) { > + return prev; > + } > + } > + } > + > + // Else set to given status > + status.put(identifier, newStatus); > + > + return prev; > + } > + > + /** > + * Destroys the given applet instance. > + * > + * This function may be called multiple times without problems. > + * It does a synchronized check on the status and will only > + * attempt to destroy the applet if not previously destroyed. > + * > + * @param identifier The instance which is to be destroyed > + */ > + > + private static synchronized void destroyApplet(int identifier) { > + > + PluginDebug.debug("DestroyApplet called for " + identifier); > + > + PAV_INIT_STATUS prev = updateStatus(identifier, PAV_INIT_STATUS.DESTROYED); > + > + // If already destroyed, return > + if (prev.equals(PAV_INIT_STATUS.DESTROYED)) { > + PluginDebug.debug(identifier + " already destroyed. Returning."); > + return; > + } > + > + // If already disposed, return > + if (applets.get(identifier).panel.applet == null) { > + // Try to still dispose the panel itself -- no harm done with double dispose > + applets.get(identifier).dispose(); > + > + PluginDebug.debug(identifier + " inactive. Returning."); > + return; > + } > + > + PluginDebug.debug("Attempting to destroy " + identifier); > + > + final int fIdentifier = identifier; > + SwingUtilities.invokeLater(new Runnable() { > + public void run() { > + applets.get(fIdentifier).appletClose(); > + } > + }); > + > + PluginDebug.debug(identifier + " destroyed"); > + } > + > + /** > + * Function to block until applet initialization is complete > + * > + * @param identifier The instance to wait for > + */ > + public static void waitForAppletInit(NetxPanel panel) { > + > + int waitTime = 0; > + > + // Wait till initialization finishes > + while (panel.getApplet() == null && > + panel.isAlive() && > + waitTime < APPLET_TIMEOUT) { > + try { > + if (waitTime%500 == 0) > + PluginDebug.debug("Waiting for applet panel " + panel + " to initialize..."); > + > + Thread.sleep(waitTime += 50); > + } catch (InterruptedException ie) { > + // just wait > + } > + } > + > + PluginDebug.debug("Applet panel " + panel + " initialized"); > + } > + > public void handleMessage(int reference, String message) > { > if (message.startsWith("width")) { > > // Wait for panel to come alive > int maxWait = APPLET_TIMEOUT; // wait for panel to come alive > - int wait = 0; > + int wait = 0; > while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && wait < maxWait) { > - > - try { > - Thread.sleep(50); > - wait += 50; > - } catch (InterruptedException ie) { > - // just wait > - } > - } > - > + try { > + Thread.sleep(50); > + wait += 50; > + } catch (InterruptedException ie) { > + // just wait > + } > + } > > // 0 => width, 1=> width_value, 2 => height, 3=> height_value > String[] dimMsg = message.split(" "); > @@ -636,7 +781,7 @@ > > panel.setSize(width, height); > panel.validate(); > - > + > panel.applet.resize(width, height); > panel.applet.validate(); > } > @@ -649,9 +794,6 @@ > e.printStackTrace(); > } > > - } else if (message.startsWith("destroy")) { > - dispose(); > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > } else if (message.startsWith("GetJavaObject")) { > > // FIXME: how do we determine what security context this > @@ -672,15 +814,7 @@ > > // Wait for the panel to initialize > // (happens in a separate thread) > - while (panel.getApplet() == null && > - ((NetxPanel) panel).isAlive()) { > - try { > - Thread.sleep(50); > - PluginDebug.debug("Waiting for applet to initialize..."); > - } catch (InterruptedException ie) { > - // just wait > - } > - } > + waitForAppletInit((NetxPanel) panel); > > PluginDebug.debug(panel + " -- " + panel.getApplet() + " -- " + ((NetxPanel) panel).isAlive()); > > @@ -1548,10 +1682,11 @@ > if (countApplets() == 0) { > appletSystemExit(); > } > + > + updateStatus(identifier, PAV_INIT_STATUS.DESTROYED); > } > }).start(); > > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > } > > /** > @@ -1677,18 +1812,6 @@ > val = buf.toString(); > } > > - att = att.replace(">", ">"); > - att = att.replace("<", "<"); > - att = att.replace("&", "&"); > - att = att.replace(" ", "\n"); > - att = att.replace(" ", "\r"); > - > - val = val.replace(">", ">"); > - val = val.replace("<", "<"); > - val = val.replace("&", "&"); > - val = val.replace(" ", "\n"); > - val = val.replace(" ", "\r"); > - > PluginDebug.debug("PUT " + att + " = '" + val + "'"); > atts.put(att.toLowerCase(java.util.Locale.ENGLISH), val); > > @@ -1708,7 +1831,6 @@ > // private static final == inline > private static final boolean isInt(Object o) { > boolean isInt = false; > - > try { > Integer.parseInt((String) o); > isInt = true; > @@ -1763,7 +1885,6 @@ > } catch (IOException ioe) { > return ioe; > } > - > return null; > } > }; > @@ -1785,6 +1906,7 @@ > boolean isObjectTag = false; > boolean isEmbedTag = false; > boolean objectTagAlreadyParsed = false; > + > // The current character > // FIXME: This is an evil hack to force pass-by-reference.. the > // parsing code needs to be rewritten from scratch to prevent such > @@ -1879,19 +2001,6 @@ > if (val == null) { > statusMsgStream.println(requiresNameWarning); > } else if (atts != null) { > - att = att.replace(">", ">"); > - att = att.replace("<", "<"); > - att = att.replace("&", "&"); > - att = att.replace(" ", "\n"); > - att = att.replace(" ", "\r"); > - att = att.replace(""", "\""); > - > - val = val.replace(">", ">"); > - val = val.replace("<", "<"); > - val = val.replace("&", "&"); > - val = val.replace(" ", "\n"); > - val = val.replace(" ", "\r"); > - val = val.replace(""", "\""); > PluginDebug.debug("PUT " + att + " = " + val); > atts.put(att.toLowerCase(), val); > } else { > @@ -1920,8 +2029,8 @@ > > if (atts.get("width") == null || !isInt(atts.get("width"))) { > atts.put("width", width); > - } > - > + } > + > if (atts.get("height") == null || !isInt(atts.get("height"))) { > atts.put("height", height); > } > @@ -1974,7 +2083,7 @@ > if (atts.get("width") == null || !isInt(atts.get("width"))) { > atts.put("width", width); > } > - > + > if (atts.get("height") == null || !isInt(atts.get("height"))) { > atts.put("height", height); > } > @@ -2023,10 +2132,11 @@ > if (atts.get("width") == null || !isInt(atts.get("width"))) { > atts.put("width", width); > } > - > + > if (atts.get("height") == null || !isInt(atts.get("height"))) { > atts.put("height", height); > } > + > } > } > } > diff -r 85db7b3a1c93 plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java > --- a/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java Thu Oct 21 21:12:21 2010 +0100 > +++ b/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java Thu Oct 21 17:22:56 2010 -0700 > @@ -126,6 +126,10 @@ > } > > private String getPriorityStrIfPriority(String message) { > + > + // Destroy messages are permanently high priority > + if (message.endsWith("destroy")) > + return "destroy"; > > synchronized (priorityWaitQueue) { > Iterator it = priorityWaitQueue.iterator(); > @@ -150,7 +154,6 @@ > } > } > > - > public void notifyWorkerIsFree(PluginMessageHandlerWorker worker) { > synchronized (initWorkers) { > Iterator i = initWorkers.keySet().iterator(); > @@ -176,6 +179,32 @@ > } > > protected class ConsumerThread extends Thread { > + > + /** > + * Scans the readQueue for priority messages and brings them to the front > + */ > + private void bringPriorityMessagesToFront() { > + synchronized (readQueue) { > + > + // iterate through the list > + for (int i=0; i < readQueue.size(); i++) { > + > + // remove element at i to inspect it > + String message = readQueue.remove(i); > + > + // if element at i is a priority msg, bring it forward > + if (getPriorityStrIfPriority(message) != null) { > + readQueue.addFirst(message); > + } else { // else keep it where it was > + readQueue.add(i, message); > + } > + > + // by the end the queue size is the same, so the > + // position indicator (i) is still valid > + } > + } > + } > + > public void run() { > > while (true) { > @@ -190,7 +219,6 @@ > > String[] msgParts = message.split(" "); > > - > String priorityStr = getPriorityStrIfPriority(message); > boolean isPriorityResponse = (priorityStr != null); > > @@ -199,9 +227,12 @@ > > if (worker == null) { > synchronized(readQueue) { > - readQueue.addLast(message); > + readQueue.addFirst(message); > } > > + // re-scan to see if any priority message came in > + bringPriorityMessagesToFront(); > + > continue; // re-loop to try next msg > } > From ahughes at redhat.com Thu Oct 21 14:52:40 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Thu, 21 Oct 2010 22:52:40 +0100 Subject: [icedtea-web] RFC: Patch to stabilize applet initialization In-Reply-To: <20101021213816.GF26975@redhat.com> References: <20101021213816.GF26975@redhat.com> Message-ID: <20101021215240.GD25601@rivendell.middle-earth.co.uk> On 17:38 Thu 21 Oct , Deepak Bhole wrote: > Hi, > > The attached patch envelopes fixes for two of Andrew's pending patches > (fixing 100% CPU load and the frame pop-up issue). In addition to those, > it fixes a lot of other initialization issues, particularly when > initializing multiple applets and/or closing other tabs with applets > which are being initialized. > > With this patch, I tested over 200 parallel applet inits, randomly > closing tabs, and everything works correctly. > > One known issue is that if timed correctly, a frame can appear outside > for a fraction of a second. It always goes away instantly though, and I > will be posting a patch to fix that problem in the near future. > > Cheers, > Deepak Do you have a ChangeLog for this? It would be good to know why each change is being made. In particular, why: > + > + // Add first, remove later > + newFrame.add("Center", panel); > oldFrame.remove(panel); > oldFrame.dispose(); > + } else { > + newFrame.add("Center", panel); > } > > - newFrame.add("Center", panel); is this necessary? Also there seems to be some odd whitespace changes and excessive (8 space) indenting. > diff -r 85db7b3a1c93 plugin/icedteanp/java/sun/applet/PluginAppletViewer.java > --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Thu Oct 21 21:12:21 2010 +0100 > +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Thu Oct 21 17:22:56 2010 -0700 > @@ -136,12 +136,10 @@ > } > } > }); > + > + // create the frame. > + PluginAppletViewer.reFrame(null, identifier, System.out, 0, panel); > > - > - > - // create the frame. > - PluginAppletViewer.reFrame(null, identifier, System.out, handle, panel); > - > panel.init(); > > // Start the applet > @@ -179,15 +177,7 @@ > > // Wait for the panel to initialize > // (happens in a separate thread) > - while (panel.getApplet() == null && > - ((NetxPanel) panel).isAlive()) { > - try { > - Thread.sleep(50); > - PluginDebug.debug("Waiting for applet to initialize..."); > - } catch (InterruptedException ie) { > - // just wait > - } > - } > + PluginAppletViewer.waitForAppletInit((NetxPanel) panel); > > a = panel.getApplet(); > > @@ -317,7 +307,17 @@ > */ > private static String defaultSaveFile = "Applet.ser"; > > - private static enum PAV_INIT_STATUS {PRE_INIT, IN_INIT, INIT_COMPLETE, INACTIVE}; > + > + /** > + * Enumerates the current status of an applet > + * > + * PRE_INIT -> Parsing and initialization phase > + * INIT_COMPLETE -> Initialization complete, reframe pending > + * REFRAME_COMPLETE -> Reframe complete, applet is initialized and usable by the user > + * INACTIVE -> Browser has directed that the applet be destroyed (this state is non-overridable except by DESTROYED) > + * DESTROYED -> Applet has been destroyed > + */ > + private static enum PAV_INIT_STATUS {PRE_INIT, INIT_COMPLETE, REFRAME_COMPLETE, INACTIVE, DESTROYED}; > > /** > * The panel in which the applet is being displayed. > @@ -350,7 +350,6 @@ > > private static HashMap status = > new HashMap(); > - > > private long handle = 0; > private WindowListener windowEventListener = null; > @@ -380,16 +379,20 @@ > return; > > PluginAppletViewer newFrame = new PluginAppletViewer(handle, identifier, statusMsgStream, panel); > - > + > if (oldFrame != null) { > applets.remove(oldFrame.identifier); > oldFrame.removeWindowListener(oldFrame.windowEventListener); > panel.removeAppletListener(oldFrame.appletEventListener); > + > + // Add first, remove later > + newFrame.add("Center", panel); > oldFrame.remove(panel); > oldFrame.dispose(); > + } else { > + newFrame.add("Center", panel); > } > > - newFrame.add("Center", panel); > newFrame.pack(); > > newFrame.appletEventListener = new AppletEventListener(newFrame, newFrame); > @@ -397,11 +400,6 @@ > > applets.put(identifier, newFrame); > > - // dispose oldframe if necessary > - if (oldFrame != null) { > - oldFrame.dispose(); > - } > - > PluginDebug.debug(panel + " reframed"); > } > > @@ -449,7 +447,7 @@ > this.frame = frame; > this.appletViewer = appletViewer; > } > - > + > public void appletStateChanged(AppletEvent evt) > { > AppletPanel src = (AppletPanel)evt.getSource(); > @@ -483,9 +481,9 @@ > AppletPanel.changeFrameAppContext(frame, SunToolkit.targetToAppContext(a)); > else > AppletPanel.changeFrameAppContext(frame, AppContext.getAppContext()); > - > - status.put(appletViewer.identifier, PAV_INIT_STATUS.INIT_COMPLETE); > - > + > + updateStatus(appletViewer.identifier, PAV_INIT_STATUS.INIT_COMPLETE); > + > break; > } > } > @@ -510,7 +508,13 @@ > > try { > if (message.startsWith("handle")) { > - > + > + // If there is a key for this status, it means it > + // was either initialized before, or destroy has been > + // processed. Stop moving further. > + if (updateStatus(identifier, PAV_INIT_STATUS.PRE_INIT) != null) > + return; > + > // Extract the information from the message > String[] msgParts = new String[4]; > for (int i=0; i < 3; i++) { > @@ -519,32 +523,38 @@ > msgParts[i] = message.substring(spaceLocation + 1, nextSpaceLocation); > message = message.substring(nextSpaceLocation + 1); > } > - > + > long handle = Long.parseLong(msgParts[0]); > String width = msgParts[1]; > String height = msgParts[2]; > - > + > int spaceLocation = message.indexOf(' ', "tag".length()+1); > String documentBase = > UrlUtil.decode(message.substring("tag".length() + 1, spaceLocation)); > - String tag = message.substring(spaceLocation+1); > + String tag = message.substring(spaceLocation+1); > + > + // Decode the tag > + tag = tag.replace(">", ">"); > + tag = tag.replace("<", "<"); > + tag = tag.replace("&", "&"); > + tag = tag.replace(" ", "\n"); > + tag = tag.replace(" ", "\r"); > + tag = tag.replace(""", "\""); > > PluginDebug.debug ("Handle = " + handle + "\n" + > "Width = " + width + "\n" + > "Height = " + height + "\n" + > "DocumentBase = " + documentBase + "\n" + > "Tag = " + tag); > - > - status.put(identifier, PAV_INIT_STATUS.PRE_INIT); > + > PluginAppletViewer.parse > (identifier, handle, width, height, > new StringReader(tag), > new URL(documentBase)); > - > > int maxWait = APPLET_TIMEOUT; // wait for applet to fully load > int wait = 0; > - while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && > + while ( !applets.containsKey(identifier) && // Map is populated only by reFrame > (wait < maxWait)) { > > try { > @@ -555,9 +565,44 @@ > } > } > > - if (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE)) > + // If wait exceeded maxWait, we timed out. Throw an exception > + if (wait >= maxWait) > throw new Exception("Applet initialization timeout"); > > + PluginAppletViewer oldFrame = applets.get(identifier); > + > + // We should not try to destroy an applet during > + // initialization. It may cause an inconsistent state, > + // which would bad if it's a trusted applet that > + // read/writes to files > + waitForAppletInit((NetxPanel) applets.get(identifier).panel); > + > + // Should we proceed with reframing? > + if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { > + destroyApplet(identifier); > + return; > + } > + > + // Proceed with re-framing > + reFrame(oldFrame, identifier, System.out, handle, oldFrame.panel); > + > + // There is a slight chance that destroy can happen > + // between the above and below line > + if (updateStatus(identifier, PAV_INIT_STATUS.REFRAME_COMPLETE).equals(PAV_INIT_STATUS.INACTIVE)) { > + destroyApplet(identifier); > + } > + > + } else if (message.startsWith("destroy")) { > + > + // Set it inactive, and try to do cleanup is applicable > + PAV_INIT_STATUS previousStatus = updateStatus(identifier, PAV_INIT_STATUS.INACTIVE); > + PluginDebug.debug("Destroy status set for " + identifier); > + > + if (previousStatus != null && > + previousStatus.equals(PAV_INIT_STATUS.REFRAME_COMPLETE)) { > + destroyApplet(identifier); > + } > + > } else { > PluginDebug.debug ("Handling message: " + message + " instance " + identifier + " " + Thread.currentThread()); > > @@ -568,7 +613,7 @@ > status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT) > ) > ); > - > + > // don't bother processing further for inactive applets > if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) > return; > @@ -580,31 +625,131 @@ > e.printStackTrace(); > > // If an exception happened during pre-init, we need to update status > - if (status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT)) > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > + updateStatus(identifier, PAV_INIT_STATUS.INACTIVE); > > throw new RuntimeException("Failed to handle message: " + > message + " for instance " + identifier, e); > } > } > - > + > + /** > + * Sets the status unless an overriding status is set (e.g. if > + * status is DESTROYED, it may not be overridden). > + * > + * @param identifier The identifier for which the status is to be set > + * @param status The status to switch to > + * @return The previous status > + */ > + private static synchronized PAV_INIT_STATUS updateStatus(int identifier, PAV_INIT_STATUS newStatus) { > + > + PAV_INIT_STATUS prev = status.get(identifier); > + > + // If the status is set > + if (status.containsKey(identifier)) { > + > + // Nothing may override destroyed status > + if (status.get(identifier).equals(PAV_INIT_STATUS.DESTROYED)) { > + return prev; > + } > + > + // If status is inactive, only DESTROYED may override it > + if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { > + if (!newStatus.equals(PAV_INIT_STATUS.DESTROYED)) { > + return prev; > + } > + } > + } > + > + // Else set to given status > + status.put(identifier, newStatus); > + > + return prev; > + } > + > + /** > + * Destroys the given applet instance. > + * > + * This function may be called multiple times without problems. > + * It does a synchronized check on the status and will only > + * attempt to destroy the applet if not previously destroyed. > + * > + * @param identifier The instance which is to be destroyed > + */ > + > + private static synchronized void destroyApplet(int identifier) { > + > + PluginDebug.debug("DestroyApplet called for " + identifier); > + > + PAV_INIT_STATUS prev = updateStatus(identifier, PAV_INIT_STATUS.DESTROYED); > + > + // If already destroyed, return > + if (prev.equals(PAV_INIT_STATUS.DESTROYED)) { > + PluginDebug.debug(identifier + " already destroyed. Returning."); > + return; > + } > + > + // If already disposed, return > + if (applets.get(identifier).panel.applet == null) { > + // Try to still dispose the panel itself -- no harm done with double dispose > + applets.get(identifier).dispose(); > + > + PluginDebug.debug(identifier + " inactive. Returning."); > + return; > + } > + > + PluginDebug.debug("Attempting to destroy " + identifier); > + > + final int fIdentifier = identifier; > + SwingUtilities.invokeLater(new Runnable() { > + public void run() { > + applets.get(fIdentifier).appletClose(); > + } > + }); > + > + PluginDebug.debug(identifier + " destroyed"); > + } > + > + /** > + * Function to block until applet initialization is complete > + * > + * @param identifier The instance to wait for > + */ > + public static void waitForAppletInit(NetxPanel panel) { > + > + int waitTime = 0; > + > + // Wait till initialization finishes > + while (panel.getApplet() == null && > + panel.isAlive() && > + waitTime < APPLET_TIMEOUT) { > + try { > + if (waitTime%500 == 0) > + PluginDebug.debug("Waiting for applet panel " + panel + " to initialize..."); > + > + Thread.sleep(waitTime += 50); > + } catch (InterruptedException ie) { > + // just wait > + } > + } > + > + PluginDebug.debug("Applet panel " + panel + " initialized"); > + } > + > public void handleMessage(int reference, String message) > { > if (message.startsWith("width")) { > > // Wait for panel to come alive > int maxWait = APPLET_TIMEOUT; // wait for panel to come alive > - int wait = 0; > + int wait = 0; > while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && wait < maxWait) { > - > - try { > - Thread.sleep(50); > - wait += 50; > - } catch (InterruptedException ie) { > - // just wait > - } > - } > - > + try { > + Thread.sleep(50); > + wait += 50; > + } catch (InterruptedException ie) { > + // just wait > + } > + } > > // 0 => width, 1=> width_value, 2 => height, 3=> height_value > String[] dimMsg = message.split(" "); > @@ -636,7 +781,7 @@ > > panel.setSize(width, height); > panel.validate(); > - > + > panel.applet.resize(width, height); > panel.applet.validate(); > } > @@ -649,9 +794,6 @@ > e.printStackTrace(); > } > > - } else if (message.startsWith("destroy")) { > - dispose(); > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > } else if (message.startsWith("GetJavaObject")) { > > // FIXME: how do we determine what security context this > @@ -672,15 +814,7 @@ > > // Wait for the panel to initialize > // (happens in a separate thread) > - while (panel.getApplet() == null && > - ((NetxPanel) panel).isAlive()) { > - try { > - Thread.sleep(50); > - PluginDebug.debug("Waiting for applet to initialize..."); > - } catch (InterruptedException ie) { > - // just wait > - } > - } > + waitForAppletInit((NetxPanel) panel); > > PluginDebug.debug(panel + " -- " + panel.getApplet() + " -- " + ((NetxPanel) panel).isAlive()); > > @@ -1548,10 +1682,11 @@ > if (countApplets() == 0) { > appletSystemExit(); > } > + > + updateStatus(identifier, PAV_INIT_STATUS.DESTROYED); > } > }).start(); > > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > } > > /** > @@ -1677,18 +1812,6 @@ > val = buf.toString(); > } > > - att = att.replace(">", ">"); > - att = att.replace("<", "<"); > - att = att.replace("&", "&"); > - att = att.replace(" ", "\n"); > - att = att.replace(" ", "\r"); > - > - val = val.replace(">", ">"); > - val = val.replace("<", "<"); > - val = val.replace("&", "&"); > - val = val.replace(" ", "\n"); > - val = val.replace(" ", "\r"); > - > PluginDebug.debug("PUT " + att + " = '" + val + "'"); > atts.put(att.toLowerCase(java.util.Locale.ENGLISH), val); > > @@ -1708,7 +1831,6 @@ > // private static final == inline > private static final boolean isInt(Object o) { > boolean isInt = false; > - > try { > Integer.parseInt((String) o); > isInt = true; > @@ -1763,7 +1885,6 @@ > } catch (IOException ioe) { > return ioe; > } > - > return null; > } > }; > @@ -1785,6 +1906,7 @@ > boolean isObjectTag = false; > boolean isEmbedTag = false; > boolean objectTagAlreadyParsed = false; > + > // The current character > // FIXME: This is an evil hack to force pass-by-reference.. the > // parsing code needs to be rewritten from scratch to prevent such > @@ -1879,19 +2001,6 @@ > if (val == null) { > statusMsgStream.println(requiresNameWarning); > } else if (atts != null) { > - att = att.replace(">", ">"); > - att = att.replace("<", "<"); > - att = att.replace("&", "&"); > - att = att.replace(" ", "\n"); > - att = att.replace(" ", "\r"); > - att = att.replace(""", "\""); > - > - val = val.replace(">", ">"); > - val = val.replace("<", "<"); > - val = val.replace("&", "&"); > - val = val.replace(" ", "\n"); > - val = val.replace(" ", "\r"); > - val = val.replace(""", "\""); > PluginDebug.debug("PUT " + att + " = " + val); > atts.put(att.toLowerCase(), val); > } else { > @@ -1920,8 +2029,8 @@ > > if (atts.get("width") == null || !isInt(atts.get("width"))) { > atts.put("width", width); > - } > - > + } > + > if (atts.get("height") == null || !isInt(atts.get("height"))) { > atts.put("height", height); > } > @@ -1974,7 +2083,7 @@ > if (atts.get("width") == null || !isInt(atts.get("width"))) { > atts.put("width", width); > } > - > + > if (atts.get("height") == null || !isInt(atts.get("height"))) { > atts.put("height", height); > } > @@ -2023,10 +2132,11 @@ > if (atts.get("width") == null || !isInt(atts.get("width"))) { > atts.put("width", width); > } > - > + > if (atts.get("height") == null || !isInt(atts.get("height"))) { > atts.put("height", height); > } > + > } > } > } > diff -r 85db7b3a1c93 plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java > --- a/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java Thu Oct 21 21:12:21 2010 +0100 > +++ b/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java Thu Oct 21 17:22:56 2010 -0700 > @@ -126,6 +126,10 @@ > } > > private String getPriorityStrIfPriority(String message) { > + > + // Destroy messages are permanently high priority > + if (message.endsWith("destroy")) > + return "destroy"; > > synchronized (priorityWaitQueue) { > Iterator it = priorityWaitQueue.iterator(); > @@ -150,7 +154,6 @@ > } > } > > - > public void notifyWorkerIsFree(PluginMessageHandlerWorker worker) { > synchronized (initWorkers) { > Iterator i = initWorkers.keySet().iterator(); > @@ -176,6 +179,32 @@ > } > > protected class ConsumerThread extends Thread { > + > + /** > + * Scans the readQueue for priority messages and brings them to the front > + */ > + private void bringPriorityMessagesToFront() { > + synchronized (readQueue) { > + > + // iterate through the list > + for (int i=0; i < readQueue.size(); i++) { > + > + // remove element at i to inspect it > + String message = readQueue.remove(i); > + > + // if element at i is a priority msg, bring it forward > + if (getPriorityStrIfPriority(message) != null) { > + readQueue.addFirst(message); > + } else { // else keep it where it was > + readQueue.add(i, message); > + } > + > + // by the end the queue size is the same, so the > + // position indicator (i) is still valid > + } > + } > + } > + > public void run() { > > while (true) { > @@ -190,7 +219,6 @@ > > String[] msgParts = message.split(" "); > > - > String priorityStr = getPriorityStrIfPriority(message); > boolean isPriorityResponse = (priorityStr != null); > > @@ -199,9 +227,12 @@ > > if (worker == null) { > synchronized(readQueue) { > - readQueue.addLast(message); > + readQueue.addFirst(message); > } > > + // re-scan to see if any priority message came in > + bringPriorityMessagesToFront(); > + > continue; // re-loop to try next msg > } > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From ahughes at redhat.com Thu Oct 21 14:55:02 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Thu, 21 Oct 2010 22:55:02 +0100 Subject: [icedtea-web] RFC: Patch to stabilize applet initialization In-Reply-To: <20101021214110.GH26975@redhat.com> References: <20101021213816.GF26975@redhat.com> <20101021214110.GH26975@redhat.com> Message-ID: <20101021215502.GE25601@rivendell.middle-earth.co.uk> On 17:41 Thu 21 Oct , Deepak Bhole wrote: > * Deepak Bhole [2010-10-21 17:38]: > > Hi, > > > > The attached patch envelopes fixes for two of Andrew's pending patches > > (fixing 100% CPU load and the frame pop-up issue). In addition to those, > > it fixes a lot of other initialization issues, particularly when > > initializing multiple applets and/or closing other tabs with applets > > which are being initialized. > > > > With this patch, I tested over 200 parallel applet inits, randomly > > closing tabs, and everything works correctly. > > > > One known issue is that if timed correctly, a frame can appear outside > > for a fraction of a second. It always goes away instantly though, and I > > will be posting a patch to fix that problem in the near future. > > > > Cheers, > > Deepak > > Please ignore the spacing issues. I will be normalizing all spaces for > all of icedtea-web in another commit after all pending patches are in. > Please use the same normalizer script used by Sun/Oracle and written by Kelly O'Hair. I've attached it for ease. I thought we had already done this once... > Cheers, > Deepak > > > diff -r 85db7b3a1c93 plugin/icedteanp/java/sun/applet/PluginAppletViewer.java > > --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Thu Oct 21 21:12:21 2010 +0100 > > +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Thu Oct 21 17:22:56 2010 -0700 > > @@ -136,12 +136,10 @@ > > } > > } > > }); > > + > > + // create the frame. > > + PluginAppletViewer.reFrame(null, identifier, System.out, 0, panel); > > > > - > > - > > - // create the frame. > > - PluginAppletViewer.reFrame(null, identifier, System.out, handle, panel); > > - > > panel.init(); > > > > // Start the applet > > @@ -179,15 +177,7 @@ > > > > // Wait for the panel to initialize > > // (happens in a separate thread) > > - while (panel.getApplet() == null && > > - ((NetxPanel) panel).isAlive()) { > > - try { > > - Thread.sleep(50); > > - PluginDebug.debug("Waiting for applet to initialize..."); > > - } catch (InterruptedException ie) { > > - // just wait > > - } > > - } > > + PluginAppletViewer.waitForAppletInit((NetxPanel) panel); > > > > a = panel.getApplet(); > > > > @@ -317,7 +307,17 @@ > > */ > > private static String defaultSaveFile = "Applet.ser"; > > > > - private static enum PAV_INIT_STATUS {PRE_INIT, IN_INIT, INIT_COMPLETE, INACTIVE}; > > + > > + /** > > + * Enumerates the current status of an applet > > + * > > + * PRE_INIT -> Parsing and initialization phase > > + * INIT_COMPLETE -> Initialization complete, reframe pending > > + * REFRAME_COMPLETE -> Reframe complete, applet is initialized and usable by the user > > + * INACTIVE -> Browser has directed that the applet be destroyed (this state is non-overridable except by DESTROYED) > > + * DESTROYED -> Applet has been destroyed > > + */ > > + private static enum PAV_INIT_STATUS {PRE_INIT, INIT_COMPLETE, REFRAME_COMPLETE, INACTIVE, DESTROYED}; > > > > /** > > * The panel in which the applet is being displayed. > > @@ -350,7 +350,6 @@ > > > > private static HashMap status = > > new HashMap(); > > - > > > > private long handle = 0; > > private WindowListener windowEventListener = null; > > @@ -380,16 +379,20 @@ > > return; > > > > PluginAppletViewer newFrame = new PluginAppletViewer(handle, identifier, statusMsgStream, panel); > > - > > + > > if (oldFrame != null) { > > applets.remove(oldFrame.identifier); > > oldFrame.removeWindowListener(oldFrame.windowEventListener); > > panel.removeAppletListener(oldFrame.appletEventListener); > > + > > + // Add first, remove later > > + newFrame.add("Center", panel); > > oldFrame.remove(panel); > > oldFrame.dispose(); > > + } else { > > + newFrame.add("Center", panel); > > } > > > > - newFrame.add("Center", panel); > > newFrame.pack(); > > > > newFrame.appletEventListener = new AppletEventListener(newFrame, newFrame); > > @@ -397,11 +400,6 @@ > > > > applets.put(identifier, newFrame); > > > > - // dispose oldframe if necessary > > - if (oldFrame != null) { > > - oldFrame.dispose(); > > - } > > - > > PluginDebug.debug(panel + " reframed"); > > } > > > > @@ -449,7 +447,7 @@ > > this.frame = frame; > > this.appletViewer = appletViewer; > > } > > - > > + > > public void appletStateChanged(AppletEvent evt) > > { > > AppletPanel src = (AppletPanel)evt.getSource(); > > @@ -483,9 +481,9 @@ > > AppletPanel.changeFrameAppContext(frame, SunToolkit.targetToAppContext(a)); > > else > > AppletPanel.changeFrameAppContext(frame, AppContext.getAppContext()); > > - > > - status.put(appletViewer.identifier, PAV_INIT_STATUS.INIT_COMPLETE); > > - > > + > > + updateStatus(appletViewer.identifier, PAV_INIT_STATUS.INIT_COMPLETE); > > + > > break; > > } > > } > > @@ -510,7 +508,13 @@ > > > > try { > > if (message.startsWith("handle")) { > > - > > + > > + // If there is a key for this status, it means it > > + // was either initialized before, or destroy has been > > + // processed. Stop moving further. > > + if (updateStatus(identifier, PAV_INIT_STATUS.PRE_INIT) != null) > > + return; > > + > > // Extract the information from the message > > String[] msgParts = new String[4]; > > for (int i=0; i < 3; i++) { > > @@ -519,32 +523,38 @@ > > msgParts[i] = message.substring(spaceLocation + 1, nextSpaceLocation); > > message = message.substring(nextSpaceLocation + 1); > > } > > - > > + > > long handle = Long.parseLong(msgParts[0]); > > String width = msgParts[1]; > > String height = msgParts[2]; > > - > > + > > int spaceLocation = message.indexOf(' ', "tag".length()+1); > > String documentBase = > > UrlUtil.decode(message.substring("tag".length() + 1, spaceLocation)); > > - String tag = message.substring(spaceLocation+1); > > + String tag = message.substring(spaceLocation+1); > > + > > + // Decode the tag > > + tag = tag.replace(">", ">"); > > + tag = tag.replace("<", "<"); > > + tag = tag.replace("&", "&"); > > + tag = tag.replace(" ", "\n"); > > + tag = tag.replace(" ", "\r"); > > + tag = tag.replace(""", "\""); > > > > PluginDebug.debug ("Handle = " + handle + "\n" + > > "Width = " + width + "\n" + > > "Height = " + height + "\n" + > > "DocumentBase = " + documentBase + "\n" + > > "Tag = " + tag); > > - > > - status.put(identifier, PAV_INIT_STATUS.PRE_INIT); > > + > > PluginAppletViewer.parse > > (identifier, handle, width, height, > > new StringReader(tag), > > new URL(documentBase)); > > - > > > > int maxWait = APPLET_TIMEOUT; // wait for applet to fully load > > int wait = 0; > > - while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && > > + while ( !applets.containsKey(identifier) && // Map is populated only by reFrame > > (wait < maxWait)) { > > > > try { > > @@ -555,9 +565,44 @@ > > } > > } > > > > - if (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE)) > > + // If wait exceeded maxWait, we timed out. Throw an exception > > + if (wait >= maxWait) > > throw new Exception("Applet initialization timeout"); > > > > + PluginAppletViewer oldFrame = applets.get(identifier); > > + > > + // We should not try to destroy an applet during > > + // initialization. It may cause an inconsistent state, > > + // which would bad if it's a trusted applet that > > + // read/writes to files > > + waitForAppletInit((NetxPanel) applets.get(identifier).panel); > > + > > + // Should we proceed with reframing? > > + if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { > > + destroyApplet(identifier); > > + return; > > + } > > + > > + // Proceed with re-framing > > + reFrame(oldFrame, identifier, System.out, handle, oldFrame.panel); > > + > > + // There is a slight chance that destroy can happen > > + // between the above and below line > > + if (updateStatus(identifier, PAV_INIT_STATUS.REFRAME_COMPLETE).equals(PAV_INIT_STATUS.INACTIVE)) { > > + destroyApplet(identifier); > > + } > > + > > + } else if (message.startsWith("destroy")) { > > + > > + // Set it inactive, and try to do cleanup is applicable > > + PAV_INIT_STATUS previousStatus = updateStatus(identifier, PAV_INIT_STATUS.INACTIVE); > > + PluginDebug.debug("Destroy status set for " + identifier); > > + > > + if (previousStatus != null && > > + previousStatus.equals(PAV_INIT_STATUS.REFRAME_COMPLETE)) { > > + destroyApplet(identifier); > > + } > > + > > } else { > > PluginDebug.debug ("Handling message: " + message + " instance " + identifier + " " + Thread.currentThread()); > > > > @@ -568,7 +613,7 @@ > > status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT) > > ) > > ); > > - > > + > > // don't bother processing further for inactive applets > > if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) > > return; > > @@ -580,31 +625,131 @@ > > e.printStackTrace(); > > > > // If an exception happened during pre-init, we need to update status > > - if (status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT)) > > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > > + updateStatus(identifier, PAV_INIT_STATUS.INACTIVE); > > > > throw new RuntimeException("Failed to handle message: " + > > message + " for instance " + identifier, e); > > } > > } > > - > > + > > + /** > > + * Sets the status unless an overriding status is set (e.g. if > > + * status is DESTROYED, it may not be overridden). > > + * > > + * @param identifier The identifier for which the status is to be set > > + * @param status The status to switch to > > + * @return The previous status > > + */ > > + private static synchronized PAV_INIT_STATUS updateStatus(int identifier, PAV_INIT_STATUS newStatus) { > > + > > + PAV_INIT_STATUS prev = status.get(identifier); > > + > > + // If the status is set > > + if (status.containsKey(identifier)) { > > + > > + // Nothing may override destroyed status > > + if (status.get(identifier).equals(PAV_INIT_STATUS.DESTROYED)) { > > + return prev; > > + } > > + > > + // If status is inactive, only DESTROYED may override it > > + if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { > > + if (!newStatus.equals(PAV_INIT_STATUS.DESTROYED)) { > > + return prev; > > + } > > + } > > + } > > + > > + // Else set to given status > > + status.put(identifier, newStatus); > > + > > + return prev; > > + } > > + > > + /** > > + * Destroys the given applet instance. > > + * > > + * This function may be called multiple times without problems. > > + * It does a synchronized check on the status and will only > > + * attempt to destroy the applet if not previously destroyed. > > + * > > + * @param identifier The instance which is to be destroyed > > + */ > > + > > + private static synchronized void destroyApplet(int identifier) { > > + > > + PluginDebug.debug("DestroyApplet called for " + identifier); > > + > > + PAV_INIT_STATUS prev = updateStatus(identifier, PAV_INIT_STATUS.DESTROYED); > > + > > + // If already destroyed, return > > + if (prev.equals(PAV_INIT_STATUS.DESTROYED)) { > > + PluginDebug.debug(identifier + " already destroyed. Returning."); > > + return; > > + } > > + > > + // If already disposed, return > > + if (applets.get(identifier).panel.applet == null) { > > + // Try to still dispose the panel itself -- no harm done with double dispose > > + applets.get(identifier).dispose(); > > + > > + PluginDebug.debug(identifier + " inactive. Returning."); > > + return; > > + } > > + > > + PluginDebug.debug("Attempting to destroy " + identifier); > > + > > + final int fIdentifier = identifier; > > + SwingUtilities.invokeLater(new Runnable() { > > + public void run() { > > + applets.get(fIdentifier).appletClose(); > > + } > > + }); > > + > > + PluginDebug.debug(identifier + " destroyed"); > > + } > > + > > + /** > > + * Function to block until applet initialization is complete > > + * > > + * @param identifier The instance to wait for > > + */ > > + public static void waitForAppletInit(NetxPanel panel) { > > + > > + int waitTime = 0; > > + > > + // Wait till initialization finishes > > + while (panel.getApplet() == null && > > + panel.isAlive() && > > + waitTime < APPLET_TIMEOUT) { > > + try { > > + if (waitTime%500 == 0) > > + PluginDebug.debug("Waiting for applet panel " + panel + " to initialize..."); > > + > > + Thread.sleep(waitTime += 50); > > + } catch (InterruptedException ie) { > > + // just wait > > + } > > + } > > + > > + PluginDebug.debug("Applet panel " + panel + " initialized"); > > + } > > + > > public void handleMessage(int reference, String message) > > { > > if (message.startsWith("width")) { > > > > // Wait for panel to come alive > > int maxWait = APPLET_TIMEOUT; // wait for panel to come alive > > - int wait = 0; > > + int wait = 0; > > while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && wait < maxWait) { > > - > > - try { > > - Thread.sleep(50); > > - wait += 50; > > - } catch (InterruptedException ie) { > > - // just wait > > - } > > - } > > - > > + try { > > + Thread.sleep(50); > > + wait += 50; > > + } catch (InterruptedException ie) { > > + // just wait > > + } > > + } > > > > // 0 => width, 1=> width_value, 2 => height, 3=> height_value > > String[] dimMsg = message.split(" "); > > @@ -636,7 +781,7 @@ > > > > panel.setSize(width, height); > > panel.validate(); > > - > > + > > panel.applet.resize(width, height); > > panel.applet.validate(); > > } > > @@ -649,9 +794,6 @@ > > e.printStackTrace(); > > } > > > > - } else if (message.startsWith("destroy")) { > > - dispose(); > > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > > } else if (message.startsWith("GetJavaObject")) { > > > > // FIXME: how do we determine what security context this > > @@ -672,15 +814,7 @@ > > > > // Wait for the panel to initialize > > // (happens in a separate thread) > > - while (panel.getApplet() == null && > > - ((NetxPanel) panel).isAlive()) { > > - try { > > - Thread.sleep(50); > > - PluginDebug.debug("Waiting for applet to initialize..."); > > - } catch (InterruptedException ie) { > > - // just wait > > - } > > - } > > + waitForAppletInit((NetxPanel) panel); > > > > PluginDebug.debug(panel + " -- " + panel.getApplet() + " -- " + ((NetxPanel) panel).isAlive()); > > > > @@ -1548,10 +1682,11 @@ > > if (countApplets() == 0) { > > appletSystemExit(); > > } > > + > > + updateStatus(identifier, PAV_INIT_STATUS.DESTROYED); > > } > > }).start(); > > > > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > > } > > > > /** > > @@ -1677,18 +1812,6 @@ > > val = buf.toString(); > > } > > > > - att = att.replace(">", ">"); > > - att = att.replace("<", "<"); > > - att = att.replace("&", "&"); > > - att = att.replace(" ", "\n"); > > - att = att.replace(" ", "\r"); > > - > > - val = val.replace(">", ">"); > > - val = val.replace("<", "<"); > > - val = val.replace("&", "&"); > > - val = val.replace(" ", "\n"); > > - val = val.replace(" ", "\r"); > > - > > PluginDebug.debug("PUT " + att + " = '" + val + "'"); > > atts.put(att.toLowerCase(java.util.Locale.ENGLISH), val); > > > > @@ -1708,7 +1831,6 @@ > > // private static final == inline > > private static final boolean isInt(Object o) { > > boolean isInt = false; > > - > > try { > > Integer.parseInt((String) o); > > isInt = true; > > @@ -1763,7 +1885,6 @@ > > } catch (IOException ioe) { > > return ioe; > > } > > - > > return null; > > } > > }; > > @@ -1785,6 +1906,7 @@ > > boolean isObjectTag = false; > > boolean isEmbedTag = false; > > boolean objectTagAlreadyParsed = false; > > + > > // The current character > > // FIXME: This is an evil hack to force pass-by-reference.. the > > // parsing code needs to be rewritten from scratch to prevent such > > @@ -1879,19 +2001,6 @@ > > if (val == null) { > > statusMsgStream.println(requiresNameWarning); > > } else if (atts != null) { > > - att = att.replace(">", ">"); > > - att = att.replace("<", "<"); > > - att = att.replace("&", "&"); > > - att = att.replace(" ", "\n"); > > - att = att.replace(" ", "\r"); > > - att = att.replace(""", "\""); > > - > > - val = val.replace(">", ">"); > > - val = val.replace("<", "<"); > > - val = val.replace("&", "&"); > > - val = val.replace(" ", "\n"); > > - val = val.replace(" ", "\r"); > > - val = val.replace(""", "\""); > > PluginDebug.debug("PUT " + att + " = " + val); > > atts.put(att.toLowerCase(), val); > > } else { > > @@ -1920,8 +2029,8 @@ > > > > if (atts.get("width") == null || !isInt(atts.get("width"))) { > > atts.put("width", width); > > - } > > - > > + } > > + > > if (atts.get("height") == null || !isInt(atts.get("height"))) { > > atts.put("height", height); > > } > > @@ -1974,7 +2083,7 @@ > > if (atts.get("width") == null || !isInt(atts.get("width"))) { > > atts.put("width", width); > > } > > - > > + > > if (atts.get("height") == null || !isInt(atts.get("height"))) { > > atts.put("height", height); > > } > > @@ -2023,10 +2132,11 @@ > > if (atts.get("width") == null || !isInt(atts.get("width"))) { > > atts.put("width", width); > > } > > - > > + > > if (atts.get("height") == null || !isInt(atts.get("height"))) { > > atts.put("height", height); > > } > > + > > } > > } > > } > > diff -r 85db7b3a1c93 plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java > > --- a/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java Thu Oct 21 21:12:21 2010 +0100 > > +++ b/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java Thu Oct 21 17:22:56 2010 -0700 > > @@ -126,6 +126,10 @@ > > } > > > > private String getPriorityStrIfPriority(String message) { > > + > > + // Destroy messages are permanently high priority > > + if (message.endsWith("destroy")) > > + return "destroy"; > > > > synchronized (priorityWaitQueue) { > > Iterator it = priorityWaitQueue.iterator(); > > @@ -150,7 +154,6 @@ > > } > > } > > > > - > > public void notifyWorkerIsFree(PluginMessageHandlerWorker worker) { > > synchronized (initWorkers) { > > Iterator i = initWorkers.keySet().iterator(); > > @@ -176,6 +179,32 @@ > > } > > > > protected class ConsumerThread extends Thread { > > + > > + /** > > + * Scans the readQueue for priority messages and brings them to the front > > + */ > > + private void bringPriorityMessagesToFront() { > > + synchronized (readQueue) { > > + > > + // iterate through the list > > + for (int i=0; i < readQueue.size(); i++) { > > + > > + // remove element at i to inspect it > > + String message = readQueue.remove(i); > > + > > + // if element at i is a priority msg, bring it forward > > + if (getPriorityStrIfPriority(message) != null) { > > + readQueue.addFirst(message); > > + } else { // else keep it where it was > > + readQueue.add(i, message); > > + } > > + > > + // by the end the queue size is the same, so the > > + // position indicator (i) is still valid > > + } > > + } > > + } > > + > > public void run() { > > > > while (true) { > > @@ -190,7 +219,6 @@ > > > > String[] msgParts = message.split(" "); > > > > - > > String priorityStr = getPriorityStrIfPriority(message); > > boolean isPriorityResponse = (priorityStr != null); > > > > @@ -199,9 +227,12 @@ > > > > if (worker == null) { > > synchronized(readQueue) { > > - readQueue.addLast(message); > > + readQueue.addFirst(message); > > } > > > > + // re-scan to see if any priority message came in > > + bringPriorityMessagesToFront(); > > + > > continue; // re-loop to try next msg > > } > > > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 -------------- next part -------------- A non-text attachment was scrubbed... Name: normalizer.pl Type: text/x-perl Size: 5365 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101021/c10e6ab9/normalizer.pl From mark at klomp.org Fri Oct 22 02:12:43 2010 From: mark at klomp.org (Mark Wielaard) Date: Fri, 22 Oct 2010 11:12:43 +0200 Subject: openjdk6-mips port added to icedtea server Message-ID: <1287738763.2755.50.camel@springer.wildebeest.org> Hi, LIU Qi asked if the openjdk6-mips port for Longsoon they have been hacking on could be hosted on the icedtea server so it could be shared with a wider audience. So it has been added: http://icedtea.classpath.org/hg/openjdk6-mips/ All new code has been contributed under the GPL by Lemote, Inc. Currently only the original mips port hackers can push new commits to it so they can decide how to evolve the code. Please discuss on the porters-dev mailinglist and with LIU Qi if you would like to contribute patches and/or have ideas for how the repository should be setup (it contains a full openjdk6 forest in a single repository atm). Any commits pushed to the repository should also send an email to the icedtea and porters-dev mailinglist (Dalibor might have to approve them first before they appear on the porters-dev list). The new hackers should also have gotten wiki accounts through email. Please login and add a page http://icedtea.classpath.org/wiki/MIPSPort to describe the current status of the port, how to build it and any hacking rules you want to follow for the repository. Thanks and Happy Hacking, Mark From asu at redhat.com Fri Oct 22 07:35:01 2010 From: asu at redhat.com (Andrew Su) Date: Fri, 22 Oct 2010 10:35:01 -0400 (EDT) Subject: [icedtea-web] RFC: Patch to stabilize applet initialization In-Reply-To: <1403420189.1470741287758089389.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <374199110.1470821287758101430.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> ----- "Deepak Bhole" wrote: > From: "Deepak Bhole" > To: "IcedTea Distro List" > Sent: Thursday, October 21, 2010 5:41:11 PM GMT -05:00 US/Canada Eastern > Subject: Re: [icedtea-web] RFC: Patch to stabilize applet initialization > > * Deepak Bhole [2010-10-21 17:38]: > > Hi, > > > > The attached patch envelopes fixes for two of Andrew's pending > patches > > (fixing 100% CPU load and the frame pop-up issue). In addition to > those, > > it fixes a lot of other initialization issues, particularly when > > initializing multiple applets and/or closing other tabs with > applets > > which are being initialized. > > > > With this patch, I tested over 200 parallel applet inits, randomly > > closing tabs, and everything works correctly. > > > > One known issue is that if timed correctly, a frame can appear > outside > > for a fraction of a second. It always goes away instantly though, > and I > > will be posting a patch to fix that problem in the near future. > > > > Cheers, > > Deepak > > Please ignore the spacing issues. I will be normalizing all spaces > for > all of icedtea-web in another commit after all pending patches are > in. > > Cheers, > Deepak > > > diff -r 85db7b3a1c93 > plugin/icedteanp/java/sun/applet/PluginAppletViewer.java > > --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Thu > Oct 21 21:12:21 2010 +0100 > > +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Thu > Oct 21 17:22:56 2010 -0700 > > @@ -136,12 +136,10 @@ > > } > > } > > }); > > + > > + // create the frame. > > + PluginAppletViewer.reFrame(null, identifier, System.out, > 0, panel); > > > > - > > - > > - // create the frame. > > - PluginAppletViewer.reFrame(null, identifier, System.out, > handle, panel); > > - > > panel.init(); > > > > // Start the applet > > @@ -179,15 +177,7 @@ > > > > // Wait for the panel to initialize > > // (happens in a separate thread) > > - while (panel.getApplet() == null && > > - ((NetxPanel) panel).isAlive()) { > > - try { > > - Thread.sleep(50); > > - PluginDebug.debug("Waiting for applet to > initialize..."); > > - } catch (InterruptedException ie) { > > - // just wait > > - } > > - } > > + PluginAppletViewer.waitForAppletInit((NetxPanel) panel); > > > > a = panel.getApplet(); > > > > @@ -317,7 +307,17 @@ > > */ > > private static String defaultSaveFile = "Applet.ser"; > > > > - private static enum PAV_INIT_STATUS {PRE_INIT, IN_INIT, > INIT_COMPLETE, INACTIVE}; > > + > > + /** > > + * Enumerates the current status of an applet > > + * > > + * PRE_INIT -> Parsing and initialization phase > > + * INIT_COMPLETE -> Initialization complete, reframe pending > > + * REFRAME_COMPLETE -> Reframe complete, applet is > initialized and usable by the user > > + * INACTIVE -> Browser has directed that the applet be > destroyed (this state is non-overridable except by DESTROYED) > > + * DESTROYED -> Applet has been destroyed > > + */ > > + private static enum PAV_INIT_STATUS {PRE_INIT, INIT_COMPLETE, > REFRAME_COMPLETE, INACTIVE, DESTROYED}; > > > > /** > > * The panel in which the applet is being displayed. > > @@ -350,7 +350,6 @@ > > > > private static HashMap status = > > new HashMap(); > > - > > > > private long handle = 0; > > private WindowListener windowEventListener = null; > > @@ -380,16 +379,20 @@ > > return; > > > > PluginAppletViewer newFrame = new > PluginAppletViewer(handle, identifier, statusMsgStream, panel); > > - > > + > > if (oldFrame != null) { > > applets.remove(oldFrame.identifier); > > > oldFrame.removeWindowListener(oldFrame.windowEventListener); > > > panel.removeAppletListener(oldFrame.appletEventListener); > > + > > + // Add first, remove later > > + newFrame.add("Center", panel); > > oldFrame.remove(panel); > > oldFrame.dispose(); > > + } else { > > + newFrame.add("Center", panel); > > } > > > > - newFrame.add("Center", panel); > > newFrame.pack(); > > > > newFrame.appletEventListener = new > AppletEventListener(newFrame, newFrame); > > @@ -397,11 +400,6 @@ > > > > applets.put(identifier, newFrame); > > > > - // dispose oldframe if necessary > > - if (oldFrame != null) { > > - oldFrame.dispose(); > > - } > > - > > PluginDebug.debug(panel + " reframed"); > > } > > > > @@ -449,7 +447,7 @@ > > this.frame = frame; > > this.appletViewer = appletViewer; > > } > > - > > + > > public void appletStateChanged(AppletEvent evt) > > { > > AppletPanel src = (AppletPanel)evt.getSource(); > > @@ -483,9 +481,9 @@ > > AppletPanel.changeFrameAppContext(frame, > SunToolkit.targetToAppContext(a)); > > else > > AppletPanel.changeFrameAppContext(frame, > AppContext.getAppContext()); > > - > > - status.put(appletViewer.identifier, > PAV_INIT_STATUS.INIT_COMPLETE); > > - > > + > > + updateStatus(appletViewer.identifier, > PAV_INIT_STATUS.INIT_COMPLETE); > > + > > break; > > } > > } > > @@ -510,7 +508,13 @@ > > > > try { > > if (message.startsWith("handle")) { > > - > > + > > + // If there is a key for this status, it means it > > + // was either initialized before, or destroy has been > > > + // processed. Stop moving further. > > + if (updateStatus(identifier, > PAV_INIT_STATUS.PRE_INIT) != null) > > + return; > > + > > // Extract the information from the message > > String[] msgParts = new String[4]; > > for (int i=0; i < 3; i++) { > > @@ -519,32 +523,38 @@ > > msgParts[i] = message.substring(spaceLocation + 1, > nextSpaceLocation); > > message = message.substring(nextSpaceLocation + 1); > > } > > - > > + > > long handle = Long.parseLong(msgParts[0]); > > String width = msgParts[1]; > > String height = msgParts[2]; > > - > > + > > int spaceLocation = message.indexOf(' ', > "tag".length()+1); > > String documentBase = > > > UrlUtil.decode(message.substring("tag".length() + 1, spaceLocation)); > > - String tag = message.substring(spaceLocation+1); > > + String tag = message.substring(spaceLocation+1); > > + > > + // Decode the tag > > + tag = tag.replace(">", ">"); > > + tag = tag.replace("<", "<"); > > + tag = tag.replace("&", "&"); > > + tag = tag.replace(" ", "\n"); > > + tag = tag.replace(" ", "\r"); > > + tag = tag.replace(""", "\""); > > > > PluginDebug.debug ("Handle = " + handle + "\n" + > > "Width = " + width + "\n" + > > "Height = " + height + "\n" + > > "DocumentBase = " + documentBase + > "\n" + > > "Tag = " + tag); > > - > > - status.put(identifier, > PAV_INIT_STATUS.PRE_INIT); > > + > > PluginAppletViewer.parse > > (identifier, handle, width, height, > > new StringReader(tag), > > new URL(documentBase)); > > - > > > > int maxWait = APPLET_TIMEOUT; // wait for applet > to fully load > > int wait = 0; > > - while > (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && > > + while ( !applets.containsKey(identifier) && // Map > is populated only by reFrame > > (wait < maxWait)) { > > > > try { > > @@ -555,9 +565,44 @@ > > } > > } > > > > - if > (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE)) > > + // If wait exceeded maxWait, we timed out. Throw > an exception > > + if (wait >= maxWait) > > throw new Exception("Applet initialization > timeout"); > > > > + PluginAppletViewer oldFrame = > applets.get(identifier); > > + > > + // We should not try to destroy an applet during > > + // initialization. It may cause an inconsistent > state, > > + // which would bad if it's a trusted applet that > > + // read/writes to files > > + waitForAppletInit((NetxPanel) > applets.get(identifier).panel); > > + > > + // Should we proceed with reframing? > > + if > (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { > > + destroyApplet(identifier); > > + return; > > + } > > + > > + // Proceed with re-framing > > + reFrame(oldFrame, identifier, System.out, handle, > oldFrame.panel); > > + > > + // There is a slight chance that destroy can > happen > > + // between the above and below line > > + if (updateStatus(identifier, > PAV_INIT_STATUS.REFRAME_COMPLETE).equals(PAV_INIT_STATUS.INACTIVE)) { > > + destroyApplet(identifier); > > + } > > + > > + } else if (message.startsWith("destroy")) { > > + > > + // Set it inactive, and try to do cleanup is > applicable > > + PAV_INIT_STATUS previousStatus = > updateStatus(identifier, PAV_INIT_STATUS.INACTIVE); > > + PluginDebug.debug("Destroy status set for " + > identifier); > > + > > + if (previousStatus != null && > > + > previousStatus.equals(PAV_INIT_STATUS.REFRAME_COMPLETE)) { > > + destroyApplet(identifier); > > + } > > + > > } else { > > PluginDebug.debug ("Handling message: " + message > + " instance " + identifier + " " + Thread.currentThread()); > > > > @@ -568,7 +613,7 @@ > > > status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT) > > ) > > ); > > - > > + > > // don't bother processing further for inactive > applets > > if > (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) > > return; > > @@ -580,31 +625,131 @@ > > e.printStackTrace(); > > > > // If an exception happened during pre-init, we need > to update status > > - if > (status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT)) > > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > > + updateStatus(identifier, PAV_INIT_STATUS.INACTIVE); > > > > throw new RuntimeException("Failed to handle message: > " + > > message + " for instance " + identifier, e); > > } > > } > > - > > + > > + /** > > + * Sets the status unless an overriding status is set (e.g. if > > > + * status is DESTROYED, it may not be overridden). > > + * > > + * @param identifier The identifier for which the status is to > be set > > + * @param status The status to switch to > > + * @return The previous status > > + */ > > + private static synchronized PAV_INIT_STATUS updateStatus(int > identifier, PAV_INIT_STATUS newStatus) { > > + > > + PAV_INIT_STATUS prev = status.get(identifier); > > + > > + // If the status is set > > + if (status.containsKey(identifier)) { > > + > > + // Nothing may override destroyed status > > + if > (status.get(identifier).equals(PAV_INIT_STATUS.DESTROYED)) { > > + return prev; > > + } > > + > > + // If status is inactive, only DESTROYED may override it > > + if > (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { > > + if (!newStatus.equals(PAV_INIT_STATUS.DESTROYED)) { > > + return prev; Status isn't updated to PAV_INIT_STATUS.DESTROYED. > > + } > > + } > > + } > > + > > + // Else set to given status > > + status.put(identifier, newStatus); > > + > > + return prev; > > + } > > + > > + /** > > + * Destroys the given applet instance. > > + * > > + * This function may be called multiple times without > problems. > > + * It does a synchronized check on the status and will only > > + * attempt to destroy the applet if not previously destroyed. > > + * > > + * @param identifier The instance which is to be destroyed > > + */ > > + > > + private static synchronized void destroyApplet(int identifier) > { > > + > > + PluginDebug.debug("DestroyApplet called for " + identifier); > > + > > + PAV_INIT_STATUS prev = updateStatus(identifier, > PAV_INIT_STATUS.DESTROYED); > > + > > + // If already destroyed, return > > + if (prev.equals(PAV_INIT_STATUS.DESTROYED)) { > > + PluginDebug.debug(identifier + " already destroyed. > Returning."); > > + return; > > + } > > + > > + // If already disposed, return > > + if (applets.get(identifier).panel.applet == null) { > > + // Try to still dispose the panel itself -- no harm done > with double dispose > > + applets.get(identifier).dispose(); > > + > > + PluginDebug.debug(identifier + " inactive. Returning."); > > + return; > > + } > > + > > + PluginDebug.debug("Attempting to destroy " + identifier); > > + > > + final int fIdentifier = identifier; > > + SwingUtilities.invokeLater(new Runnable() { > > + public void run() { > > + applets.get(fIdentifier).appletClose(); > > + } > > + }); > > + > > + PluginDebug.debug(identifier + " destroyed"); > > + } > > + > > + /** > > + * Function to block until applet initialization is complete > > + * > > + * @param identifier The instance to wait for > > + */ > > + public static void waitForAppletInit(NetxPanel panel) { > > + > > + int waitTime = 0; > > + > > + // Wait till initialization finishes > > + while (panel.getApplet() == null && > > + panel.isAlive() && > > + waitTime < APPLET_TIMEOUT) { > > + try { > > + if (waitTime%500 == 0) > > + PluginDebug.debug("Waiting for applet panel " + > panel + " to initialize..."); > > + > > + Thread.sleep(waitTime += 50); > > + } catch (InterruptedException ie) { > > + // just wait > > + } > > + } > > + > > + PluginDebug.debug("Applet panel " + panel + " > initialized"); > > + } > > + > > public void handleMessage(int reference, String message) > > { > > if (message.startsWith("width")) { > > > > // Wait for panel to come alive > > int maxWait = APPLET_TIMEOUT; // wait for panel to > come alive > > - int wait = 0; > > + int wait = 0; > > while > (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && wait > < maxWait) { > > - > > - try { > > - Thread.sleep(50); > > - wait += 50; > > - } catch (InterruptedException ie) { > > - // just wait > > - } > > - } > > - > > + try { > > + Thread.sleep(50); > > + wait += 50; > > + } catch (InterruptedException ie) { > > + // just wait > > + } > > + } > > > > // 0 => width, 1=> width_value, 2 => height, 3=> > height_value > > String[] dimMsg = message.split(" "); > > @@ -636,7 +781,7 @@ > > > > panel.setSize(width, height); > > panel.validate(); > > - > > + > > panel.applet.resize(width, height); > > panel.applet.validate(); > > } > > @@ -649,9 +794,6 @@ > > e.printStackTrace(); > > } > > > > - } else if (message.startsWith("destroy")) { > > - dispose(); > > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > > } else if (message.startsWith("GetJavaObject")) { > > > > // FIXME: how do we determine what security context > this > > @@ -672,15 +814,7 @@ > > > > // Wait for the panel to initialize > > // (happens in a separate thread) > > - while (panel.getApplet() == null && > > - ((NetxPanel) panel).isAlive()) { > > - try { > > - Thread.sleep(50); > > - PluginDebug.debug("Waiting for applet to > initialize..."); > > - } catch (InterruptedException ie) { > > - // just wait > > - } > > - } > > + waitForAppletInit((NetxPanel) panel); > > > > PluginDebug.debug(panel + " -- " + panel.getApplet() + > " -- " + ((NetxPanel) panel).isAlive()); > > > > @@ -1548,10 +1682,11 @@ > > if (countApplets() == 0) { > > appletSystemExit(); > > } > > + > > + updateStatus(identifier, > PAV_INIT_STATUS.DESTROYED); > > } > > }).start(); > > > > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > > } > > > > /** > > @@ -1677,18 +1812,6 @@ > > val = buf.toString(); > > } > > > > - att = att.replace(">", ">"); > > - att = att.replace("<", "<"); > > - att = att.replace("&", "&"); > > - att = att.replace(" ", "\n"); > > - att = att.replace(" ", "\r"); > > - > > - val = val.replace(">", ">"); > > - val = val.replace("<", "<"); > > - val = val.replace("&", "&"); > > - val = val.replace(" ", "\n"); > > - val = val.replace(" ", "\r"); > > - > > PluginDebug.debug("PUT " + att + " = '" + val + "'"); > > atts.put(att.toLowerCase(java.util.Locale.ENGLISH), val); > > > > @@ -1708,7 +1831,6 @@ > > // private static final == inline > > private static final boolean isInt(Object o) { > > boolean isInt = false; > > - > > try { > > Integer.parseInt((String) o); > > isInt = true; > > @@ -1763,7 +1885,6 @@ > > } catch (IOException ioe) { > > return ioe; > > } > > - > > return null; > > } > > }; > > @@ -1785,6 +1906,7 @@ > > boolean isObjectTag = false; > > boolean isEmbedTag = false; > > boolean objectTagAlreadyParsed = false; > > + > > // The current character > > // FIXME: This is an evil hack to force > pass-by-reference.. the > > // parsing code needs to be rewritten from scratch to > prevent such > > @@ -1879,19 +2001,6 @@ > > if (val == null) { > > > statusMsgStream.println(requiresNameWarning); > > } else if (atts != null) { > > - att = att.replace(">", ">"); > > - att = att.replace("<", "<"); > > - att = att.replace("&", "&"); > > - att = att.replace(" ", "\n"); > > - att = att.replace(" ", "\r"); > > - att = att.replace(""", > "\""); > > - > > - val = val.replace(">", ">"); > > - val = val.replace("<", "<"); > > - val = val.replace("&", "&"); > > - val = val.replace(" ", "\n"); > > - val = val.replace(" ", "\r"); > > - val = val.replace(""", > "\""); > > PluginDebug.debug("PUT " + att + " > = " + val); > > atts.put(att.toLowerCase(), val); > > } else { > > @@ -1920,8 +2029,8 @@ > > > > if (atts.get("width") == null || > !isInt(atts.get("width"))) { > > atts.put("width", width); > > - } > > - > > + } > > + > > if (atts.get("height") == null || > !isInt(atts.get("height"))) { > > atts.put("height", height); > > } > > @@ -1974,7 +2083,7 @@ > > if (atts.get("width") == null || > !isInt(atts.get("width"))) { > > atts.put("width", width); > > } > > - > > + > > if (atts.get("height") == null || > !isInt(atts.get("height"))) { > > atts.put("height", height); > > } > > @@ -2023,10 +2132,11 @@ > > if (atts.get("width") == null || > !isInt(atts.get("width"))) { > > atts.put("width", width); > > } > > - > > + > > if (atts.get("height") == null || > !isInt(atts.get("height"))) { > > atts.put("height", height); > > } > > + > > } > > } > > } > > diff -r 85db7b3a1c93 > plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java > > --- a/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java > Thu Oct 21 21:12:21 2010 +0100 > > +++ b/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java > Thu Oct 21 17:22:56 2010 -0700 > > @@ -126,6 +126,10 @@ > > } > > > > private String getPriorityStrIfPriority(String message) { > > + > > + // Destroy messages are permanently high priority > > + if (message.endsWith("destroy")) > > + return "destroy"; > > > > synchronized (priorityWaitQueue) { > > Iterator it = priorityWaitQueue.iterator(); > > @@ -150,7 +154,6 @@ > > } > > } > > > > - > > public void notifyWorkerIsFree(PluginMessageHandlerWorker worker) > { > > synchronized (initWorkers) { > > Iterator i = initWorkers.keySet().iterator(); > > @@ -176,6 +179,32 @@ > > } > > > > protected class ConsumerThread extends Thread { > > + > > + /** > > + * Scans the readQueue for priority messages and brings them to > the front > > + */ > > + private void bringPriorityMessagesToFront() { > > + synchronized (readQueue) { > > + > > + // iterate through the list > > + for (int i=0; i < readQueue.size(); i++) { > > + > > + // remove element at i to inspect it > > + String message = readQueue.remove(i); > > + > > + // if element at i is a priority msg, bring it forward > > + if (getPriorityStrIfPriority(message) != null) { > > + readQueue.addFirst(message); > > + } else { // else keep it where it was > > + readQueue.add(i, message); > > + } > > + > > + // by the end the queue size is the same, so the > > + // position indicator (i) is still valid > > + } > > + } > > + } I believe that splitting it to atleast two queue, one for priority and one for all other messages would be a bit better performance wise. Since: -- getPriorityStrIfPriority(): assume constant -- Adding to proper queue: constant -- Checking if queue is empty: constant -- Reading and deleting message: constant. Right now, doing N checks for each time we try to read a message would be a bit more expensive. Splitting it up could potentially save us one extra call to getPriorityStrIfPriority() for each message. Using an extra queue, let's call it PQ, we can store the priorityStr into PQ if we determined it is a priority message, this way we don't need to call getPriorityStrIfPriority() on each message again later. > > + > > public void run() { > > > > while (true) { > > @@ -190,7 +219,6 @@ > > > > String[] msgParts = message.split(" "); > > > > - > > String priorityStr = > getPriorityStrIfPriority(message); > > boolean isPriorityResponse = (priorityStr != > null); > > > > @@ -199,9 +227,12 @@ > > > > if (worker == null) { > > synchronized(readQueue) { > > - readQueue.addLast(message); > > + readQueue.addFirst(message); > > } > > > > + // re-scan to see if any priority message came > in > > + bringPriorityMessagesToFront(); > > + > > continue; // re-loop to try next msg > > } > > Just the one change to updateStatus. The extra queue idea gives a minor boost for performance. (This change is optional, and can go in later if needed) Everything else looks fine. Okay to commit after the change. Cheers, Andrew From omajid at icedtea.classpath.org Fri Oct 22 07:44:19 2010 From: omajid at icedtea.classpath.org (omajid at icedtea.classpath.org) Date: Fri, 22 Oct 2010 14:44:19 +0000 Subject: /hg/icedtea-web: show security dialogs using the main AppContext Message-ID: changeset eb998ed0ab1a in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=eb998ed0ab1a author: Omair Majid date: Fri Oct 22 10:44:12 2010 -0400 show security dialogs using the main AppContext 2010-10-22 Omair Majid * netx/net/sourceforge/jnlp/NetxPanel.java (runLoader): Do not initialize JNLPRuntime here. (createAppletThreads): Initialize JNLPRuntim here. * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: Switch from SecurityWarningDialog.AccessType to SecurityWarning.AccessType. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (getInstance(JNLPFile,UpdatePolicy)): Switch to SecurityWarning. (initializeResources): Likewise. (checkTrustWithUser): Likewise. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Add securityDialogMesasgeHandler. (initialize): Set System look and feel. Start security thread. (startSecurityThread): New method. Starts a thread to show security dialogs. (getSecurityDialogHandler): Returns the securityDialogMessageHandler. * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: Switch from SecurityWarningDialog.AccessType to SecurityWarning.AccessType. (checkAwtEventQueueAccess): New method. Skeleton code for allowing EventQueue acccess to applets. * netx/net/sourceforge/jnlp/security/AccessWarningPane.java: Switch from SecurityWarningDialog.AccessType to SecurityWarning.AccessType. * netx/net/sourceforge/jnlp/security/CertWarningPane.java: Likewise. * netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java: Move DialogType and AccessType to SecurityWarning. (SecurityWarningDialog(DialogType,AccessType,JNLPFile,CertVerifier, X509Certificate,Object[])): New method. The catch-all construction. (SecurityWarningDialog(DialogType,AccessType,JNLPFile): Delegate to the new constructor. (SecurityWarningDialog(DialogType,AccessTyp e,JNLPFile,CertVerifier)): Likewise. (SecurityWarningDialog(DialogType,AccessType,CertVerifier)): Likewise. (SecurityWarningDialog(DialogType,AccessType,JNLPFile,Object[])): Likewise. (SecurityWarningDialog(DialogType,X509Certificate)): Likewise. (showAccessWarningDialog(AccessType,JNLPFile)): Move to SecurityWarning class. (showAccessWarningDialog(AccessType,JNLPFile,Object[])): Likewise. (showNotAllSignedWarningDialog(JNLPFile)): Likewise. (showCertWarningDialog(AccessType,JNLPFile,CertVerifier)): Likewise. (showAppletWarning): Likewise. (initDialog): Make dialog non modal and remove window closing listener. (getValue): Make public. (dispose): New method. Notify listeners. (notifySelectionMade): New method. Notify listeners that user has made a decision. (addActionListener): New method. Add a listener to be notified when user makes a decision about this security warning. * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java: Switch from SecurityWarningDialog.AccessType to SecurityWarning.AccessType. * netx/net/sourceforge/jnlp/services/ServiceUtil.java: Likewise. * netx/net/sourceforge/jnlp/services/XClipboardService.java: Likewise. * netx/net/sourceforge/jnlp/services/XExtendedService.java: Likewise. * netx/net/sourceforge/jnlp/services/XFileOpenService.java: Likewise. * netx/net/sourceforge/jnlp/services/XFileSaveService.java: Likewise. * netx/net/sourceforge/jnlp/security/SecurityDialogMessage.java: New class. * netx/net/sourceforge/jnlp/security/SecurityDialogMessageHandler.java : New class. (run): New method. Runs the security message loop. (handleMessage): New method. Handles a SecurityDialogMessage to show a security warning. (postMessage): New method. Posts a message to sthe security message queue. * netx/net/sourceforge/jnlp/security/SecurityWarning.java: New class. Move AccessType and DialogType from SecurityWarningDialog to here. (showAccessWarningDialog): Moved from SecurityWarningDialog to here. (showAccessWarningDialog): Moved from SecurityWarningDialog to here. Modified to post messages to the security queue instead of showing a SecurityWarningDialog directly. (showNotAllSignedWarningDialog): Likewise. (showCertWarningDialog): Likewise. (showAppletWarning): Likewise. (getUserReponse): New method. Posts a message to the security thread and blocks until it gets a response from the user. diffstat: 18 files changed, 778 insertions(+), 246 deletions(-) ChangeLog | 82 ++ netx/net/sourceforge/jnlp/NetxPanel.java | 27 netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java | 2 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | 19 netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java | 45 + netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java | 33 + netx/net/sourceforge/jnlp/security/AccessWarningPane.java | 3 netx/net/sourceforge/jnlp/security/CertWarningPane.java | 3 netx/net/sourceforge/jnlp/security/SecurityDialogMessage.java | 44 + netx/net/sourceforge/jnlp/security/SecurityDialogMessageHandler.java | 141 ++++ netx/net/sourceforge/jnlp/security/SecurityWarning.java | 298 ++++++++++ netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java | 284 ++------- netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java | 6 netx/net/sourceforge/jnlp/services/ServiceUtil.java | 13 netx/net/sourceforge/jnlp/services/XClipboardService.java | 6 netx/net/sourceforge/jnlp/services/XExtendedService.java | 5 netx/net/sourceforge/jnlp/services/XFileOpenService.java | 6 netx/net/sourceforge/jnlp/services/XFileSaveService.java | 7 diffs (truncated from 1446 to 500 lines): diff -r 85db7b3a1c93 -r eb998ed0ab1a ChangeLog --- a/ChangeLog Thu Oct 21 21:12:21 2010 +0100 +++ b/ChangeLog Fri Oct 22 10:44:12 2010 -0400 @@ -1,3 +1,85 @@ 2010-10-20 Andrew John Hughes + + * netx/net/sourceforge/jnlp/NetxPanel.java + (runLoader): Do not initialize JNLPRuntime here. + (createAppletThreads): Initialize JNLPRuntim here. + * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: + Switch from SecurityWarningDialog.AccessType to + SecurityWarning.AccessType. + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java + (getInstance(JNLPFile,UpdatePolicy)): Switch to SecurityWarning. + (initializeResources): Likewise. + (checkTrustWithUser): Likewise. + * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: + Add securityDialogMesasgeHandler. + (initialize): Set System look and feel. Start security thread. + (startSecurityThread): New method. Starts a thread to show security + dialogs. + (getSecurityDialogHandler): Returns the securityDialogMessageHandler. + * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: + Switch from SecurityWarningDialog.AccessType to + SecurityWarning.AccessType. + (checkAwtEventQueueAccess): New method. Skeleton code for allowing + EventQueue acccess to applets. + * netx/net/sourceforge/jnlp/security/AccessWarningPane.java: + Switch from SecurityWarningDialog.AccessType to + SecurityWarning.AccessType. + * netx/net/sourceforge/jnlp/security/CertWarningPane.java: + Likewise. + * netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java: + Move DialogType and AccessType to SecurityWarning. + (SecurityWarningDialog(DialogType,AccessType,JNLPFile,CertVerifier, + X509Certificate,Object[])): New method. The catch-all construction. + (SecurityWarningDialog(DialogType,AccessType,JNLPFile): Delegate to + the new constructor. + (SecurityWarningDialog(DialogType,AccessType,JNLPFile,CertVerifier)): + Likewise. + (SecurityWarningDialog(DialogType,AccessType,CertVerifier)): Likewise. + (SecurityWarningDialog(DialogType,AccessType,JNLPFile,Object[])): + Likewise. + (SecurityWarningDialog(DialogType,X509Certificate)): Likewise. + (showAccessWarningDialog(AccessType,JNLPFile)): Move to SecurityWarning + class. + (showAccessWarningDialog(AccessType,JNLPFile,Object[])): Likewise. + (showNotAllSignedWarningDialog(JNLPFile)): Likewise. + (showCertWarningDialog(AccessType,JNLPFile,CertVerifier)): Likewise. + (showAppletWarning): Likewise. + (initDialog): Make dialog non modal and remove window closing listener. + (getValue): Make public. + (dispose): New method. Notify listeners. + (notifySelectionMade): New method. Notify listeners that user has made + a decision. + (addActionListener): New method. Add a listener to be notified when + user makes a decision about this security warning. + * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java: + Switch from SecurityWarningDialog.AccessType to + SecurityWarning.AccessType. + * netx/net/sourceforge/jnlp/services/ServiceUtil.java: Likewise. + * netx/net/sourceforge/jnlp/services/XClipboardService.java: Likewise. + * netx/net/sourceforge/jnlp/services/XExtendedService.java: Likewise. + * netx/net/sourceforge/jnlp/services/XFileOpenService.java: Likewise. + * netx/net/sourceforge/jnlp/services/XFileSaveService.java: Likewise. + * netx/net/sourceforge/jnlp/security/SecurityDialogMessage.java: + New class. + * netx/net/sourceforge/jnlp/security/SecurityDialogMessageHandler.java: + New class. + (run): New method. Runs the security message loop. + (handleMessage): New method. Handles a SecurityDialogMessage to show a + security warning. + (postMessage): New method. Posts a message to sthe security message + queue. + * netx/net/sourceforge/jnlp/security/SecurityWarning.java: New class. + Move AccessType and DialogType from SecurityWarningDialog to here. + (showAccessWarningDialog): Moved from SecurityWarningDialog to here. + (showAccessWarningDialog): Moved from SecurityWarningDialog to here. + Modified to post messages to the security queue instead of showing a + SecurityWarningDialog directly. + (showNotAllSignedWarningDialog): Likewise. + (showCertWarningDialog): Likewise. + (showAppletWarning): Likewise. + (getUserReponse): New method. Posts a message to the security thread and + blocks until it gets a response from the user. + 2010-10-20 Andrew John Hughes * netx/javax/jnlp/ServiceManager.java: diff -r 85db7b3a1c93 -r eb998ed0ab1a netx/net/sourceforge/jnlp/NetxPanel.java --- a/netx/net/sourceforge/jnlp/NetxPanel.java Thu Oct 21 21:12:21 2010 +0100 +++ b/netx/net/sourceforge/jnlp/NetxPanel.java Fri Oct 22 10:44:12 2010 -0400 @@ -84,19 +84,6 @@ public class NetxPanel extends AppletVie getHeight(), atts); - synchronized(JNLPRuntime.initMutex) { - //The custom NetX Policy and SecurityManager are set here. - if (!JNLPRuntime.isInitialized()) { - if (JNLPRuntime.isDebug()) - System.out.println("initializing JNLPRuntime..."); - - JNLPRuntime.initialize(false); - } else { - if (JNLPRuntime.isDebug()) - System.out.println("JNLPRuntime already initialized"); - } - } - doInit = true; dispatchAppletEvent(APPLET_LOADING, null); status = APPLET_LOAD; @@ -146,6 +133,20 @@ public class NetxPanel extends AppletVie */ // Reminder: Relax visibility in sun.applet.AppletPanel protected synchronized void createAppletThread() { + // initialize JNLPRuntime in the main threadgroup + synchronized(JNLPRuntime.initMutex) { + //The custom NetX Policy and SecurityManager are set here. + if (!JNLPRuntime.isInitialized()) { + if (JNLPRuntime.isDebug()) + System.out.println("initializing JNLPRuntime..."); + + JNLPRuntime.initialize(false); + } else { + if (JNLPRuntime.isDebug()) + System.out.println("JNLPRuntime already initialized"); + } + } + // when this was being done (incorrectly) in Launcher, the call was // new AppThreadGroup(mainGroup, file.getTitle()); ThreadGroup tg = new AppThreadGroup(Launcher.mainGroup, diff -r 85db7b3a1c93 -r eb998ed0ab1a netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java --- a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Thu Oct 21 21:12:21 2010 +0100 +++ b/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Fri Oct 22 10:44:12 2010 -0400 @@ -35,7 +35,7 @@ import net.sourceforge.jnlp.ShortcutDesc import net.sourceforge.jnlp.ShortcutDesc; import net.sourceforge.jnlp.event.ApplicationEvent; import net.sourceforge.jnlp.event.ApplicationListener; -import net.sourceforge.jnlp.security.SecurityWarningDialog.AccessType; +import net.sourceforge.jnlp.security.SecurityWarning.AccessType; import net.sourceforge.jnlp.services.ServiceUtil; import net.sourceforge.jnlp.util.WeakList; import net.sourceforge.jnlp.util.XDesktopEntry; diff -r 85db7b3a1c93 -r eb998ed0ab1a netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Thu Oct 21 21:12:21 2010 +0100 +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Fri Oct 22 10:44:12 2010 -0400 @@ -57,7 +57,8 @@ import net.sourceforge.jnlp.cache.CacheU import net.sourceforge.jnlp.cache.CacheUtil; import net.sourceforge.jnlp.cache.ResourceTracker; import net.sourceforge.jnlp.cache.UpdatePolicy; -import net.sourceforge.jnlp.security.SecurityWarningDialog; +import net.sourceforge.jnlp.security.SecurityWarning; +import net.sourceforge.jnlp.security.SecurityWarning.AccessType; import net.sourceforge.jnlp.tools.JarSigner; import net.sourceforge.jnlp.util.FileUtils; import sun.misc.JarIndex; @@ -292,7 +293,7 @@ public class JNLPClassLoader extends URL if (extLoader != null && extLoader != loader) { if (loader.signing && !extLoader.signing) - if (!SecurityWarningDialog.showNotAllSignedWarningDialog(file)) + if (!SecurityWarning.showNotAllSignedWarningDialog(file)) throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LSignedAppJarUsingUnsignedJar"), R("LSignedAppJarUsingUnsignedJarInfo")); loader.merge(extLoader); @@ -439,7 +440,7 @@ public class JNLPClassLoader extends URL signing = true; if (!js.allJarsSigned() && - !SecurityWarningDialog.showNotAllSignedWarningDialog(file)) + !SecurityWarning.showNotAllSignedWarningDialog(file)) throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LSignedAppJarUsingUnsignedJar"), R("LSignedAppJarUsingUnsignedJarInfo")); @@ -493,19 +494,19 @@ public class JNLPClassLoader extends URL private void checkTrustWithUser(JarSigner js) throws LaunchException { if (!js.getRootInCacerts()) { //root cert is not in cacerts - boolean b = SecurityWarningDialog.showCertWarningDialog( - SecurityWarningDialog.AccessType.UNVERIFIED, file, js); + boolean b = SecurityWarning.showCertWarningDialog( + AccessType.UNVERIFIED, file, js); if (!b) throw new LaunchException(null, null, R("LSFatal"), R("LCLaunching"), R("LNotVerified"), ""); } else if (js.getRootInCacerts()) { //root cert is in cacerts boolean b = false; if (js.noSigningIssues()) - b = SecurityWarningDialog.showCertWarningDialog( - SecurityWarningDialog.AccessType.VERIFIED, file, js); + b = SecurityWarning.showCertWarningDialog( + AccessType.VERIFIED, file, js); else if (!js.noSigningIssues()) - b = SecurityWarningDialog.showCertWarningDialog( - SecurityWarningDialog.AccessType.SIGNING_ERROR, file, js); + b = SecurityWarning.showCertWarningDialog( + AccessType.SIGNING_ERROR, file, js); if (!b) throw new LaunchException(null, null, R("LSFatal"), R("LCLaunching"), R("LCancelOnUserRequest"), ""); diff -r 85db7b3a1c93 -r eb998ed0ab1a netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Thu Oct 21 21:12:21 2010 +0100 +++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Fri Oct 22 10:44:12 2010 -0400 @@ -25,9 +25,11 @@ import java.util.List; import java.util.List; import java.security.*; import javax.jnlp.*; +import javax.swing.UIManager; import net.sourceforge.jnlp.*; import net.sourceforge.jnlp.cache.*; +import net.sourceforge.jnlp.security.SecurityDialogMessageHandler; import net.sourceforge.jnlp.services.*; import net.sourceforge.jnlp.util.*; @@ -62,6 +64,9 @@ public class JNLPRuntime { /** the security policy */ private static JNLPPolicy policy; + + /** handles all security message to show appropriate security dialogs */ + private static SecurityDialogMessageHandler securityDialogMessageHandler; /** the base dir for cache, etc */ private static File baseDir; @@ -165,6 +170,8 @@ public class JNLPRuntime { * security manager and security policy, initializing the JNLP * standard services, etc.

    * + * This method should be called from the main AppContext/Thread.

    + * * This method cannot be called more than once. Once * initialized, methods that alter the runtime can only be * called by the exit class.

    @@ -206,12 +213,37 @@ public class JNLPRuntime { policy = new JNLPPolicy(); security = new JNLPSecurityManager(); // side effect: create JWindow + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (Exception e) { + // ignore it + } + if (securityEnabled) { Policy.setPolicy(policy); // do first b/c our SM blocks setPolicy System.setSecurityManager(security); } + securityDialogMessageHandler = startSecurityThreads(); + initialized = true; + } + + /** + * This must NOT be called form the application ThreadGroup. An application + * can inject events into its {@link EventQueue} and bypass the security + * dialogs. + * + * @return a {@link SecurityDialogMessageHandler} that can be used to post + * security messages + */ + private static SecurityDialogMessageHandler startSecurityThreads() { + ThreadGroup securityThreadGroup = new ThreadGroup("NetxSecurityThreadGroup"); + SecurityDialogMessageHandler runner = new SecurityDialogMessageHandler(); + Thread securityThread = new Thread(securityThreadGroup, runner, "NetxSecurityThread"); + securityThread.setDaemon(true); + securityThread.start(); + return runner; } /** @@ -318,6 +350,19 @@ public class JNLPRuntime { public static void setSecurityEnabled(boolean enabled) { checkInitialized(); securityEnabled = enabled; + } + + /** + * + * @return the {@link SecurityDialogMessageHandler} that should be used to + * post security dialog messages + */ + public static SecurityDialogMessageHandler getSecurityDialogHandler() { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(new AllPermission()); + } + return securityDialogMessageHandler; } /** diff -r 85db7b3a1c93 -r eb998ed0ab1a netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java Thu Oct 21 21:12:21 2010 +0100 +++ b/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java Fri Oct 22 10:44:12 2010 -0400 @@ -34,7 +34,7 @@ import javax.swing.JWindow; import javax.swing.JWindow; import net.sourceforge.jnlp.JNLPFile; -import net.sourceforge.jnlp.security.SecurityWarningDialog; +import net.sourceforge.jnlp.security.SecurityWarning.AccessType; import net.sourceforge.jnlp.services.ServiceUtil; import net.sourceforge.jnlp.util.WeakList; import sun.awt.AWTSecurityManager; @@ -393,7 +393,7 @@ class JNLPSecurityManager extends AWTSec ApplicationInstance app = getApplication(); if (app != null && !app.isSigned()) { if (perm instanceof SocketPermission - && ServiceUtil.checkAccess(SecurityWarningDialog.AccessType.NETWORK, perm.getName())) { + && ServiceUtil.checkAccess(AccessType.NETWORK, perm.getName())) { return true; } } @@ -435,7 +435,7 @@ class JNLPSecurityManager extends AWTSec Window w = (Window) window; if (JNLPRuntime.isDebug()) - System.err.println("SM: app: "+app.getTitle()+" is adding a window: "+window); + System.err.println("SM: app: "+app.getTitle()+" is adding a window: "+window+" with appContext "+AppContext.getAppContext()); weakWindows.add(w); // for mapping window -> app weakApplications.add(app); @@ -539,4 +539,31 @@ class JNLPSecurityManager extends AWTSec } + /** + * Tests if a client can get access to the AWT event queue. This version allows + * complete access to the EventQueue for its own AppContext-specific EventQueue. + * + * FIXME there are probably huge security implications for this. Eg: + * http://hg.openjdk.java.net/jdk7/awt/jdk/rev/8022709a306d + * + * @exception SecurityException if the caller does not have + * permission to accesss the AWT event queue. + */ + public void checkAwtEventQueueAccess() { + /* + * this is the templace of the code that should allow applets access to + * eventqueues + */ + + // AppContext appContext = AppContext.getAppContext(); + // ApplicationInstance instance = getApplication(); + + // if ((appContext == mainAppContext) && (instance != null)) { + // If we're about to allow access to the main EventQueue, + // and anything untrusted is on the class context stack, + // disallow access. + super.checkAwtEventQueueAccess(); + // } + } + } diff -r 85db7b3a1c93 -r eb998ed0ab1a netx/net/sourceforge/jnlp/security/AccessWarningPane.java --- a/netx/net/sourceforge/jnlp/security/AccessWarningPane.java Thu Oct 21 21:12:21 2010 +0100 +++ b/netx/net/sourceforge/jnlp/security/AccessWarningPane.java Fri Oct 22 10:44:12 2010 -0400 @@ -56,6 +56,7 @@ import javax.swing.SwingConstants; import javax.swing.SwingConstants; import net.sourceforge.jnlp.JNLPFile; +import net.sourceforge.jnlp.security.SecurityWarning.AccessType; import net.sourceforge.jnlp.util.FileUtils; /** @@ -86,7 +87,7 @@ public class AccessWarningPane extends S * Creates the actual GUI components, and adds it to this panel */ private void addComponents() { - SecurityWarningDialog.AccessType type = parent.getAccessType(); + AccessType type = parent.getAccessType(); JNLPFile file = parent.getFile(); String name = ""; diff -r 85db7b3a1c93 -r eb998ed0ab1a netx/net/sourceforge/jnlp/security/CertWarningPane.java --- a/netx/net/sourceforge/jnlp/security/CertWarningPane.java Thu Oct 21 21:12:21 2010 +0100 +++ b/netx/net/sourceforge/jnlp/security/CertWarningPane.java Fri Oct 22 10:44:12 2010 -0400 @@ -60,6 +60,7 @@ import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.PluginBridge; import net.sourceforge.jnlp.runtime.JNLPRuntime; +import net.sourceforge.jnlp.security.SecurityWarning.AccessType; import net.sourceforge.jnlp.tools.KeyTool; /** @@ -85,7 +86,7 @@ public class CertWarningPane extends Sec * Creates the actual GUI components, and adds it to this panel */ private void addComponents() { - SecurityWarningDialog.AccessType type = parent.getAccessType(); + AccessType type = parent.getAccessType(); JNLPFile file = parent.getFile(); Certificate c = parent.getJarSigner().getPublisher(); diff -r 85db7b3a1c93 -r eb998ed0ab1a netx/net/sourceforge/jnlp/security/SecurityDialogMessage.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netx/net/sourceforge/jnlp/security/SecurityDialogMessage.java Fri Oct 22 10:44:12 2010 -0400 @@ -0,0 +1,44 @@ +package net.sourceforge.jnlp.security; + +import java.security.cert.X509Certificate; +import java.util.concurrent.Semaphore; + +import javax.swing.JDialog; + +import net.sourceforge.jnlp.JNLPFile; +import net.sourceforge.jnlp.security.SecurityWarning.AccessType; +import net.sourceforge.jnlp.security.SecurityWarning.DialogType; + +/** + * Represents a message to the security framework to show a specific security + * dialog + */ +final class SecurityDialogMessage { + + /* + * These fields contain information need to display the correct dialog type + */ + + public DialogType dialogType; + public AccessType accessType; + public JNLPFile file; + public CertVerifier certVerifier; + public X509Certificate certificate; + public Object[] extras; + + /* + * Volatile because this is shared between threads and we dont want threads + * to use a cached value of this. + */ + public volatile Object userResponse; + + /* + * These two fields are used to block/unblock the application or the applet. + * If either of them is not null, call release() or dispose() on it to allow + * the application/applet to continue. + */ + + public Semaphore lock; + public JDialog toDispose; + +} diff -r 85db7b3a1c93 -r eb998ed0ab1a netx/net/sourceforge/jnlp/security/SecurityDialogMessageHandler.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netx/net/sourceforge/jnlp/security/SecurityDialogMessageHandler.java Fri Oct 22 10:44:12 2010 -0400 @@ -0,0 +1,141 @@ +/* SecurityDialogMessageHandler.java + Copyright (C) 2010 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +IcedTea is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with IcedTea; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. +*/ + +package net.sourceforge.jnlp.security; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; + +import sun.awt.AppContext; + +import net.sourceforge.jnlp.runtime.JNLPRuntime; + +/** + * Handles {@link SecurityDialogMessage}s and shows appropriate security + * dialogs. + *

    From omajid at redhat.com Fri Oct 22 07:46:30 2010 From: omajid at redhat.com (Omair Majid) Date: Fri, 22 Oct 2010 10:46:30 -0400 Subject: [RFC] netx: show security dialogs in a separate AppContext In-Reply-To: <20101020184557.GB10267@redhat.com> References: <4CBDC2BF.5010605@redhat.com> <20101019223835.GF28452@redhat.com> <4CBF305E.7050906@redhat.com> <20101020184557.GB10267@redhat.com> Message-ID: <4CC1A3C6.1070901@redhat.com> On 10/20/2010 02:45 PM, Deepak Bhole wrote: > * Omair Majid [2010-10-20 14:09]: >> Hi, >> >> On 10/19/2010 06:38 PM, Deepak Bhole wrote: >>> * Omair Majid [2010-10-19 12:10]: >>>> Hi, >>>> >>>> The attached patch makes security prompts appear in a separate >>>> AppContext. This ensures that the applet's look and feel is not >>>> automatically set to the system look and feel. >>>> >>>> The patch is a superset of http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-October/010500.html >>>> >>>> This patch also implements a large part of the code necessary to >>>> allow applets to access their EventQueues. However, I still have to >>>> figure out how to use >>>> http://hg.openjdk.java.net/jdk7/awt/jdk/rev/8022709a306d to ensure >>>> allowing access to the EventQueue is safe. So for now, that code is >>>> disabled. >>>> >>>> The patch ensures that the JNLPRuntime is always initialized in the >>>> main AppContext. It starts a thread in this AppContext to listen for >>>> security dialog messages, and shows security dialogs when it >>>> receives an appropriate security message. The security dialogs block >>>> the client applet/application until the user responds. >>>> >>>> Any thoughts or comments? >>>> >>> >>> Hi, >>> >>> Please see comments below. >>> >> >> Thanks for the review and the comments. Updated patch attached. >> >>> Cheers, >>> Deepak >>> >>>> Thanks, >>>> Omair >>> > >>>> +final class SecurityDialogMessage { >>>> + >>>> + /* >>>> + * These fields contain information need to display the correct dialog type >>>> + */ >>>> + >>>> + public DialogType dialogType; >>>> + public AccessType accessType; >>>> + public JNLPFile file; >>>> + public CertVerifier certVerifier; >>>> + public X509Certificate certificate; >>>> + public Object[] extras; >>>> + >>>> + public volatile Object userResponse; >>>> + >>> >>> Why is userResponse volatile? Based on the patch, for a given instance, >>> only one thread (either the even dispatcher when action is performed OR >>> another caller thread when locking throws an interruptedexception) >>> modifies the value... or am I missing something? >>> >> >> I apologise in advance if my knowledge of concurrency is a little >> off, but we need to ensure that setting the values on the message >> object happen-before reading it. Yes, only one thread can change it, >> but the change needs to propogate to the other thread. The lock >> ensures that this happens in the non EventDispatchThread case. In >> the case of the EventDispatchThread, one thread sets the value and >> the other reads it. The volatile ensures that changes to userReponse >> are visible to the client thread. >> >> Perhaps I am wrong; I can make it non-volatile if you want me to. >> > > Ah I see. Yes, you are correct. Volatile in this case will ensure that > userResponse is not locally cached, and therefore the EDT will always > see the update value when returning from getUserResponse(). > I added a comment to userReponse explaining this - it should make it more clear. > Okay, everything else looks good to me. Okay for commit to head. > Thanks for the review! Committed as changeset eb998ed0ab1a. Cheers, Omair From dbhole at redhat.com Fri Oct 22 08:27:45 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Fri, 22 Oct 2010 11:27:45 -0400 Subject: [icedtea-web] RFC: Patch to stabilize applet initialization In-Reply-To: <20101021215240.GD25601@rivendell.middle-earth.co.uk> References: <20101021213816.GF26975@redhat.com> <20101021215240.GD25601@rivendell.middle-earth.co.uk> Message-ID: <20101022152744.GA7664@redhat.com> * Dr Andrew John Hughes [2010-10-21 17:52]: > On 17:38 Thu 21 Oct , Deepak Bhole wrote: > > Hi, > > > > The attached patch envelopes fixes for two of Andrew's pending patches > > (fixing 100% CPU load and the frame pop-up issue). In addition to those, > > it fixes a lot of other initialization issues, particularly when > > initializing multiple applets and/or closing other tabs with applets > > which are being initialized. > > > > With this patch, I tested over 200 parallel applet inits, randomly > > closing tabs, and everything works correctly. > > > > One known issue is that if timed correctly, a frame can appear outside > > for a fraction of a second. It always goes away instantly though, and I > > will be posting a patch to fix that problem in the near future. > > > > Cheers, > > Deepak > > Do you have a ChangeLog for this? It would be good to know why each change > is being made. > > In particular, why: > > > + > > + // Add first, remove later > > + newFrame.add("Center", panel); > > oldFrame.remove(panel); > > oldFrame.dispose(); > > + } else { > > + newFrame.add("Center", panel); > > } > > > > - newFrame.add("Center", panel); > > is this necessary? > As crazy as that looks, yes. here is the full piece of the code: PluginAppletViewer newFrame = new PluginAppletViewer(handle, identifier, statusMsgStream, panel); if (oldFrame != null) { applets.remove(oldFrame.identifier); oldFrame.removeWindowListener(oldFrame.windowEventListener); panel.removeAppletListener(oldFrame.appletEventListener); // Add first, remove later newFrame.add("Center", panel); oldFrame.remove(panel); oldFrame.dispose(); } else { newFrame.add("Center", panel); } oldFrame is an embedded frame in which an applet instance resides, newFrame is another embedded frame with a different handle that it needs to be moved to. In addition to being implanted in oldFrame, oldFrame is also registered as a listener for a few things. We first need to unregister those listeners. We then need to add it to the newFrame right away, as there are problems if the panel does not have a parent. Hence the add being done in the if loop. There is a second case where there may be no previous parent frame at all (initial embedding) -- in this case, we need to do the add() in the else otherwise it will get added twice. The change I alluded to in the original email (to fix the pop-out frame completely) will get rid of the above if/else condition btw, so it is only temporary. Cheers, Deepak > Also there seems to be some odd whitespace changes and excessive (8 space) indenting. > > > diff -r 85db7b3a1c93 plugin/icedteanp/java/sun/applet/PluginAppletViewer.java > > --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Thu Oct 21 21:12:21 2010 +0100 > > +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Thu Oct 21 17:22:56 2010 -0700 > > @@ -136,12 +136,10 @@ > > } > > } > > }); > > + > > + // create the frame. > > + PluginAppletViewer.reFrame(null, identifier, System.out, 0, panel); > > > > - > > - > > - // create the frame. > > - PluginAppletViewer.reFrame(null, identifier, System.out, handle, panel); > > - > > panel.init(); > > > > // Start the applet > > @@ -179,15 +177,7 @@ > > > > // Wait for the panel to initialize > > // (happens in a separate thread) > > - while (panel.getApplet() == null && > > - ((NetxPanel) panel).isAlive()) { > > - try { > > - Thread.sleep(50); > > - PluginDebug.debug("Waiting for applet to initialize..."); > > - } catch (InterruptedException ie) { > > - // just wait > > - } > > - } > > + PluginAppletViewer.waitForAppletInit((NetxPanel) panel); > > > > a = panel.getApplet(); > > > > @@ -317,7 +307,17 @@ > > */ > > private static String defaultSaveFile = "Applet.ser"; > > > > - private static enum PAV_INIT_STATUS {PRE_INIT, IN_INIT, INIT_COMPLETE, INACTIVE}; > > + > > + /** > > + * Enumerates the current status of an applet > > + * > > + * PRE_INIT -> Parsing and initialization phase > > + * INIT_COMPLETE -> Initialization complete, reframe pending > > + * REFRAME_COMPLETE -> Reframe complete, applet is initialized and usable by the user > > + * INACTIVE -> Browser has directed that the applet be destroyed (this state is non-overridable except by DESTROYED) > > + * DESTROYED -> Applet has been destroyed > > + */ > > + private static enum PAV_INIT_STATUS {PRE_INIT, INIT_COMPLETE, REFRAME_COMPLETE, INACTIVE, DESTROYED}; > > > > /** > > * The panel in which the applet is being displayed. > > @@ -350,7 +350,6 @@ > > > > private static HashMap status = > > new HashMap(); > > - > > > > private long handle = 0; > > private WindowListener windowEventListener = null; > > @@ -380,16 +379,20 @@ > > return; > > > > PluginAppletViewer newFrame = new PluginAppletViewer(handle, identifier, statusMsgStream, panel); > > - > > + > > if (oldFrame != null) { > > applets.remove(oldFrame.identifier); > > oldFrame.removeWindowListener(oldFrame.windowEventListener); > > panel.removeAppletListener(oldFrame.appletEventListener); > > + > > + // Add first, remove later > > + newFrame.add("Center", panel); > > oldFrame.remove(panel); > > oldFrame.dispose(); > > + } else { > > + newFrame.add("Center", panel); > > } > > > > - newFrame.add("Center", panel); > > newFrame.pack(); > > > > newFrame.appletEventListener = new AppletEventListener(newFrame, newFrame); > > @@ -397,11 +400,6 @@ > > > > applets.put(identifier, newFrame); > > > > - // dispose oldframe if necessary > > - if (oldFrame != null) { > > - oldFrame.dispose(); > > - } > > - > > PluginDebug.debug(panel + " reframed"); > > } > > > > @@ -449,7 +447,7 @@ > > this.frame = frame; > > this.appletViewer = appletViewer; > > } > > - > > + > > public void appletStateChanged(AppletEvent evt) > > { > > AppletPanel src = (AppletPanel)evt.getSource(); > > @@ -483,9 +481,9 @@ > > AppletPanel.changeFrameAppContext(frame, SunToolkit.targetToAppContext(a)); > > else > > AppletPanel.changeFrameAppContext(frame, AppContext.getAppContext()); > > - > > - status.put(appletViewer.identifier, PAV_INIT_STATUS.INIT_COMPLETE); > > - > > + > > + updateStatus(appletViewer.identifier, PAV_INIT_STATUS.INIT_COMPLETE); > > + > > break; > > } > > } > > @@ -510,7 +508,13 @@ > > > > try { > > if (message.startsWith("handle")) { > > - > > + > > + // If there is a key for this status, it means it > > + // was either initialized before, or destroy has been > > + // processed. Stop moving further. > > + if (updateStatus(identifier, PAV_INIT_STATUS.PRE_INIT) != null) > > + return; > > + > > // Extract the information from the message > > String[] msgParts = new String[4]; > > for (int i=0; i < 3; i++) { > > @@ -519,32 +523,38 @@ > > msgParts[i] = message.substring(spaceLocation + 1, nextSpaceLocation); > > message = message.substring(nextSpaceLocation + 1); > > } > > - > > + > > long handle = Long.parseLong(msgParts[0]); > > String width = msgParts[1]; > > String height = msgParts[2]; > > - > > + > > int spaceLocation = message.indexOf(' ', "tag".length()+1); > > String documentBase = > > UrlUtil.decode(message.substring("tag".length() + 1, spaceLocation)); > > - String tag = message.substring(spaceLocation+1); > > + String tag = message.substring(spaceLocation+1); > > + > > + // Decode the tag > > + tag = tag.replace(">", ">"); > > + tag = tag.replace("<", "<"); > > + tag = tag.replace("&", "&"); > > + tag = tag.replace(" ", "\n"); > > + tag = tag.replace(" ", "\r"); > > + tag = tag.replace(""", "\""); > > > > PluginDebug.debug ("Handle = " + handle + "\n" + > > "Width = " + width + "\n" + > > "Height = " + height + "\n" + > > "DocumentBase = " + documentBase + "\n" + > > "Tag = " + tag); > > - > > - status.put(identifier, PAV_INIT_STATUS.PRE_INIT); > > + > > PluginAppletViewer.parse > > (identifier, handle, width, height, > > new StringReader(tag), > > new URL(documentBase)); > > - > > > > int maxWait = APPLET_TIMEOUT; // wait for applet to fully load > > int wait = 0; > > - while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && > > + while ( !applets.containsKey(identifier) && // Map is populated only by reFrame > > (wait < maxWait)) { > > > > try { > > @@ -555,9 +565,44 @@ > > } > > } > > > > - if (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE)) > > + // If wait exceeded maxWait, we timed out. Throw an exception > > + if (wait >= maxWait) > > throw new Exception("Applet initialization timeout"); > > > > + PluginAppletViewer oldFrame = applets.get(identifier); > > + > > + // We should not try to destroy an applet during > > + // initialization. It may cause an inconsistent state, > > + // which would bad if it's a trusted applet that > > + // read/writes to files > > + waitForAppletInit((NetxPanel) applets.get(identifier).panel); > > + > > + // Should we proceed with reframing? > > + if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { > > + destroyApplet(identifier); > > + return; > > + } > > + > > + // Proceed with re-framing > > + reFrame(oldFrame, identifier, System.out, handle, oldFrame.panel); > > + > > + // There is a slight chance that destroy can happen > > + // between the above and below line > > + if (updateStatus(identifier, PAV_INIT_STATUS.REFRAME_COMPLETE).equals(PAV_INIT_STATUS.INACTIVE)) { > > + destroyApplet(identifier); > > + } > > + > > + } else if (message.startsWith("destroy")) { > > + > > + // Set it inactive, and try to do cleanup is applicable > > + PAV_INIT_STATUS previousStatus = updateStatus(identifier, PAV_INIT_STATUS.INACTIVE); > > + PluginDebug.debug("Destroy status set for " + identifier); > > + > > + if (previousStatus != null && > > + previousStatus.equals(PAV_INIT_STATUS.REFRAME_COMPLETE)) { > > + destroyApplet(identifier); > > + } > > + > > } else { > > PluginDebug.debug ("Handling message: " + message + " instance " + identifier + " " + Thread.currentThread()); > > > > @@ -568,7 +613,7 @@ > > status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT) > > ) > > ); > > - > > + > > // don't bother processing further for inactive applets > > if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) > > return; > > @@ -580,31 +625,131 @@ > > e.printStackTrace(); > > > > // If an exception happened during pre-init, we need to update status > > - if (status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT)) > > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > > + updateStatus(identifier, PAV_INIT_STATUS.INACTIVE); > > > > throw new RuntimeException("Failed to handle message: " + > > message + " for instance " + identifier, e); > > } > > } > > - > > + > > + /** > > + * Sets the status unless an overriding status is set (e.g. if > > + * status is DESTROYED, it may not be overridden). > > + * > > + * @param identifier The identifier for which the status is to be set > > + * @param status The status to switch to > > + * @return The previous status > > + */ > > + private static synchronized PAV_INIT_STATUS updateStatus(int identifier, PAV_INIT_STATUS newStatus) { > > + > > + PAV_INIT_STATUS prev = status.get(identifier); > > + > > + // If the status is set > > + if (status.containsKey(identifier)) { > > + > > + // Nothing may override destroyed status > > + if (status.get(identifier).equals(PAV_INIT_STATUS.DESTROYED)) { > > + return prev; > > + } > > + > > + // If status is inactive, only DESTROYED may override it > > + if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { > > + if (!newStatus.equals(PAV_INIT_STATUS.DESTROYED)) { > > + return prev; > > + } > > + } > > + } > > + > > + // Else set to given status > > + status.put(identifier, newStatus); > > + > > + return prev; > > + } > > + > > + /** > > + * Destroys the given applet instance. > > + * > > + * This function may be called multiple times without problems. > > + * It does a synchronized check on the status and will only > > + * attempt to destroy the applet if not previously destroyed. > > + * > > + * @param identifier The instance which is to be destroyed > > + */ > > + > > + private static synchronized void destroyApplet(int identifier) { > > + > > + PluginDebug.debug("DestroyApplet called for " + identifier); > > + > > + PAV_INIT_STATUS prev = updateStatus(identifier, PAV_INIT_STATUS.DESTROYED); > > + > > + // If already destroyed, return > > + if (prev.equals(PAV_INIT_STATUS.DESTROYED)) { > > + PluginDebug.debug(identifier + " already destroyed. Returning."); > > + return; > > + } > > + > > + // If already disposed, return > > + if (applets.get(identifier).panel.applet == null) { > > + // Try to still dispose the panel itself -- no harm done with double dispose > > + applets.get(identifier).dispose(); > > + > > + PluginDebug.debug(identifier + " inactive. Returning."); > > + return; > > + } > > + > > + PluginDebug.debug("Attempting to destroy " + identifier); > > + > > + final int fIdentifier = identifier; > > + SwingUtilities.invokeLater(new Runnable() { > > + public void run() { > > + applets.get(fIdentifier).appletClose(); > > + } > > + }); > > + > > + PluginDebug.debug(identifier + " destroyed"); > > + } > > + > > + /** > > + * Function to block until applet initialization is complete > > + * > > + * @param identifier The instance to wait for > > + */ > > + public static void waitForAppletInit(NetxPanel panel) { > > + > > + int waitTime = 0; > > + > > + // Wait till initialization finishes > > + while (panel.getApplet() == null && > > + panel.isAlive() && > > + waitTime < APPLET_TIMEOUT) { > > + try { > > + if (waitTime%500 == 0) > > + PluginDebug.debug("Waiting for applet panel " + panel + " to initialize..."); > > + > > + Thread.sleep(waitTime += 50); > > + } catch (InterruptedException ie) { > > + // just wait > > + } > > + } > > + > > + PluginDebug.debug("Applet panel " + panel + " initialized"); > > + } > > + > > public void handleMessage(int reference, String message) > > { > > if (message.startsWith("width")) { > > > > // Wait for panel to come alive > > int maxWait = APPLET_TIMEOUT; // wait for panel to come alive > > - int wait = 0; > > + int wait = 0; > > while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && wait < maxWait) { > > - > > - try { > > - Thread.sleep(50); > > - wait += 50; > > - } catch (InterruptedException ie) { > > - // just wait > > - } > > - } > > - > > + try { > > + Thread.sleep(50); > > + wait += 50; > > + } catch (InterruptedException ie) { > > + // just wait > > + } > > + } > > > > // 0 => width, 1=> width_value, 2 => height, 3=> height_value > > String[] dimMsg = message.split(" "); > > @@ -636,7 +781,7 @@ > > > > panel.setSize(width, height); > > panel.validate(); > > - > > + > > panel.applet.resize(width, height); > > panel.applet.validate(); > > } > > @@ -649,9 +794,6 @@ > > e.printStackTrace(); > > } > > > > - } else if (message.startsWith("destroy")) { > > - dispose(); > > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > > } else if (message.startsWith("GetJavaObject")) { > > > > // FIXME: how do we determine what security context this > > @@ -672,15 +814,7 @@ > > > > // Wait for the panel to initialize > > // (happens in a separate thread) > > - while (panel.getApplet() == null && > > - ((NetxPanel) panel).isAlive()) { > > - try { > > - Thread.sleep(50); > > - PluginDebug.debug("Waiting for applet to initialize..."); > > - } catch (InterruptedException ie) { > > - // just wait > > - } > > - } > > + waitForAppletInit((NetxPanel) panel); > > > > PluginDebug.debug(panel + " -- " + panel.getApplet() + " -- " + ((NetxPanel) panel).isAlive()); > > > > @@ -1548,10 +1682,11 @@ > > if (countApplets() == 0) { > > appletSystemExit(); > > } > > + > > + updateStatus(identifier, PAV_INIT_STATUS.DESTROYED); > > } > > }).start(); > > > > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > > } > > > > /** > > @@ -1677,18 +1812,6 @@ > > val = buf.toString(); > > } > > > > - att = att.replace(">", ">"); > > - att = att.replace("<", "<"); > > - att = att.replace("&", "&"); > > - att = att.replace(" ", "\n"); > > - att = att.replace(" ", "\r"); > > - > > - val = val.replace(">", ">"); > > - val = val.replace("<", "<"); > > - val = val.replace("&", "&"); > > - val = val.replace(" ", "\n"); > > - val = val.replace(" ", "\r"); > > - > > PluginDebug.debug("PUT " + att + " = '" + val + "'"); > > atts.put(att.toLowerCase(java.util.Locale.ENGLISH), val); > > > > @@ -1708,7 +1831,6 @@ > > // private static final == inline > > private static final boolean isInt(Object o) { > > boolean isInt = false; > > - > > try { > > Integer.parseInt((String) o); > > isInt = true; > > @@ -1763,7 +1885,6 @@ > > } catch (IOException ioe) { > > return ioe; > > } > > - > > return null; > > } > > }; > > @@ -1785,6 +1906,7 @@ > > boolean isObjectTag = false; > > boolean isEmbedTag = false; > > boolean objectTagAlreadyParsed = false; > > + > > // The current character > > // FIXME: This is an evil hack to force pass-by-reference.. the > > // parsing code needs to be rewritten from scratch to prevent such > > @@ -1879,19 +2001,6 @@ > > if (val == null) { > > statusMsgStream.println(requiresNameWarning); > > } else if (atts != null) { > > - att = att.replace(">", ">"); > > - att = att.replace("<", "<"); > > - att = att.replace("&", "&"); > > - att = att.replace(" ", "\n"); > > - att = att.replace(" ", "\r"); > > - att = att.replace(""", "\""); > > - > > - val = val.replace(">", ">"); > > - val = val.replace("<", "<"); > > - val = val.replace("&", "&"); > > - val = val.replace(" ", "\n"); > > - val = val.replace(" ", "\r"); > > - val = val.replace(""", "\""); > > PluginDebug.debug("PUT " + att + " = " + val); > > atts.put(att.toLowerCase(), val); > > } else { > > @@ -1920,8 +2029,8 @@ > > > > if (atts.get("width") == null || !isInt(atts.get("width"))) { > > atts.put("width", width); > > - } > > - > > + } > > + > > if (atts.get("height") == null || !isInt(atts.get("height"))) { > > atts.put("height", height); > > } > > @@ -1974,7 +2083,7 @@ > > if (atts.get("width") == null || !isInt(atts.get("width"))) { > > atts.put("width", width); > > } > > - > > + > > if (atts.get("height") == null || !isInt(atts.get("height"))) { > > atts.put("height", height); > > } > > @@ -2023,10 +2132,11 @@ > > if (atts.get("width") == null || !isInt(atts.get("width"))) { > > atts.put("width", width); > > } > > - > > + > > if (atts.get("height") == null || !isInt(atts.get("height"))) { > > atts.put("height", height); > > } > > + > > } > > } > > } > > diff -r 85db7b3a1c93 plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java > > --- a/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java Thu Oct 21 21:12:21 2010 +0100 > > +++ b/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java Thu Oct 21 17:22:56 2010 -0700 > > @@ -126,6 +126,10 @@ > > } > > > > private String getPriorityStrIfPriority(String message) { > > + > > + // Destroy messages are permanently high priority > > + if (message.endsWith("destroy")) > > + return "destroy"; > > > > synchronized (priorityWaitQueue) { > > Iterator it = priorityWaitQueue.iterator(); > > @@ -150,7 +154,6 @@ > > } > > } > > > > - > > public void notifyWorkerIsFree(PluginMessageHandlerWorker worker) { > > synchronized (initWorkers) { > > Iterator i = initWorkers.keySet().iterator(); > > @@ -176,6 +179,32 @@ > > } > > > > protected class ConsumerThread extends Thread { > > + > > + /** > > + * Scans the readQueue for priority messages and brings them to the front > > + */ > > + private void bringPriorityMessagesToFront() { > > + synchronized (readQueue) { > > + > > + // iterate through the list > > + for (int i=0; i < readQueue.size(); i++) { > > + > > + // remove element at i to inspect it > > + String message = readQueue.remove(i); > > + > > + // if element at i is a priority msg, bring it forward > > + if (getPriorityStrIfPriority(message) != null) { > > + readQueue.addFirst(message); > > + } else { // else keep it where it was > > + readQueue.add(i, message); > > + } > > + > > + // by the end the queue size is the same, so the > > + // position indicator (i) is still valid > > + } > > + } > > + } > > + > > public void run() { > > > > while (true) { > > @@ -190,7 +219,6 @@ > > > > String[] msgParts = message.split(" "); > > > > - > > String priorityStr = getPriorityStrIfPriority(message); > > boolean isPriorityResponse = (priorityStr != null); > > > > @@ -199,9 +227,12 @@ > > > > if (worker == null) { > > synchronized(readQueue) { > > - readQueue.addLast(message); > > + readQueue.addFirst(message); > > } > > > > + // re-scan to see if any priority message came in > > + bringPriorityMessagesToFront(); > > + > > continue; // re-loop to try next msg > > } > > > > > -- > Andrew :) > > Free Java Software Engineer > Red Hat, Inc. (http://www.redhat.com) > > Support Free Java! > Contribute to GNU Classpath and the OpenJDK > http://www.gnu.org/software/classpath > http://openjdk.java.net > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From asu at redhat.com Fri Oct 22 08:40:32 2010 From: asu at redhat.com (Andrew Su) Date: Fri, 22 Oct 2010 11:40:32 -0400 (EDT) Subject: [icedtea-web] RFC: Patch to stabilize applet initialization In-Reply-To: <374199110.1470821287758101430.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <1360043844.1483571287762032263.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> ----- "Andrew Su" wrote: > From: "Andrew Su" > To: "Deepak Bhole" > Cc: "IcedTea Distro List" > Sent: Friday, October 22, 2010 10:35:01 AM GMT -05:00 US/Canada Eastern > Subject: Re: [icedtea-web] RFC: Patch to stabilize applet initialization > > ----- "Deepak Bhole" wrote: > > > From: "Deepak Bhole" > > To: "IcedTea Distro List" > > Sent: Thursday, October 21, 2010 5:41:11 PM GMT -05:00 US/Canada > Eastern > > Subject: Re: [icedtea-web] RFC: Patch to stabilize applet > initialization > > > > * Deepak Bhole [2010-10-21 17:38]: > > > Hi, > > > > > > The attached patch envelopes fixes for two of Andrew's pending > > patches > > > (fixing 100% CPU load and the frame pop-up issue). In addition to > > those, > > > it fixes a lot of other initialization issues, particularly when > > > initializing multiple applets and/or closing other tabs with > > applets > > > which are being initialized. > > > > > > With this patch, I tested over 200 parallel applet inits, > randomly > > > closing tabs, and everything works correctly. > > > > > > One known issue is that if timed correctly, a frame can appear > > outside > > > for a fraction of a second. It always goes away instantly though, > > and I > > > will be posting a patch to fix that problem in the near future. > > > > > > Cheers, > > > Deepak > > > > Please ignore the spacing issues. I will be normalizing all spaces > > for > > all of icedtea-web in another commit after all pending patches are > > in. > > > > Cheers, > > Deepak > > > > > diff -r 85db7b3a1c93 > > plugin/icedteanp/java/sun/applet/PluginAppletViewer.java > > > --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java > Thu > > Oct 21 21:12:21 2010 +0100 > > > +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java > Thu > > Oct 21 17:22:56 2010 -0700 > > > @@ -136,12 +136,10 @@ > > > } > > > } > > > }); > > > + > > > + // create the frame. > > > + PluginAppletViewer.reFrame(null, identifier, > System.out, > > 0, panel); > > > > > > - > > > - > > > - // create the frame. > > > - PluginAppletViewer.reFrame(null, identifier, > System.out, > > handle, panel); > > > - > > > panel.init(); > > > > > > // Start the applet > > > @@ -179,15 +177,7 @@ > > > > > > // Wait for the panel to initialize > > > // (happens in a separate thread) > > > - while (panel.getApplet() == null && > > > - ((NetxPanel) panel).isAlive()) { > > > - try { > > > - Thread.sleep(50); > > > - PluginDebug.debug("Waiting for applet to > > initialize..."); > > > - } catch (InterruptedException ie) { > > > - // just wait > > > - } > > > - } > > > + PluginAppletViewer.waitForAppletInit((NetxPanel) > panel); > > > > > > a = panel.getApplet(); > > > > > > @@ -317,7 +307,17 @@ > > > */ > > > private static String defaultSaveFile = "Applet.ser"; > > > > > > - private static enum PAV_INIT_STATUS {PRE_INIT, IN_INIT, > > INIT_COMPLETE, INACTIVE}; > > > + > > > + /** > > > + * Enumerates the current status of an applet > > > + * > > > + * PRE_INIT -> Parsing and initialization phase > > > + * INIT_COMPLETE -> Initialization complete, reframe > pending > > > + * REFRAME_COMPLETE -> Reframe complete, applet is > > initialized and usable by the user > > > + * INACTIVE -> Browser has directed that the applet be > > destroyed (this state is non-overridable except by DESTROYED) > > > + * DESTROYED -> Applet has been destroyed > > > + */ > > > + private static enum PAV_INIT_STATUS {PRE_INIT, > INIT_COMPLETE, > > REFRAME_COMPLETE, INACTIVE, DESTROYED}; > > > > > > /** > > > * The panel in which the applet is being displayed. > > > @@ -350,7 +350,6 @@ > > > > > > private static HashMap status = > > > new HashMap(); > > > - > > > > > > private long handle = 0; > > > private WindowListener windowEventListener = null; > > > @@ -380,16 +379,20 @@ > > > return; > > > > > > PluginAppletViewer newFrame = new > > PluginAppletViewer(handle, identifier, statusMsgStream, panel); > > > - > > > + > > > if (oldFrame != null) { > > > applets.remove(oldFrame.identifier); > > > > > oldFrame.removeWindowListener(oldFrame.windowEventListener); > > > > > panel.removeAppletListener(oldFrame.appletEventListener); > > > + > > > + // Add first, remove later > > > + newFrame.add("Center", panel); > > > oldFrame.remove(panel); > > > oldFrame.dispose(); > > > + } else { > > > + newFrame.add("Center", panel); > > > } > > > > > > - newFrame.add("Center", panel); > > > newFrame.pack(); > > > > > > newFrame.appletEventListener = new > > AppletEventListener(newFrame, newFrame); > > > @@ -397,11 +400,6 @@ > > > > > > applets.put(identifier, newFrame); > > > > > > - // dispose oldframe if necessary > > > - if (oldFrame != null) { > > > - oldFrame.dispose(); > > > - } > > > - > > > PluginDebug.debug(panel + " reframed"); > > > } > > > > > > @@ -449,7 +447,7 @@ > > > this.frame = frame; > > > this.appletViewer = appletViewer; > > > } > > > - > > > + > > > public void appletStateChanged(AppletEvent evt) > > > { > > > AppletPanel src = (AppletPanel)evt.getSource(); > > > @@ -483,9 +481,9 @@ > > > AppletPanel.changeFrameAppContext(frame, > > SunToolkit.targetToAppContext(a)); > > > else > > > AppletPanel.changeFrameAppContext(frame, > > AppContext.getAppContext()); > > > - > > > - status.put(appletViewer.identifier, > > PAV_INIT_STATUS.INIT_COMPLETE); > > > - > > > + > > > + updateStatus(appletViewer.identifier, > > PAV_INIT_STATUS.INIT_COMPLETE); > > > + > > > break; > > > } > > > } > > > @@ -510,7 +508,13 @@ > > > > > > try { > > > if (message.startsWith("handle")) { > > > - > > > + > > > + // If there is a key for this status, it means it > > > + // was either initialized before, or destroy has > been > > > > > + // processed. Stop moving further. > > > + if (updateStatus(identifier, > > PAV_INIT_STATUS.PRE_INIT) != null) > > > + return; > > > + > > > // Extract the information from the message > > > String[] msgParts = new String[4]; > > > for (int i=0; i < 3; i++) { > > > @@ -519,32 +523,38 @@ > > > msgParts[i] = message.substring(spaceLocation + > 1, > > nextSpaceLocation); > > > message = message.substring(nextSpaceLocation + > 1); > > > } > > > - > > > + > > > long handle = Long.parseLong(msgParts[0]); > > > String width = msgParts[1]; > > > String height = msgParts[2]; > > > - > > > + > > > int spaceLocation = message.indexOf(' ', > > "tag".length()+1); > > > String documentBase = > > > > > UrlUtil.decode(message.substring("tag".length() + 1, > spaceLocation)); > > > - String tag = message.substring(spaceLocation+1); > > > + String tag = message.substring(spaceLocation+1); > > > + > > > + // Decode the tag > > > + tag = tag.replace(">", ">"); > > > + tag = tag.replace("<", "<"); > > > + tag = tag.replace("&", "&"); > > > + tag = tag.replace(" ", "\n"); > > > + tag = tag.replace(" ", "\r"); > > > + tag = tag.replace(""", "\""); > > > > > > PluginDebug.debug ("Handle = " + handle + "\n" + > > > "Width = " + width + "\n" + > > > "Height = " + height + "\n" + > > > "DocumentBase = " + documentBase > + > > "\n" + > > > "Tag = " + tag); > > > - > > > - status.put(identifier, > > PAV_INIT_STATUS.PRE_INIT); > > > + > > > PluginAppletViewer.parse > > > (identifier, handle, width, height, > > > new StringReader(tag), > > > new URL(documentBase)); > > > - > > > > > > int maxWait = APPLET_TIMEOUT; // wait for > applet > > to fully load > > > int wait = 0; > > > - while > > (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && > > > + while ( !applets.containsKey(identifier) && // > Map > > is populated only by reFrame > > > (wait < maxWait)) { > > > > > > try { > > > @@ -555,9 +565,44 @@ > > > } > > > } > > > > > > - if > > (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE)) > > > + // If wait exceeded maxWait, we timed out. > Throw > > an exception > > > + if (wait >= maxWait) > > > throw new Exception("Applet initialization > > timeout"); > > > > > > + PluginAppletViewer oldFrame = > > applets.get(identifier); > > > + > > > + // We should not try to destroy an applet during > > > > + // initialization. It may cause an inconsistent > > state, > > > + // which would bad if it's a trusted applet that > > > > + // read/writes to files > > > + waitForAppletInit((NetxPanel) > > applets.get(identifier).panel); > > > + > > > + // Should we proceed with reframing? > > > + if > > (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { > > > + destroyApplet(identifier); > > > + return; > > > + } > > > + > > > + // Proceed with re-framing > > > + reFrame(oldFrame, identifier, System.out, handle, > > oldFrame.panel); > > > + > > > + // There is a slight chance that destroy can > > happen > > > + // between the above and below line > > > + if (updateStatus(identifier, > > PAV_INIT_STATUS.REFRAME_COMPLETE).equals(PAV_INIT_STATUS.INACTIVE)) > { > > > + destroyApplet(identifier); > > > + } > > > + > > > + } else if (message.startsWith("destroy")) { > > > + > > > + // Set it inactive, and try to do cleanup is > > applicable > > > + PAV_INIT_STATUS previousStatus = > > updateStatus(identifier, PAV_INIT_STATUS.INACTIVE); > > > + PluginDebug.debug("Destroy status set for " + > > identifier); > > > + > > > + if (previousStatus != null && > > > + > > previousStatus.equals(PAV_INIT_STATUS.REFRAME_COMPLETE)) { > > > + destroyApplet(identifier); > > > + } > > > + > > > } else { > > > PluginDebug.debug ("Handling message: " + > message > > + " instance " + identifier + " " + Thread.currentThread()); > > > > > > @@ -568,7 +613,7 @@ > > > > > status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT) > > > ) > > > ); > > > - > > > + > > > // don't bother processing further for inactive > > applets > > > if > > (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) > > > return; > > > @@ -580,31 +625,131 @@ > > > e.printStackTrace(); > > > > > > // If an exception happened during pre-init, we > need > > to update status > > > - if > > (status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT)) > > > - status.put(identifier, > PAV_INIT_STATUS.INACTIVE); > > > + updateStatus(identifier, PAV_INIT_STATUS.INACTIVE); > > > > > > throw new RuntimeException("Failed to handle > message: > > " + > > > message + " for instance " + identifier, > e); > > > } > > > } > > > - > > > + > > > + /** > > > + * Sets the status unless an overriding status is set (e.g. > if > > > > > + * status is DESTROYED, it may not be overridden). > > > + * > > > + * @param identifier The identifier for which the status is > to > > be set > > > + * @param status The status to switch to > > > + * @return The previous status > > > + */ > > > + private static synchronized PAV_INIT_STATUS > updateStatus(int > > identifier, PAV_INIT_STATUS newStatus) { > > > + > > > + PAV_INIT_STATUS prev = status.get(identifier); > > > + > > > + // If the status is set > > > + if (status.containsKey(identifier)) { > > > + > > > + // Nothing may override destroyed status > > > + if > > (status.get(identifier).equals(PAV_INIT_STATUS.DESTROYED)) { > > > + return prev; > > > + } > > > + > > > + // If status is inactive, only DESTROYED may override it > > > + if > > (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { > > > + if (!newStatus.equals(PAV_INIT_STATUS.DESTROYED)) { > > > + return prev; > > Status isn't updated to PAV_INIT_STATUS.DESTROYED. Oops! Sorry misread that. This is fine, (didn't see the !) > > > > > + } > > > + } > > > + } > > > + > > > + // Else set to given status > > > + status.put(identifier, newStatus); > > > + > > > + return prev; > > > + } > > > + > > > + /** > > > + * Destroys the given applet instance. > > > + * > > > + * This function may be called multiple times without > > problems. > > > + * It does a synchronized check on the status and will only > > > > + * attempt to destroy the applet if not previously > destroyed. > > > + * > > > + * @param identifier The instance which is to be destroyed > > > + */ > > > + > > > + private static synchronized void destroyApplet(int > identifier) > > { > > > + > > > + PluginDebug.debug("DestroyApplet called for " + > identifier); > > > + > > > + PAV_INIT_STATUS prev = updateStatus(identifier, > > PAV_INIT_STATUS.DESTROYED); > > > + > > > + // If already destroyed, return > > > + if (prev.equals(PAV_INIT_STATUS.DESTROYED)) { > > > + PluginDebug.debug(identifier + " already destroyed. > > Returning."); > > > + return; > > > + } > > > + > > > + // If already disposed, return > > > + if (applets.get(identifier).panel.applet == null) { > > > + // Try to still dispose the panel itself -- no harm done > > with double dispose > > > + applets.get(identifier).dispose(); > > > + > > > + PluginDebug.debug(identifier + " inactive. Returning."); > > > + return; > > > + } > > > + > > > + PluginDebug.debug("Attempting to destroy " + identifier); > > > + > > > + final int fIdentifier = identifier; > > > + SwingUtilities.invokeLater(new Runnable() { > > > + public void run() { > > > + applets.get(fIdentifier).appletClose(); > > > + } > > > + }); > > > + > > > + PluginDebug.debug(identifier + " destroyed"); > > > + } > > > + > > > + /** > > > + * Function to block until applet initialization is > complete > > > + * > > > + * @param identifier The instance to wait for > > > + */ > > > + public static void waitForAppletInit(NetxPanel panel) { > > > + > > > + int waitTime = 0; > > > + > > > + // Wait till initialization finishes > > > + while (panel.getApplet() == null && > > > + panel.isAlive() && > > > + waitTime < APPLET_TIMEOUT) { > > > + try { > > > + if (waitTime%500 == 0) > > > + PluginDebug.debug("Waiting for applet panel " > + > > panel + " to initialize..."); > > > + > > > + Thread.sleep(waitTime += 50); > > > + } catch (InterruptedException ie) { > > > + // just wait > > > + } > > > + } > > > + > > > + PluginDebug.debug("Applet panel " + panel + " > > initialized"); > > > + } > > > + > > > public void handleMessage(int reference, String message) > > > { > > > if (message.startsWith("width")) { > > > > > > // Wait for panel to come alive > > > int maxWait = APPLET_TIMEOUT; // wait for panel to > > come alive > > > - int wait = 0; > > > + int wait = 0; > > > while > > (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && > wait > > < maxWait) { > > > - > > > - try { > > > - Thread.sleep(50); > > > - wait += 50; > > > - } catch (InterruptedException ie) { > > > - // just wait > > > - } > > > - } > > > - > > > + try { > > > + Thread.sleep(50); > > > + wait += 50; > > > + } catch (InterruptedException ie) { > > > + // just wait > > > + } > > > + } > > > > > > // 0 => width, 1=> width_value, 2 => height, 3=> > > height_value > > > String[] dimMsg = message.split(" "); > > > @@ -636,7 +781,7 @@ > > > > > > panel.setSize(width, height); > > > panel.validate(); > > > - > > > + > > > panel.applet.resize(width, height); > > > panel.applet.validate(); > > > } > > > @@ -649,9 +794,6 @@ > > > e.printStackTrace(); > > > } > > > > > > - } else if (message.startsWith("destroy")) { > > > - dispose(); > > > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > > > } else if (message.startsWith("GetJavaObject")) { > > > > > > // FIXME: how do we determine what security context > > this > > > @@ -672,15 +814,7 @@ > > > > > > // Wait for the panel to initialize > > > // (happens in a separate thread) > > > - while (panel.getApplet() == null && > > > - ((NetxPanel) panel).isAlive()) { > > > - try { > > > - Thread.sleep(50); > > > - PluginDebug.debug("Waiting for applet to > > initialize..."); > > > - } catch (InterruptedException ie) { > > > - // just wait > > > - } > > > - } > > > + waitForAppletInit((NetxPanel) panel); > > > > > > PluginDebug.debug(panel + " -- " + panel.getApplet() > + > > " -- " + ((NetxPanel) panel).isAlive()); > > > > > > @@ -1548,10 +1682,11 @@ > > > if (countApplets() == 0) { > > > appletSystemExit(); > > > } > > > + > > > + updateStatus(identifier, > > PAV_INIT_STATUS.DESTROYED); > > > } > > > }).start(); > > > > > > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > > > } > > > > > > /** > > > @@ -1677,18 +1812,6 @@ > > > val = buf.toString(); > > > } > > > > > > - att = att.replace(">", ">"); > > > - att = att.replace("<", "<"); > > > - att = att.replace("&", "&"); > > > - att = att.replace(" ", "\n"); > > > - att = att.replace(" ", "\r"); > > > - > > > - val = val.replace(">", ">"); > > > - val = val.replace("<", "<"); > > > - val = val.replace("&", "&"); > > > - val = val.replace(" ", "\n"); > > > - val = val.replace(" ", "\r"); > > > - > > > PluginDebug.debug("PUT " + att + " = '" + val + "'"); > > > atts.put(att.toLowerCase(java.util.Locale.ENGLISH), > val); > > > > > > @@ -1708,7 +1831,6 @@ > > > // private static final == inline > > > private static final boolean isInt(Object o) { > > > boolean isInt = false; > > > - > > > try { > > > Integer.parseInt((String) o); > > > isInt = true; > > > @@ -1763,7 +1885,6 @@ > > > } catch (IOException ioe) { > > > return ioe; > > > } > > > - > > > return null; > > > } > > > }; > > > @@ -1785,6 +1906,7 @@ > > > boolean isObjectTag = false; > > > boolean isEmbedTag = false; > > > boolean objectTagAlreadyParsed = false; > > > + > > > // The current character > > > // FIXME: This is an evil hack to force > > pass-by-reference.. the > > > // parsing code needs to be rewritten from scratch to > > prevent such > > > @@ -1879,19 +2001,6 @@ > > > if (val == null) { > > > > > statusMsgStream.println(requiresNameWarning); > > > } else if (atts != null) { > > > - att = att.replace(">", ">"); > > > - att = att.replace("<", "<"); > > > - att = att.replace("&", > "&"); > > > - att = att.replace(" ", > "\n"); > > > - att = att.replace(" ", > "\r"); > > > - att = att.replace(""", > > "\""); > > > - > > > - val = val.replace(">", ">"); > > > - val = val.replace("<", "<"); > > > - val = val.replace("&", > "&"); > > > - val = val.replace(" ", > "\n"); > > > - val = val.replace(" ", > "\r"); > > > - val = val.replace(""", > > "\""); > > > PluginDebug.debug("PUT " + att + > " > > = " + val); > > > atts.put(att.toLowerCase(), > val); > > > } else { > > > @@ -1920,8 +2029,8 @@ > > > > > > if (atts.get("width") == null || > > !isInt(atts.get("width"))) { > > > atts.put("width", width); > > > - } > > > - > > > + } > > > + > > > if (atts.get("height") == null || > > !isInt(atts.get("height"))) { > > > atts.put("height", height); > > > } > > > @@ -1974,7 +2083,7 @@ > > > if (atts.get("width") == null || > > !isInt(atts.get("width"))) { > > > atts.put("width", width); > > > } > > > - > > > + > > > if (atts.get("height") == null || > > !isInt(atts.get("height"))) { > > > atts.put("height", height); > > > } > > > @@ -2023,10 +2132,11 @@ > > > if (atts.get("width") == null || > > !isInt(atts.get("width"))) { > > > atts.put("width", width); > > > } > > > - > > > + > > > if (atts.get("height") == null || > > !isInt(atts.get("height"))) { > > > atts.put("height", height); > > > } > > > + > > > } > > > } > > > } > > > diff -r 85db7b3a1c93 > > plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java > > > --- a/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java > > Thu Oct 21 21:12:21 2010 +0100 > > > +++ b/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java > > Thu Oct 21 17:22:56 2010 -0700 > > > @@ -126,6 +126,10 @@ > > > } > > > > > > private String getPriorityStrIfPriority(String message) { > > > + > > > + // Destroy messages are permanently high priority > > > + if (message.endsWith("destroy")) > > > + return "destroy"; > > > > > > synchronized (priorityWaitQueue) { > > > Iterator it = priorityWaitQueue.iterator(); > > > @@ -150,7 +154,6 @@ > > > } > > > } > > > > > > - > > > public void notifyWorkerIsFree(PluginMessageHandlerWorker > worker) > > { > > > synchronized (initWorkers) { > > > Iterator i = initWorkers.keySet().iterator(); > > > @@ -176,6 +179,32 @@ > > > } > > > > > > protected class ConsumerThread extends Thread { > > > + > > > + /** > > > + * Scans the readQueue for priority messages and brings them > to > > the front > > > + */ > > > + private void bringPriorityMessagesToFront() { > > > + synchronized (readQueue) { > > > + > > > + // iterate through the list > > > + for (int i=0; i < readQueue.size(); i++) { > > > + > > > + // remove element at i to inspect it > > > + String message = readQueue.remove(i); > > > + > > > + // if element at i is a priority msg, bring it forward > > > + if (getPriorityStrIfPriority(message) != null) { > > > + readQueue.addFirst(message); > > > + } else { // else keep it where it was > > > + readQueue.add(i, message); > > > + } > > > + > > > + // by the end the queue size is the same, so the > > > + // position indicator (i) is still valid > > > + } > > > + } > > > + } > > I believe that splitting it to atleast two queue, one for priority and > one for all other messages would be a bit better performance wise. > Since: > -- getPriorityStrIfPriority(): assume constant > -- Adding to proper queue: constant > -- Checking if queue is empty: constant > -- Reading and deleting message: constant. > Right now, doing N checks for each time we try to read a message would > be a bit more expensive. > > Splitting it up could potentially save us one extra call to > getPriorityStrIfPriority() for each message. > Using an extra queue, let's call it PQ, we can store the priorityStr > into PQ if we determined it is a priority message, this way we don't > need to call getPriorityStrIfPriority() on each message again later. > > > > > + > > > public void run() { > > > > > > while (true) { > > > @@ -190,7 +219,6 @@ > > > > > > String[] msgParts = message.split(" "); > > > > > > - > > > String priorityStr = > > getPriorityStrIfPriority(message); > > > boolean isPriorityResponse = (priorityStr != > > null); > > > > > > @@ -199,9 +227,12 @@ > > > > > > if (worker == null) { > > > synchronized(readQueue) { > > > - readQueue.addLast(message); > > > + readQueue.addFirst(message); > > > } > > > > > > + // re-scan to see if any priority message > came > > in > > > + bringPriorityMessagesToFront(); > > > + > > > continue; // re-loop to try next msg > > > } > > > > > Just the one change to updateStatus. > The extra queue idea gives a minor boost for performance. (This change > is optional, and can go in later if needed) > Everything else looks fine. Okay to commit after the change. > > Cheers, > Andrew From dbhole at redhat.com Fri Oct 22 09:06:24 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Fri, 22 Oct 2010 12:06:24 -0400 Subject: [icedtea-web] RFC: Patch to stabilize applet initialization In-Reply-To: <374199110.1470821287758101430.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> References: <1403420189.1470741287758089389.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> <374199110.1470821287758101430.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <20101022160623.GC7664@redhat.com> * Andrew Su [2010-10-22 10:35]: > > ----- "Deepak Bhole" wrote: > > > From: "Deepak Bhole" > > To: "IcedTea Distro List" > > Sent: Thursday, October 21, 2010 5:41:11 PM GMT -05:00 US/Canada Eastern > > Subject: Re: [icedtea-web] RFC: Patch to stabilize applet initialization > > > > * Deepak Bhole [2010-10-21 17:38]: > > > Hi, > > > > > > The attached patch envelopes fixes for two of Andrew's pending > > patches > > > (fixing 100% CPU load and the frame pop-up issue). In addition to > > those, > > > it fixes a lot of other initialization issues, particularly when > > > initializing multiple applets and/or closing other tabs with > > applets > > > which are being initialized. > > > > > > With this patch, I tested over 200 parallel applet inits, randomly > > > closing tabs, and everything works correctly. > > > > > > One known issue is that if timed correctly, a frame can appear > > outside > > > for a fraction of a second. It always goes away instantly though, > > and I > > > will be posting a patch to fix that problem in the near future. > > > > > > Cheers, > > > Deepak > > > > Please ignore the spacing issues. I will be normalizing all spaces > > for > > all of icedtea-web in another commit after all pending patches are > > in. > > > > Cheers, > > Deepak > > , >>private static synchronized PAV_INIT_STATUS updateStatus(int identifier, PAV_INIT_STATUS newStatus) { >> >> PAV_INIT_STATUS prev = status.get(identifier); >> >> // If the status is set >> if (status.containsKey(identifier)) { >> >> // Nothing may override destroyed status >> if (status.get(identifier).equals(PAV_INIT_STATUS.DESTROYED)) { >> return prev; >> } >> >> // If status is inactive, only DESTROYED may override it >> if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { >> if (!newStatus.equals(PAV_INIT_STATUS.DESTROYED)) { >> return prev; >> } >> } >> } > > Status isn't updated to PAV_INIT_STATUS.DESTROYED. Hmm, what do you mean? It is in the line below.. >> >> // Else set to given status >> status.put(identifier, newStatus); >> >> return prev; >>} > > I believe that splitting it to atleast two queue, one for priority and one for all other messages would be a bit better performance wise. > Since: > -- getPriorityStrIfPriority(): assume constant > -- Adding to proper queue: constant > -- Checking if queue is empty: constant > -- Reading and deleting message: constant. > Right now, doing N checks for each time we try to read a message would be a bit more expensive. > > Splitting it up could potentially save us one extra call to getPriorityStrIfPriority() for each message. > Using an extra queue, let's call it PQ, we can store the priorityStr into PQ if we determined it is a priority message, this way we don't need to call getPriorityStrIfPriority() on each message again later. > I understand and agree with your concern of scanning each message multiple times, I don't like it either. I don't think multiple queues is the way to go though. IMO a better solution is to have readQueue store a structure that stores if a message is priority or not. Let's say 5 messages come in. They require 5 scans with the 2 queue model to do the placement. With a structure-in-queue model, we have: Process each message as non-priority. First 2 messages go away. Then we run bringPriorityMessagesToFront, which scans the remaining 3, and the priority handlers take care of them. The above model becomes inefficient if the queue size is too large. However that is extremely unlikely given that the queue only fills up during multiple-applet init, which is rare. During an average run, queue size is 0-2. What do you think of the above approach? Cheers, Deepak > > > > + > > > public void run() { > > > > > > while (true) { > > > @@ -190,7 +219,6 @@ > > > > > > String[] msgParts = message.split(" "); > > > > > > - > > > String priorityStr = > > getPriorityStrIfPriority(message); > > > boolean isPriorityResponse = (priorityStr != > > null); > > > > > > @@ -199,9 +227,12 @@ > > > > > > if (worker == null) { > > > synchronized(readQueue) { > > > - readQueue.addLast(message); > > > + readQueue.addFirst(message); > > > } > > > > > > + // re-scan to see if any priority message came > > in > > > + bringPriorityMessagesToFront(); > > > + > > > continue; // re-loop to try next msg > > > } > > > > > Just the one change to updateStatus. > The extra queue idea gives a minor boost for performance. (This change is optional, and can go in later if needed) > Everything else looks fine. Okay to commit after the change. > > Cheers, > Andrew From asu at redhat.com Fri Oct 22 09:57:22 2010 From: asu at redhat.com (Andrew Su) Date: Fri, 22 Oct 2010 12:57:22 -0400 (EDT) Subject: [icedtea-web] RFC: Patch to stabilize applet initialization In-Reply-To: <950759643.1494921287765957361.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <13705065.1499471287766642359.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> ----- "Deepak Bhole" wrote: > From: "Deepak Bhole" > To: "Andrew Su" > Cc: "IcedTea Distro List" > Sent: Friday, October 22, 2010 12:06:24 PM GMT -05:00 US/Canada Eastern > Subject: Re: [icedtea-web] RFC: Patch to stabilize applet initialization > > * Andrew Su [2010-10-22 10:35]: > > > > ----- "Deepak Bhole" wrote: > > > > > From: "Deepak Bhole" > > > To: "IcedTea Distro List" > > > Sent: Thursday, October 21, 2010 5:41:11 PM GMT -05:00 US/Canada > Eastern > > > Subject: Re: [icedtea-web] RFC: Patch to stabilize applet > initialization > > > > > > * Deepak Bhole [2010-10-21 17:38]: > > > > Hi, > > > > > > > > The attached patch envelopes fixes for two of Andrew's pending > > > patches > > > > (fixing 100% CPU load and the frame pop-up issue). In addition > to > > > those, > > > > it fixes a lot of other initialization issues, particularly > when > > > > initializing multiple applets and/or closing other tabs with > > > applets > > > > which are being initialized. > > > > > > > > With this patch, I tested over 200 parallel applet inits, > randomly > > > > closing tabs, and everything works correctly. > > > > > > > > One known issue is that if timed correctly, a frame can appear > > > outside > > > > for a fraction of a second. It always goes away instantly > though, > > > and I > > > > will be posting a patch to fix that problem in the near future. > > > > > > > > Cheers, > > > > Deepak > > > > > > Please ignore the spacing issues. I will be normalizing all > spaces > > > for > > > all of icedtea-web in another commit after all pending patches > are > > > in. > > > > > > Cheers, > > > Deepak > > > > > , > > >>private static synchronized PAV_INIT_STATUS updateStatus(int > identifier, PAV_INIT_STATUS newStatus) { > >> > >> PAV_INIT_STATUS prev = status.get(identifier); > >> > >> // If the status is set > >> if (status.containsKey(identifier)) { > >> > >> // Nothing may override destroyed status > >> if > (status.get(identifier).equals(PAV_INIT_STATUS.DESTROYED)) { > >> return prev; > >> } > >> > >> // If status is inactive, only DESTROYED may override it > >> if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) > { > >> if (!newStatus.equals(PAV_INIT_STATUS.DESTROYED)) { > >> return prev; > >> } > >> } > >> } > > > > Status isn't updated to PAV_INIT_STATUS.DESTROYED. > > Hmm, what do you mean? It is in the line below.. I realized, misread the line. :) > > >> > >> // Else set to given status > >> status.put(identifier, newStatus); > >> > >> return prev; > >>} > > > > > > I believe that splitting it to atleast two queue, one for priority > and one for all other messages would be a bit better performance wise. > > > Since: > > -- getPriorityStrIfPriority(): assume constant > > -- Adding to proper queue: constant > > -- Checking if queue is empty: constant > > -- Reading and deleting message: constant. > > Right now, doing N checks for each time we try to read a message > would be a bit more expensive. > > > > Splitting it up could potentially save us one extra call to > getPriorityStrIfPriority() for each message. > > Using an extra queue, let's call it PQ, we can store the priorityStr > into PQ if we determined it is a priority message, this way we don't > need to call getPriorityStrIfPriority() on each message again later. > > > > I understand and agree with your concern of scanning each message > multiple times, I don't like it either. I don't think multiple queues > is > the way to go though. IMO a better solution is to have readQueue store > a > structure that stores if a message is priority or not. > > Let's say 5 messages come in. They require 5 scans with the 2 queue > model to do the placement. > > With a structure-in-queue model, we have: > > Process each message as non-priority. First 2 messages go away. Then > we > run bringPriorityMessagesToFront, which scans the remaining 3, and > the > priority handlers take care of them. > > The above model becomes inefficient if the queue size is too large. > However that is extremely unlikely given that the queue only fills up > during multiple-applet init, which is rare. During an average run, > queue > size is 0-2. > > What do you think of the above approach? > The above method still requires going through the list of messages. As a compromise, I propose that... We keep a structure in readQueue to keep track if it is priority or not. With that implemented we can simply do the check when queuing: Place message to front if priority and append otherwise. This would remove the need to scan the list of messages and removes the need for multiple queue. It'll be sorted already As for the structure used in the queue, it could be simply storing the priorityStr, or null. It's true on average we won't be getting an overwhelming amount of messages, but just to cover all our bases :) So, how about this idea? Cheers, Andrew > Cheers, > Deepak > > > > > > > + > > > > public void run() { > > > > > > > > while (true) { > > > > @@ -190,7 +219,6 @@ > > > > > > > > String[] msgParts = message.split(" "); > > > > > > > > - > > > > String priorityStr = > > > getPriorityStrIfPriority(message); > > > > boolean isPriorityResponse = (priorityStr != > > > null); > > > > > > > > @@ -199,9 +227,12 @@ > > > > > > > > if (worker == null) { > > > > synchronized(readQueue) { > > > > - readQueue.addLast(message); > > > > + readQueue.addFirst(message); > > > > } > > > > > > > > + // re-scan to see if any priority message > came > > > in > > > > + bringPriorityMessagesToFront(); > > > > + > > > > continue; // re-loop to try next msg > > > > } > > > > > > > > Just the one change to updateStatus. > > The extra queue idea gives a minor boost for performance. (This > change is optional, and can go in later if needed) > > Everything else looks fine. Okay to commit after the change. > > > > Cheers, > > Andrew From dbhole at redhat.com Fri Oct 22 11:20:34 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Fri, 22 Oct 2010 14:20:34 -0400 Subject: [icedtea-web] RFC: Patch to stabilize applet initialization In-Reply-To: <13705065.1499471287766642359.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> References: <950759643.1494921287765957361.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> <13705065.1499471287766642359.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <20101022182034.GD7664@redhat.com> * Andrew Su [2010-10-22 12:57]: > > ----- "Deepak Bhole" wrote: > > > From: "Deepak Bhole" > > To: "Andrew Su" > > Cc: "IcedTea Distro List" > > Sent: Friday, October 22, 2010 12:06:24 PM GMT -05:00 US/Canada Eastern > > Subject: Re: [icedtea-web] RFC: Patch to stabilize applet initialization > > > > * Andrew Su [2010-10-22 10:35]: > > > > > > ----- "Deepak Bhole" wrote: > > > > > > > From: "Deepak Bhole" > > > > To: "IcedTea Distro List" > > > > Sent: Thursday, October 21, 2010 5:41:11 PM GMT -05:00 US/Canada > > Eastern > > > > Subject: Re: [icedtea-web] RFC: Patch to stabilize applet > > initialization > > > > > > > > * Deepak Bhole [2010-10-21 17:38]: > > > > > Hi, > > > > > > > > > > The attached patch envelopes fixes for two of Andrew's pending > > > > patches > > > > > (fixing 100% CPU load and the frame pop-up issue). In addition > > to > > > > those, > > > > > it fixes a lot of other initialization issues, particularly > > when > > > > > initializing multiple applets and/or closing other tabs with > > > > applets > > > > > which are being initialized. > > > > > > > > > > With this patch, I tested over 200 parallel applet inits, > > randomly > > > > > closing tabs, and everything works correctly. > > > > > > > > > > One known issue is that if timed correctly, a frame can appear > > > > outside > > > > > for a fraction of a second. It always goes away instantly > > though, > > > > and I > > > > > will be posting a patch to fix that problem in the near future. > > > > > > > > > > Cheers, > > > > > Deepak > > > > > > > > Please ignore the spacing issues. I will be normalizing all > > spaces > > > > for > > > > all of icedtea-web in another commit after all pending patches > > are > > > > in. > > > > > > > > Cheers, > > > > Deepak > > > > > > > > , > > > > >>private static synchronized PAV_INIT_STATUS updateStatus(int > > identifier, PAV_INIT_STATUS newStatus) { > > >> > > >> PAV_INIT_STATUS prev = status.get(identifier); > > >> > > >> // If the status is set > > >> if (status.containsKey(identifier)) { > > >> > > >> // Nothing may override destroyed status > > >> if > > (status.get(identifier).equals(PAV_INIT_STATUS.DESTROYED)) { > > >> return prev; > > >> } > > >> > > >> // If status is inactive, only DESTROYED may override it > > >> if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) > > { > > >> if (!newStatus.equals(PAV_INIT_STATUS.DESTROYED)) { > > >> return prev; > > >> } > > >> } > > >> } > > > > > > Status isn't updated to PAV_INIT_STATUS.DESTROYED. > > > > Hmm, what do you mean? It is in the line below.. > I realized, misread the line. :) > > > > > >> > > >> // Else set to given status > > >> status.put(identifier, newStatus); > > >> > > >> return prev; > > >>} > > > > > > > > > > I believe that splitting it to atleast two queue, one for priority > > and one for all other messages would be a bit better performance wise. > > > > > Since: > > > -- getPriorityStrIfPriority(): assume constant > > > -- Adding to proper queue: constant > > > -- Checking if queue is empty: constant > > > -- Reading and deleting message: constant. > > > Right now, doing N checks for each time we try to read a message > > would be a bit more expensive. > > > > > > Splitting it up could potentially save us one extra call to > > getPriorityStrIfPriority() for each message. > > > Using an extra queue, let's call it PQ, we can store the priorityStr > > into PQ if we determined it is a priority message, this way we don't > > need to call getPriorityStrIfPriority() on each message again later. > > > > > > > I understand and agree with your concern of scanning each message > > multiple times, I don't like it either. I don't think multiple queues > > is > > the way to go though. IMO a better solution is to have readQueue store > > a > > structure that stores if a message is priority or not. > > > > Let's say 5 messages come in. They require 5 scans with the 2 queue > > model to do the placement. > > > > With a structure-in-queue model, we have: > > > > Process each message as non-priority. First 2 messages go away. Then > > we > > run bringPriorityMessagesToFront, which scans the remaining 3, and > > the > > priority handlers take care of them. > > > > The above model becomes inefficient if the queue size is too large. > > However that is extremely unlikely given that the queue only fills up > > during multiple-applet init, which is rare. During an average run, > > queue > > size is 0-2. > > > > What do you think of the above approach? > > > The above method still requires going through the list of messages. As a compromise, I propose that... > We keep a structure in readQueue to keep track if it is priority or not. > With that implemented we can simply do the check when queuing: Place message to front if priority and append otherwise. > Hmm, I think there is some confusion here with the costs involved. Scanning a message is significantly more expensive than scanning the queue. If a message is length 30 (usually a lot more), the cost of scanning that is 30. If a queue is size 5, the cost of scanning that is *30 + 5, + 4 (when one thread finishes and takes an item) + 3 (when next one finishes and takes an item) + .... We cannot not go through the messages themselves. To determine if it is priority, a message _has_ to be scanned. The only difference is do we want to scan each one (multiple-queue approach or sorting approach as you suggested) or only when needed (single queue). Once a message is scanned, we can guarantee that it never scanned again. Thus: Cost with scanning each msg = C1; C1 = totalMsgs*30 Cost of scanning when needed = C2; C2 = queueSize*30 + queueSize + queueSize - 1 + ... => C2 = queueSize*30 + queueSize^2 (for simplicity); Therefore, C2 > C1 if 1+(queueSize^2)/30 > totalMsgs In all observed behavior, queueSize very rarely exceeds 5, and even if it does, it doesn't stay there nearly long enough to catch up with the total cost of scanning each msg. > This would remove the need to scan the list of messages and removes the need for multiple queue. It'll be sorted already > As for the structure used in the queue, it could be simply storing the priorityStr, or null. > I am not sure how this differs from my earlier proposal of a structure that stores whether or not a message in the queue is priority or not.. I was suggesting: readQueue = [, ...] Aren't we thinking the same thing? :) Cheers, Deepak > It's true on average we won't be getting an overwhelming amount of messages, but just to cover all our bases :) > > So, how about this idea? > > Cheers, > Andrew > > > > Cheers, > > Deepak > > > > > > > > > > + > > > > > public void run() { > > > > > > > > > > while (true) { > > > > > @@ -190,7 +219,6 @@ > > > > > > > > > > String[] msgParts = message.split(" "); > > > > > > > > > > - > > > > > String priorityStr = > > > > getPriorityStrIfPriority(message); > > > > > boolean isPriorityResponse = (priorityStr != > > > > null); > > > > > > > > > > @@ -199,9 +227,12 @@ > > > > > > > > > > if (worker == null) { > > > > > synchronized(readQueue) { > > > > > - readQueue.addLast(message); > > > > > + readQueue.addFirst(message); > > > > > } > > > > > > > > > > + // re-scan to see if any priority message > > came > > > > in > > > > > + bringPriorityMessagesToFront(); > > > > > + > > > > > continue; // re-loop to try next msg > > > > > } > > > > > > > > > > > Just the one change to updateStatus. > > > The extra queue idea gives a minor boost for performance. (This > > change is optional, and can go in later if needed) > > > Everything else looks fine. Okay to commit after the change. > > > > > > Cheers, > > > Andrew From asu at redhat.com Fri Oct 22 11:45:01 2010 From: asu at redhat.com (Andrew Su) Date: Fri, 22 Oct 2010 14:45:01 -0400 (EDT) Subject: [icedtea-web] RFC: Patch to stabilize applet initialization In-Reply-To: <1152876736.1514191287772506088.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <2058763242.1515051287773101624.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> ----- "Deepak Bhole" wrote: > From: "Deepak Bhole" > To: "Andrew Su" > Cc: "IcedTea Distro List" > Sent: Friday, October 22, 2010 2:20:34 PM GMT -05:00 US/Canada Eastern > Subject: Re: [icedtea-web] RFC: Patch to stabilize applet initialization > > * Andrew Su [2010-10-22 12:57]: > > > > ----- "Deepak Bhole" wrote: > > > > > From: "Deepak Bhole" > > > To: "Andrew Su" > > > Cc: "IcedTea Distro List" > > > Sent: Friday, October 22, 2010 12:06:24 PM GMT -05:00 US/Canada > Eastern > > > Subject: Re: [icedtea-web] RFC: Patch to stabilize applet > initialization > > > > > > * Andrew Su [2010-10-22 10:35]: > > > > > > > > ----- "Deepak Bhole" wrote: > > > > > > > > > From: "Deepak Bhole" > > > > > To: "IcedTea Distro List" > > > > > Sent: Thursday, October 21, 2010 5:41:11 PM GMT -05:00 > US/Canada > > > Eastern > > > > > Subject: Re: [icedtea-web] RFC: Patch to stabilize applet > > > initialization > > > > > > > > > > * Deepak Bhole [2010-10-21 17:38]: > > > > > > Hi, > > > > > > > > > > > > The attached patch envelopes fixes for two of Andrew's > pending > > > > > patches > > > > > > (fixing 100% CPU load and the frame pop-up issue). In > addition > > > to > > > > > those, > > > > > > it fixes a lot of other initialization issues, particularly > > > when > > > > > > initializing multiple applets and/or closing other tabs > with > > > > > applets > > > > > > which are being initialized. > > > > > > > > > > > > With this patch, I tested over 200 parallel applet inits, > > > randomly > > > > > > closing tabs, and everything works correctly. > > > > > > > > > > > > One known issue is that if timed correctly, a frame can > appear > > > > > outside > > > > > > for a fraction of a second. It always goes away instantly > > > though, > > > > > and I > > > > > > will be posting a patch to fix that problem in the near > future. > > > > > > > > > > > > Cheers, > > > > > > Deepak > > > > > > > > > > Please ignore the spacing issues. I will be normalizing all > > > spaces > > > > > for > > > > > all of icedtea-web in another commit after all pending > patches > > > are > > > > > in. > > > > > > > > > > Cheers, > > > > > Deepak > > > > > > > > > > > , > > > > > > >>private static synchronized PAV_INIT_STATUS updateStatus(int > > > identifier, PAV_INIT_STATUS newStatus) { > > > >> > > > >> PAV_INIT_STATUS prev = status.get(identifier); > > > >> > > > >> // If the status is set > > > >> if (status.containsKey(identifier)) { > > > >> > > > >> // Nothing may override destroyed status > > > >> if > > > (status.get(identifier).equals(PAV_INIT_STATUS.DESTROYED)) { > > > >> return prev; > > > >> } > > > >> > > > >> // If status is inactive, only DESTROYED may override > it > > > >> if > (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) > > > { > > > >> if (!newStatus.equals(PAV_INIT_STATUS.DESTROYED)) { > > > >> return prev; > > > >> } > > > >> } > > > >> } > > > > > > > > Status isn't updated to PAV_INIT_STATUS.DESTROYED. > > > > > > Hmm, what do you mean? It is in the line below.. > > I realized, misread the line. :) > > > > > > > > >> > > > >> // Else set to given status > > > >> status.put(identifier, newStatus); > > > >> > > > >> return prev; > > > >>} > > > > > > > > > > > > > > I believe that splitting it to atleast two queue, one for > priority > > > and one for all other messages would be a bit better performance > wise. > > > > > > > Since: > > > > -- getPriorityStrIfPriority(): assume constant > > > > -- Adding to proper queue: constant > > > > -- Checking if queue is empty: constant > > > > -- Reading and deleting message: constant. > > > > Right now, doing N checks for each time we try to read a > message > > > would be a bit more expensive. > > > > > > > > Splitting it up could potentially save us one extra call to > > > getPriorityStrIfPriority() for each message. > > > > Using an extra queue, let's call it PQ, we can store the > priorityStr > > > into PQ if we determined it is a priority message, this way we > don't > > > need to call getPriorityStrIfPriority() on each message again > later. > > > > > > > > > > I understand and agree with your concern of scanning each message > > > multiple times, I don't like it either. I don't think multiple > queues > > > is > > > the way to go though. IMO a better solution is to have readQueue > store > > > a > > > structure that stores if a message is priority or not. > > > > > > Let's say 5 messages come in. They require 5 scans with the 2 > queue > > > model to do the placement. > > > > > > With a structure-in-queue model, we have: > > > > > > Process each message as non-priority. First 2 messages go away. > Then > > > we > > > run bringPriorityMessagesToFront, which scans the remaining 3, > and > > > the > > > priority handlers take care of them. > > > > > > The above model becomes inefficient if the queue size is too > large. > > > However that is extremely unlikely given that the queue only fills > up > > > during multiple-applet init, which is rare. During an average > run, > > > queue > > > size is 0-2. > > > > > > What do you think of the above approach? > > > > > The above method still requires going through the list of messages. > As a compromise, I propose that... > > We keep a structure in readQueue to keep track if it is priority or > not. > > With that implemented we can simply do the check when queuing: Place > message to front if priority and append otherwise. > > > > Hmm, I think there is some confusion here with the costs involved. > Scanning a message is significantly more expensive than scanning the > queue. If a message is length 30 (usually a lot more), the cost of > scanning that is 30. If a queue is size 5, the cost of scanning that > is > *30 + 5, + 4 (when one thread finishes and > takes an item) + 3 (when next one finishes and takes an item) + .... > > We cannot not go through the messages themselves. To determine if it > is > priority, a message _has_ to be scanned. The only difference is do we > want to scan each one (multiple-queue approach or > sorting approach as you suggested) or only when needed (single > queue). Agreed, all the messages must be scanned at least once, and ideally only once (Which is what we're trying to do). But as long as one of the above mentioned methods are implements, I'd give it a thumbs up. > > Once a message is scanned, we can guarantee that it never scanned > again. Thus: > > Cost with scanning each msg = C1; > C1 = totalMsgs*30 > > Cost of scanning when needed = C2; > C2 = queueSize*30 + queueSize + queueSize - 1 + ... > => C2 = queueSize*30 + queueSize^2 (for simplicity); > > Therefore, > C2 > C1 if 1+(queueSize^2)/30 > totalMsgs > > In all observed behavior, queueSize very rarely exceeds 5, and even > if > it does, it doesn't stay there nearly long enough to catch up with > the > total cost of scanning each msg. > > > This would remove the need to scan the list of messages and removes > the need for multiple queue. It'll be sorted already > > As for the structure used in the queue, it could be simply storing > the priorityStr, or null. > > > > I am not sure how this differs from my earlier proposal of a > structure > that stores whether or not a message in the queue is priority or not.. > I > was suggesting: > > readQueue = [, ...] > > Aren't we thinking the same thing? :) If you meant isPriority as the String returned by getPriorityStrIfPriority() then, yes exactly the same! Cheers, Andrew > > Cheers, > Deepak > > > It's true on average we won't be getting an overwhelming amount of > messages, but just to cover all our bases :) > > > > So, how about this idea? > > > > Cheers, > > Andrew > > > > > > > Cheers, > > > Deepak > > > > > > > > > > > > > + > > > > > > public void run() { > > > > > > > > > > > > while (true) { > > > > > > @@ -190,7 +219,6 @@ > > > > > > > > > > > > String[] msgParts = message.split(" "); > > > > > > > > > > > > - > > > > > > String priorityStr = > > > > > getPriorityStrIfPriority(message); > > > > > > boolean isPriorityResponse = (priorityStr > != > > > > > null); > > > > > > > > > > > > @@ -199,9 +227,12 @@ > > > > > > > > > > > > if (worker == null) { > > > > > > synchronized(readQueue) { > > > > > > - readQueue.addLast(message); > > > > > > + readQueue.addFirst(message); > > > > > > } > > > > > > > > > > > > + // re-scan to see if any priority > message > > > came > > > > > in > > > > > > + bringPriorityMessagesToFront(); > > > > > > + > > > > > > continue; // re-loop to try next msg > > > > > > } > > > > > > > > > > > > > > Just the one change to updateStatus. > > > > The extra queue idea gives a minor boost for performance. (This > > > change is optional, and can go in later if needed) > > > > Everything else looks fine. Okay to commit after the change. > > > > > > > > Cheers, > > > > Andrew From dbhole at redhat.com Fri Oct 22 12:46:25 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Fri, 22 Oct 2010 15:46:25 -0400 Subject: [icedtea-web] RFC: Patch to stabilize applet initialization In-Reply-To: <20101022152744.GA7664@redhat.com> References: <20101021213816.GF26975@redhat.com> <20101021215240.GD25601@rivendell.middle-earth.co.uk> <20101022152744.GA7664@redhat.com> Message-ID: <20101022194624.GF7664@redhat.com> * Deepak Bhole [2010-10-22 11:28]: > * Dr Andrew John Hughes [2010-10-21 17:52]: > > On 17:38 Thu 21 Oct , Deepak Bhole wrote: > > > Hi, > > > > > > The attached patch envelopes fixes for two of Andrew's pending patches > > > (fixing 100% CPU load and the frame pop-up issue). In addition to those, > > > it fixes a lot of other initialization issues, particularly when > > > initializing multiple applets and/or closing other tabs with applets > > > which are being initialized. > > > > > > With this patch, I tested over 200 parallel applet inits, randomly > > > closing tabs, and everything works correctly. > > > > > > One known issue is that if timed correctly, a frame can appear outside > > > for a fraction of a second. It always goes away instantly though, and I > > > will be posting a patch to fix that problem in the near future. > > > > > > Cheers, > > > Deepak > > > > Do you have a ChangeLog for this? It would be good to know why each change > > is being made. > > Sorry, forgot the ChangeLog: 2010-10-22 Deepak Bhole * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: Replace all status.put calls with calls to updateStatus(). (createPanel): Create a frame with a 0 handle. Use the new waitForAppletInit function to wait until applet is ready. (reFrame): Re-order code so that the panel is never parentless. (handleMessage): Re-wrote message processing to handle destroy calls correctly, checking for them more often to prevent a frame from popping up if the tab/page is closed before loading finishes. Decode special characters in the message. (updateStatus): New function. Updates the status for the given instance if applicable. (destroyApplet): New function. Destroys a given applet and frees related resources. (waitForAppletInit): New function. Blocks until applet is initialized. (parse): Remove part that decoded the params. Decoding is now done earlier in handleMessage(). * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java: (getPriorityStrIfPriority): Mark destroy messages as priority. (bringPriorityMessagesToFront): Scans the queue for priority messages and brings them to the front. (run): If the queue is not empty and there are no workers left, run bringPriorityMessagesToFront() and retry. > > In particular, why: > > > > > + > > > + // Add first, remove later > > > + newFrame.add("Center", panel); > > > oldFrame.remove(panel); > > > oldFrame.dispose(); > > > + } else { > > > + newFrame.add("Center", panel); > > > } > > > > > > - newFrame.add("Center", panel); > > > > is this necessary? > > > > As crazy as that looks, yes. here is the full piece of the code: > > PluginAppletViewer newFrame = new PluginAppletViewer(handle, identifier, statusMsgStream, panel); > > if (oldFrame != null) { > applets.remove(oldFrame.identifier); > oldFrame.removeWindowListener(oldFrame.windowEventListener); > panel.removeAppletListener(oldFrame.appletEventListener); > > // Add first, remove later > newFrame.add("Center", panel); > oldFrame.remove(panel); > oldFrame.dispose(); > } else { > newFrame.add("Center", panel); > } > > oldFrame is an embedded frame in which an applet instance resides, newFrame is > another embedded frame with a different handle that it needs to be moved to. In > addition to being implanted in oldFrame, oldFrame is also registered as a > listener for a few things. We first need to unregister those listeners. We then > need to add it to the newFrame right away, as there are problems if the panel > does not have a parent. Hence the add being done in the if loop. > > There is a second case where there may be no previous parent frame at all > (initial embedding) -- in this case, we need to do the add() in the else > otherwise it will get added twice. > > The change I alluded to in the original email (to fix the pop-out frame > completely) will get rid of the above if/else condition btw, so it is only > temporary. > > Cheers, > Deepak > > > Also there seems to be some odd whitespace changes and excessive (8 space) indenting. > > > > > diff -r 85db7b3a1c93 plugin/icedteanp/java/sun/applet/PluginAppletViewer.java > > > --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Thu Oct 21 21:12:21 2010 +0100 > > > +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Thu Oct 21 17:22:56 2010 -0700 > > > @@ -136,12 +136,10 @@ > > > } > > > } > > > }); > > > + > > > + // create the frame. > > > + PluginAppletViewer.reFrame(null, identifier, System.out, 0, panel); > > > > > > - > > > - > > > - // create the frame. > > > - PluginAppletViewer.reFrame(null, identifier, System.out, handle, panel); > > > - > > > panel.init(); > > > > > > // Start the applet > > > @@ -179,15 +177,7 @@ > > > > > > // Wait for the panel to initialize > > > // (happens in a separate thread) > > > - while (panel.getApplet() == null && > > > - ((NetxPanel) panel).isAlive()) { > > > - try { > > > - Thread.sleep(50); > > > - PluginDebug.debug("Waiting for applet to initialize..."); > > > - } catch (InterruptedException ie) { > > > - // just wait > > > - } > > > - } > > > + PluginAppletViewer.waitForAppletInit((NetxPanel) panel); > > > > > > a = panel.getApplet(); > > > > > > @@ -317,7 +307,17 @@ > > > */ > > > private static String defaultSaveFile = "Applet.ser"; > > > > > > - private static enum PAV_INIT_STATUS {PRE_INIT, IN_INIT, INIT_COMPLETE, INACTIVE}; > > > + > > > + /** > > > + * Enumerates the current status of an applet > > > + * > > > + * PRE_INIT -> Parsing and initialization phase > > > + * INIT_COMPLETE -> Initialization complete, reframe pending > > > + * REFRAME_COMPLETE -> Reframe complete, applet is initialized and usable by the user > > > + * INACTIVE -> Browser has directed that the applet be destroyed (this state is non-overridable except by DESTROYED) > > > + * DESTROYED -> Applet has been destroyed > > > + */ > > > + private static enum PAV_INIT_STATUS {PRE_INIT, INIT_COMPLETE, REFRAME_COMPLETE, INACTIVE, DESTROYED}; > > > > > > /** > > > * The panel in which the applet is being displayed. > > > @@ -350,7 +350,6 @@ > > > > > > private static HashMap status = > > > new HashMap(); > > > - > > > > > > private long handle = 0; > > > private WindowListener windowEventListener = null; > > > @@ -380,16 +379,20 @@ > > > return; > > > > > > PluginAppletViewer newFrame = new PluginAppletViewer(handle, identifier, statusMsgStream, panel); > > > - > > > + > > > if (oldFrame != null) { > > > applets.remove(oldFrame.identifier); > > > oldFrame.removeWindowListener(oldFrame.windowEventListener); > > > panel.removeAppletListener(oldFrame.appletEventListener); > > > + > > > + // Add first, remove later > > > + newFrame.add("Center", panel); > > > oldFrame.remove(panel); > > > oldFrame.dispose(); > > > + } else { > > > + newFrame.add("Center", panel); > > > } > > > > > > - newFrame.add("Center", panel); > > > newFrame.pack(); > > > > > > newFrame.appletEventListener = new AppletEventListener(newFrame, newFrame); > > > @@ -397,11 +400,6 @@ > > > > > > applets.put(identifier, newFrame); > > > > > > - // dispose oldframe if necessary > > > - if (oldFrame != null) { > > > - oldFrame.dispose(); > > > - } > > > - > > > PluginDebug.debug(panel + " reframed"); > > > } > > > > > > @@ -449,7 +447,7 @@ > > > this.frame = frame; > > > this.appletViewer = appletViewer; > > > } > > > - > > > + > > > public void appletStateChanged(AppletEvent evt) > > > { > > > AppletPanel src = (AppletPanel)evt.getSource(); > > > @@ -483,9 +481,9 @@ > > > AppletPanel.changeFrameAppContext(frame, SunToolkit.targetToAppContext(a)); > > > else > > > AppletPanel.changeFrameAppContext(frame, AppContext.getAppContext()); > > > - > > > - status.put(appletViewer.identifier, PAV_INIT_STATUS.INIT_COMPLETE); > > > - > > > + > > > + updateStatus(appletViewer.identifier, PAV_INIT_STATUS.INIT_COMPLETE); > > > + > > > break; > > > } > > > } > > > @@ -510,7 +508,13 @@ > > > > > > try { > > > if (message.startsWith("handle")) { > > > - > > > + > > > + // If there is a key for this status, it means it > > > + // was either initialized before, or destroy has been > > > + // processed. Stop moving further. > > > + if (updateStatus(identifier, PAV_INIT_STATUS.PRE_INIT) != null) > > > + return; > > > + > > > // Extract the information from the message > > > String[] msgParts = new String[4]; > > > for (int i=0; i < 3; i++) { > > > @@ -519,32 +523,38 @@ > > > msgParts[i] = message.substring(spaceLocation + 1, nextSpaceLocation); > > > message = message.substring(nextSpaceLocation + 1); > > > } > > > - > > > + > > > long handle = Long.parseLong(msgParts[0]); > > > String width = msgParts[1]; > > > String height = msgParts[2]; > > > - > > > + > > > int spaceLocation = message.indexOf(' ', "tag".length()+1); > > > String documentBase = > > > UrlUtil.decode(message.substring("tag".length() + 1, spaceLocation)); > > > - String tag = message.substring(spaceLocation+1); > > > + String tag = message.substring(spaceLocation+1); > > > + > > > + // Decode the tag > > > + tag = tag.replace(">", ">"); > > > + tag = tag.replace("<", "<"); > > > + tag = tag.replace("&", "&"); > > > + tag = tag.replace(" ", "\n"); > > > + tag = tag.replace(" ", "\r"); > > > + tag = tag.replace(""", "\""); > > > > > > PluginDebug.debug ("Handle = " + handle + "\n" + > > > "Width = " + width + "\n" + > > > "Height = " + height + "\n" + > > > "DocumentBase = " + documentBase + "\n" + > > > "Tag = " + tag); > > > - > > > - status.put(identifier, PAV_INIT_STATUS.PRE_INIT); > > > + > > > PluginAppletViewer.parse > > > (identifier, handle, width, height, > > > new StringReader(tag), > > > new URL(documentBase)); > > > - > > > > > > int maxWait = APPLET_TIMEOUT; // wait for applet to fully load > > > int wait = 0; > > > - while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && > > > + while ( !applets.containsKey(identifier) && // Map is populated only by reFrame > > > (wait < maxWait)) { > > > > > > try { > > > @@ -555,9 +565,44 @@ > > > } > > > } > > > > > > - if (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE)) > > > + // If wait exceeded maxWait, we timed out. Throw an exception > > > + if (wait >= maxWait) > > > throw new Exception("Applet initialization timeout"); > > > > > > + PluginAppletViewer oldFrame = applets.get(identifier); > > > + > > > + // We should not try to destroy an applet during > > > + // initialization. It may cause an inconsistent state, > > > + // which would bad if it's a trusted applet that > > > + // read/writes to files > > > + waitForAppletInit((NetxPanel) applets.get(identifier).panel); > > > + > > > + // Should we proceed with reframing? > > > + if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { > > > + destroyApplet(identifier); > > > + return; > > > + } > > > + > > > + // Proceed with re-framing > > > + reFrame(oldFrame, identifier, System.out, handle, oldFrame.panel); > > > + > > > + // There is a slight chance that destroy can happen > > > + // between the above and below line > > > + if (updateStatus(identifier, PAV_INIT_STATUS.REFRAME_COMPLETE).equals(PAV_INIT_STATUS.INACTIVE)) { > > > + destroyApplet(identifier); > > > + } > > > + > > > + } else if (message.startsWith("destroy")) { > > > + > > > + // Set it inactive, and try to do cleanup is applicable > > > + PAV_INIT_STATUS previousStatus = updateStatus(identifier, PAV_INIT_STATUS.INACTIVE); > > > + PluginDebug.debug("Destroy status set for " + identifier); > > > + > > > + if (previousStatus != null && > > > + previousStatus.equals(PAV_INIT_STATUS.REFRAME_COMPLETE)) { > > > + destroyApplet(identifier); > > > + } > > > + > > > } else { > > > PluginDebug.debug ("Handling message: " + message + " instance " + identifier + " " + Thread.currentThread()); > > > > > > @@ -568,7 +613,7 @@ > > > status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT) > > > ) > > > ); > > > - > > > + > > > // don't bother processing further for inactive applets > > > if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) > > > return; > > > @@ -580,31 +625,131 @@ > > > e.printStackTrace(); > > > > > > // If an exception happened during pre-init, we need to update status > > > - if (status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT)) > > > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > > > + updateStatus(identifier, PAV_INIT_STATUS.INACTIVE); > > > > > > throw new RuntimeException("Failed to handle message: " + > > > message + " for instance " + identifier, e); > > > } > > > } > > > - > > > + > > > + /** > > > + * Sets the status unless an overriding status is set (e.g. if > > > + * status is DESTROYED, it may not be overridden). > > > + * > > > + * @param identifier The identifier for which the status is to be set > > > + * @param status The status to switch to > > > + * @return The previous status > > > + */ > > > + private static synchronized PAV_INIT_STATUS updateStatus(int identifier, PAV_INIT_STATUS newStatus) { > > > + > > > + PAV_INIT_STATUS prev = status.get(identifier); > > > + > > > + // If the status is set > > > + if (status.containsKey(identifier)) { > > > + > > > + // Nothing may override destroyed status > > > + if (status.get(identifier).equals(PAV_INIT_STATUS.DESTROYED)) { > > > + return prev; > > > + } > > > + > > > + // If status is inactive, only DESTROYED may override it > > > + if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { > > > + if (!newStatus.equals(PAV_INIT_STATUS.DESTROYED)) { > > > + return prev; > > > + } > > > + } > > > + } > > > + > > > + // Else set to given status > > > + status.put(identifier, newStatus); > > > + > > > + return prev; > > > + } > > > + > > > + /** > > > + * Destroys the given applet instance. > > > + * > > > + * This function may be called multiple times without problems. > > > + * It does a synchronized check on the status and will only > > > + * attempt to destroy the applet if not previously destroyed. > > > + * > > > + * @param identifier The instance which is to be destroyed > > > + */ > > > + > > > + private static synchronized void destroyApplet(int identifier) { > > > + > > > + PluginDebug.debug("DestroyApplet called for " + identifier); > > > + > > > + PAV_INIT_STATUS prev = updateStatus(identifier, PAV_INIT_STATUS.DESTROYED); > > > + > > > + // If already destroyed, return > > > + if (prev.equals(PAV_INIT_STATUS.DESTROYED)) { > > > + PluginDebug.debug(identifier + " already destroyed. Returning."); > > > + return; > > > + } > > > + > > > + // If already disposed, return > > > + if (applets.get(identifier).panel.applet == null) { > > > + // Try to still dispose the panel itself -- no harm done with double dispose > > > + applets.get(identifier).dispose(); > > > + > > > + PluginDebug.debug(identifier + " inactive. Returning."); > > > + return; > > > + } > > > + > > > + PluginDebug.debug("Attempting to destroy " + identifier); > > > + > > > + final int fIdentifier = identifier; > > > + SwingUtilities.invokeLater(new Runnable() { > > > + public void run() { > > > + applets.get(fIdentifier).appletClose(); > > > + } > > > + }); > > > + > > > + PluginDebug.debug(identifier + " destroyed"); > > > + } > > > + > > > + /** > > > + * Function to block until applet initialization is complete > > > + * > > > + * @param identifier The instance to wait for > > > + */ > > > + public static void waitForAppletInit(NetxPanel panel) { > > > + > > > + int waitTime = 0; > > > + > > > + // Wait till initialization finishes > > > + while (panel.getApplet() == null && > > > + panel.isAlive() && > > > + waitTime < APPLET_TIMEOUT) { > > > + try { > > > + if (waitTime%500 == 0) > > > + PluginDebug.debug("Waiting for applet panel " + panel + " to initialize..."); > > > + > > > + Thread.sleep(waitTime += 50); > > > + } catch (InterruptedException ie) { > > > + // just wait > > > + } > > > + } > > > + > > > + PluginDebug.debug("Applet panel " + panel + " initialized"); > > > + } > > > + > > > public void handleMessage(int reference, String message) > > > { > > > if (message.startsWith("width")) { > > > > > > // Wait for panel to come alive > > > int maxWait = APPLET_TIMEOUT; // wait for panel to come alive > > > - int wait = 0; > > > + int wait = 0; > > > while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && wait < maxWait) { > > > - > > > - try { > > > - Thread.sleep(50); > > > - wait += 50; > > > - } catch (InterruptedException ie) { > > > - // just wait > > > - } > > > - } > > > - > > > + try { > > > + Thread.sleep(50); > > > + wait += 50; > > > + } catch (InterruptedException ie) { > > > + // just wait > > > + } > > > + } > > > > > > // 0 => width, 1=> width_value, 2 => height, 3=> height_value > > > String[] dimMsg = message.split(" "); > > > @@ -636,7 +781,7 @@ > > > > > > panel.setSize(width, height); > > > panel.validate(); > > > - > > > + > > > panel.applet.resize(width, height); > > > panel.applet.validate(); > > > } > > > @@ -649,9 +794,6 @@ > > > e.printStackTrace(); > > > } > > > > > > - } else if (message.startsWith("destroy")) { > > > - dispose(); > > > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > > > } else if (message.startsWith("GetJavaObject")) { > > > > > > // FIXME: how do we determine what security context this > > > @@ -672,15 +814,7 @@ > > > > > > // Wait for the panel to initialize > > > // (happens in a separate thread) > > > - while (panel.getApplet() == null && > > > - ((NetxPanel) panel).isAlive()) { > > > - try { > > > - Thread.sleep(50); > > > - PluginDebug.debug("Waiting for applet to initialize..."); > > > - } catch (InterruptedException ie) { > > > - // just wait > > > - } > > > - } > > > + waitForAppletInit((NetxPanel) panel); > > > > > > PluginDebug.debug(panel + " -- " + panel.getApplet() + " -- " + ((NetxPanel) panel).isAlive()); > > > > > > @@ -1548,10 +1682,11 @@ > > > if (countApplets() == 0) { > > > appletSystemExit(); > > > } > > > + > > > + updateStatus(identifier, PAV_INIT_STATUS.DESTROYED); > > > } > > > }).start(); > > > > > > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > > > } > > > > > > /** > > > @@ -1677,18 +1812,6 @@ > > > val = buf.toString(); > > > } > > > > > > - att = att.replace(">", ">"); > > > - att = att.replace("<", "<"); > > > - att = att.replace("&", "&"); > > > - att = att.replace(" ", "\n"); > > > - att = att.replace(" ", "\r"); > > > - > > > - val = val.replace(">", ">"); > > > - val = val.replace("<", "<"); > > > - val = val.replace("&", "&"); > > > - val = val.replace(" ", "\n"); > > > - val = val.replace(" ", "\r"); > > > - > > > PluginDebug.debug("PUT " + att + " = '" + val + "'"); > > > atts.put(att.toLowerCase(java.util.Locale.ENGLISH), val); > > > > > > @@ -1708,7 +1831,6 @@ > > > // private static final == inline > > > private static final boolean isInt(Object o) { > > > boolean isInt = false; > > > - > > > try { > > > Integer.parseInt((String) o); > > > isInt = true; > > > @@ -1763,7 +1885,6 @@ > > > } catch (IOException ioe) { > > > return ioe; > > > } > > > - > > > return null; > > > } > > > }; > > > @@ -1785,6 +1906,7 @@ > > > boolean isObjectTag = false; > > > boolean isEmbedTag = false; > > > boolean objectTagAlreadyParsed = false; > > > + > > > // The current character > > > // FIXME: This is an evil hack to force pass-by-reference.. the > > > // parsing code needs to be rewritten from scratch to prevent such > > > @@ -1879,19 +2001,6 @@ > > > if (val == null) { > > > statusMsgStream.println(requiresNameWarning); > > > } else if (atts != null) { > > > - att = att.replace(">", ">"); > > > - att = att.replace("<", "<"); > > > - att = att.replace("&", "&"); > > > - att = att.replace(" ", "\n"); > > > - att = att.replace(" ", "\r"); > > > - att = att.replace(""", "\""); > > > - > > > - val = val.replace(">", ">"); > > > - val = val.replace("<", "<"); > > > - val = val.replace("&", "&"); > > > - val = val.replace(" ", "\n"); > > > - val = val.replace(" ", "\r"); > > > - val = val.replace(""", "\""); > > > PluginDebug.debug("PUT " + att + " = " + val); > > > atts.put(att.toLowerCase(), val); > > > } else { > > > @@ -1920,8 +2029,8 @@ > > > > > > if (atts.get("width") == null || !isInt(atts.get("width"))) { > > > atts.put("width", width); > > > - } > > > - > > > + } > > > + > > > if (atts.get("height") == null || !isInt(atts.get("height"))) { > > > atts.put("height", height); > > > } > > > @@ -1974,7 +2083,7 @@ > > > if (atts.get("width") == null || !isInt(atts.get("width"))) { > > > atts.put("width", width); > > > } > > > - > > > + > > > if (atts.get("height") == null || !isInt(atts.get("height"))) { > > > atts.put("height", height); > > > } > > > @@ -2023,10 +2132,11 @@ > > > if (atts.get("width") == null || !isInt(atts.get("width"))) { > > > atts.put("width", width); > > > } > > > - > > > + > > > if (atts.get("height") == null || !isInt(atts.get("height"))) { > > > atts.put("height", height); > > > } > > > + > > > } > > > } > > > } > > > diff -r 85db7b3a1c93 plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java > > > --- a/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java Thu Oct 21 21:12:21 2010 +0100 > > > +++ b/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java Thu Oct 21 17:22:56 2010 -0700 > > > @@ -126,6 +126,10 @@ > > > } > > > > > > private String getPriorityStrIfPriority(String message) { > > > + > > > + // Destroy messages are permanently high priority > > > + if (message.endsWith("destroy")) > > > + return "destroy"; > > > > > > synchronized (priorityWaitQueue) { > > > Iterator it = priorityWaitQueue.iterator(); > > > @@ -150,7 +154,6 @@ > > > } > > > } > > > > > > - > > > public void notifyWorkerIsFree(PluginMessageHandlerWorker worker) { > > > synchronized (initWorkers) { > > > Iterator i = initWorkers.keySet().iterator(); > > > @@ -176,6 +179,32 @@ > > > } > > > > > > protected class ConsumerThread extends Thread { > > > + > > > + /** > > > + * Scans the readQueue for priority messages and brings them to the front > > > + */ > > > + private void bringPriorityMessagesToFront() { > > > + synchronized (readQueue) { > > > + > > > + // iterate through the list > > > + for (int i=0; i < readQueue.size(); i++) { > > > + > > > + // remove element at i to inspect it > > > + String message = readQueue.remove(i); > > > + > > > + // if element at i is a priority msg, bring it forward > > > + if (getPriorityStrIfPriority(message) != null) { > > > + readQueue.addFirst(message); > > > + } else { // else keep it where it was > > > + readQueue.add(i, message); > > > + } > > > + > > > + // by the end the queue size is the same, so the > > > + // position indicator (i) is still valid > > > + } > > > + } > > > + } > > > + > > > public void run() { > > > > > > while (true) { > > > @@ -190,7 +219,6 @@ > > > > > > String[] msgParts = message.split(" "); > > > > > > - > > > String priorityStr = getPriorityStrIfPriority(message); > > > boolean isPriorityResponse = (priorityStr != null); > > > > > > @@ -199,9 +227,12 @@ > > > > > > if (worker == null) { > > > synchronized(readQueue) { > > > - readQueue.addLast(message); > > > + readQueue.addFirst(message); > > > } > > > > > > + // re-scan to see if any priority message came in > > > + bringPriorityMessagesToFront(); > > > + > > > continue; // re-loop to try next msg > > > } > > > > > > > > > -- > > Andrew :) > > > > Free Java Software Engineer > > Red Hat, Inc. (http://www.redhat.com) > > > > Support Free Java! > > Contribute to GNU Classpath and the OpenJDK > > http://www.gnu.org/software/classpath > > http://openjdk.java.net > > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From liuqi at loongson.cn Sat Oct 23 02:49:00 2010 From: liuqi at loongson.cn (LIU Qi) Date: Sat, 23 Oct 2010 17:49:00 +0800 Subject: openjdk6-mips port added to icedtea server In-Reply-To: <1287738763.2755.50.camel@springer.wildebeest.org> References: <1287738763.2755.50.camel@springer.wildebeest.org> Message-ID: <20101023094900.GA9736@loongson.cn> On Fri, Oct 22, 2010 at 11:12:43AM +0200, Mark Wielaard wrote: > Hi, > > LIU Qi asked if the openjdk6-mips port for Longsoon they have been > hacking on could be hosted on the icedtea server so it could be shared > with a wider audience. So it has been added: > http://icedtea.classpath.org/hg/openjdk6-mips/ Thank Mark on helping us. We will use the facilities provided by icedtea to develop the openjdk mips port. Here is the summary: hg reps. : http://icedtea.classpath.org/hg/openjdk6-mips/ bugzilla : http://icedtea.classpath.org/bugzilla/ mailing list: http://mail.openjdk.java.net/mailman/listinfo/distro-pkg-dev wiki: http://icedtea.classpath.org/wiki/MIPSPort > > All new code has been contributed under the GPL by Lemote, Inc. > Currently only the original mips port hackers can push new commits to it > so they can decide how to evolve the code. Please discuss on the > porters-dev mailinglist and with LIU Qi if you would like to contribute > patches and/or have ideas for how the repository should be setup (it > contains a full openjdk6 forest in a single repository atm). The codes will be contributed under the GPL by Loongson and Lemote, Inc and mainly by Loongson Company. Our team are from Loongson Co. Ltd. > > Any commits pushed to the repository should also send an email to the > icedtea and porters-dev mailinglist (Dalibor might have to approve them > first before they appear on the porters-dev list). As Dalibor suggested, we will only discuss and mail the commit information to the of mailing list icedtea. > > The new hackers should also have gotten wiki accounts through email. > Please login and add a page http://icedtea.classpath.org/wiki/MIPSPort > to describe the current status of the port, how to build it and any > hacking rules you want to follow for the repository. We will write something in that page ASAP. Thanks again for the help from Mark. Regards, Qi -- LIU Qi liuqi at loongson.cn liuqi82 at gmail.com Loongson Technology Co. Ltd. PGP Key fingerprint: 3D29 FDFD AFB3 225D B744 7FAB 51C7 4820 63BA 272F From pcpa at mandriva.com.br Sat Oct 23 13:51:38 2010 From: pcpa at mandriva.com.br (Paulo =?iso-8859-1?Q?C=E9sar_Pereira_de_Andrade?=) Date: Sat, 23 Oct 2010 18:51:38 -0200 Subject: openjdk6-mips port added to icedtea server In-Reply-To: <20101023094900.GA9736@loongson.cn> References: <1287738763.2755.50.camel@springer.wildebeest.org> <20101023094900.GA9736@loongson.cn> Message-ID: <504d12434baafd10854ffdc5aef06f7e.squirrel@webmail.mandriva.com.br> LIU Qi wrote: > On Fri, Oct 22, 2010 at 11:12:43AM +0200, Mark Wielaard wrote: > > Hi, > > > > LIU Qi asked if the openjdk6-mips port for Longsoon they have been > > hacking on could be hosted on the icedtea server so it could be shared > > with a wider audience. So it has been added: > > http://icedtea.classpath.org/hg/openjdk6-mips/ Hi, Sorry for hijacking the thread, but I started recently adding support for mips in my fork of the lightning jit generator, at http://github.com/pcpa/lightning This is done as a personal project (no companies of official projects involved, I use lightning for jit in a language I am writing...), as I have access to an older gdium sample; I also wrote a very good share of the Xorg siliconmotion driver for smi 501/502 like 2 years ago, also for the gdium. Any pointers on these would be useful: o How to pass float and double arguments so that they would work if calling a prototyped or not prototyped function; floats are ok if working only with prototyped functions My current guess, before working on it again, and writing some basic tests with gcc calling a jit function and then inspecting registers is that: a0+a1 first double a2+a3 second double f12 first float f13 second float f14 third float f15 fourth float o Pointers to download of images (for godson/loongson) of a system with gcc and binutils devel, running either 64 bits mode, big endian mode or another abi are also welcome, so that I can test all alternatives before considering it done o How to detect cpu features, preferably without causing signals/traps, because I use attribute constructor on a function, but currently only functional for x86. What is desirable to detect is if, or which mips32 release 2 opcodes are implemented, or which mips32 opcodes are missing (in the mips manual, it says movf and movt are mips32 but are not implemented in my sample for example) o This one is kinda funny, as I am working on generating code, I am still not very familiar with the actual assembler syntax, so, what would be the proper __asm__ __volatile__ to flush the code cache of a buffer recently written? (I am making a call to _cache_flush on linux, and just mprotect otherwise, but it may require a different approach on other system). > Thanks again for the help from Mark. > > Regards, > Qi > -- > LIU Qi > > liuqi at loongson.cn > liuqi82 at gmail.com > > Loongson Technology Co. Ltd. > > PGP Key fingerprint: > 3D29 FDFD AFB3 225D B744 > 7FAB 51C7 4820 63BA 272F Many thanks for any help, and sorry again for the somewhat off topic post. Paulo From liuqi at loongson.cn Sat Oct 23 23:34:09 2010 From: liuqi at loongson.cn (LIU Qi) Date: Sun, 24 Oct 2010 14:34:09 +0800 Subject: openjdk6-mips port added to icedtea server In-Reply-To: <504d12434baafd10854ffdc5aef06f7e.squirrel@webmail.mandriva.com.br> References: <1287738763.2755.50.camel@springer.wildebeest.org> <20101023094900.GA9736@loongson.cn> <504d12434baafd10854ffdc5aef06f7e.squirrel@webmail.mandriva.com.br> Message-ID: <20101024063409.GA3359@loongson.cn> > Hi, Hi Paulo, > > Sorry for hijacking the thread, but I started recently adding > support for mips in my fork of the lightning jit generator, at > > http://github.com/pcpa/lightning > > This is done as a personal project (no companies of official > projects involved, I use lightning for jit in a language I am > writing...), as I have access to an older gdium sample; I also > wrote a very good share of the Xorg siliconmotion driver for > smi 501/502 like 2 years ago, also for the gdium. That sounds interesting, and thank you for your contribution to the Loongson and gdium. > > Any pointers on these would be useful: > o How to pass float and double arguments so that they would work > if calling a prototyped or not prototyped function; floats are > ok if working only with prototyped functions > My current guess, before working on it again, and writing some > basic tests with gcc calling a jit function and then inspecting > registers is that: > a0+a1 first double > a2+a3 second double > f12 first float > f13 second float > f14 third float > f15 fourth float What you cared about is defined in the ABI. There are three common ABIs used for MIPS architectures, o32, n32 and n64. You could get the information in the manual of these ABIs. Also, they are mentioned in the book 'See MIPS run'. > o Pointers to download of images (for godson/loongson) of a system > with gcc and binutils devel, running either 64 bits mode, big endian > mode or another abi are also welcome, so that I can test all > alternatives before considering it done You could use the Debian mipsel system for the development. Loongson support only little endian. > o How to detect cpu features, preferably without causing signals/traps, > because I use attribute constructor on a function, but currently > only functional for x86. What is desirable to detect is if, or which > mips32 release 2 opcodes are implemented, or which mips32 opcodes > are missing (in the mips manual, it says movf and movt are mips32 > but are not implemented in my sample for example) You could read the CPU information from /proc/cpuinfo. And Loongson2F is compatible with MIPS3. The Loongson2G and Loongson3 will be MIPS64 compatible. > o This one is kinda funny, as I am working on generating code, I am > still not very familiar with the actual assembler syntax, so, > what would be the proper __asm__ __volatile__ to flush the code > cache of a buffer recently written? (I am making a call to _cache_flush > on linux, and just mprotect otherwise, but it may require a different > approach on other system). There is a system call named cacheflush(147) could be used to flush the cache. In some systems, cache could be flushed only with the privilege, so using assemble in use space may not be a good idea to do this. Regards, Qi -- LIU Qi liuqi at loongson.cn liuqi82 at gmail.com Loongson Technology Co. Ltd. PGP Key fingerprint: 3D29 FDFD AFB3 225D B744 7FAB 51C7 4820 63BA 272F From liuqi at loongson.cn Sun Oct 24 01:51:02 2010 From: liuqi at loongson.cn (LIU Qi) Date: Sun, 24 Oct 2010 16:51:02 +0800 Subject: [openjdk6-mips] 2 new changesets: d3aee0aef6b6 and 7eeee95a5a53 Message-ID: <20101024085102.GA9517@loongson.cn> Hi guys, Yang Yongqiang has committed the following patches to the project openjdk6-mips: Fix five bugs related to safepoint_poll, double-precision operand, verify_oop operation and safepoint_return respectively. Avoid anti-dependency when moving long operand between registers(reg2reg) and enable the safepoint return. The mercurial repo. of project openjdk6-mips is located at: http://icedtea.classpath.org/hg/openjdk6-mips/ Also, we maintained a mirror located at: http://hg.printk.org/openjdk6-mips/ Regards, Qi -- LIU Qi liuqi at loongson.cn liuqi82 at gmail.com Loongson Technology Co. Ltd. PGP Key fingerprint: 3D29 FDFD AFB3 225D B744 7FAB 51C7 4820 63BA 272F From pcpa at mandriva.com.br Sun Oct 24 03:04:13 2010 From: pcpa at mandriva.com.br (Paulo =?iso-8859-1?Q?C=E9sar_Pereira_de_Andrade?=) Date: Sun, 24 Oct 2010 08:04:13 -0200 Subject: openjdk6-mips port added to icedtea server In-Reply-To: <20101024063409.GA3359@loongson.cn> References: <1287738763.2755.50.camel@springer.wildebeest.org> <20101023094900.GA9736@loongson.cn> <504d12434baafd10854ffdc5aef06f7e.squirrel@webmail.mandriva.com.br> <20101024063409.GA3359@loongson.cn> Message-ID: LIU Qi wrote: > > Hi, > Hi Paulo, Hi LIU, > > Any pointers on these would be useful: > > o How to pass float and double arguments so that they would work > > if calling a prototyped or not prototyped function; floats are > > ok if working only with prototyped functions > > My current guess, before working on it again, and writing some > > basic tests with gcc calling a jit function and then inspecting > > registers is that: > > a0+a1 first double > > a2+a3 second double > > f12 first float > > f13 second float > > f14 third float > > f15 fourth float > What you cared about is defined in the ABI. There are three common ABIs > used for MIPS architectures, o32, n32 and n64. You could get the > information in the manual of these ABIs. Also, they are mentioned in the > book 'See MIPS run'. Thanks. I think now I understand what was causing me confusion, and is the rule that if first argument is float other(s) also go on float register(s), otherwise register arguments go on int registers. > > o Pointers to download of images (for godson/loongson) of a system > > with gcc and binutils devel, running either 64 bits mode, big endian > > mode or another abi are also welcome, so that I can test all > > alternatives before considering it done > You could use the Debian mipsel system for the development. Loongson > support only little endian. Ok. I will check it, as I am mostly interested on a 64 bits system. For 32 bits I am using the Mandriva port. > > o How to detect cpu features, preferably without causing signals/traps, > > because I use attribute constructor on a function, but currently > > only functional for x86. What is desirable to detect is if, or which > > mips32 release 2 opcodes are implemented, or which mips32 opcodes > > are missing (in the mips manual, it says movf and movt are mips32 > > but are not implemented in my sample for example) > You could read the CPU information from /proc/cpuinfo. And Loongson2F > is compatible with MIPS3. The Loongson2G and Loongson3 will be MIPS64 > compatible. I do not have access to the sample right now, but I think it is still code named Godson; probably one of the first processors available. But it should be ok to read /proc/cpuinfo and for other OSes just default to a common denominator. > > o This one is kinda funny, as I am working on generating code, I am > > still not very familiar with the actual assembler syntax, so, > > what would be the proper __asm__ __volatile__ to flush the code > > cache of a buffer recently written? (I am making a call to > _cache_flush > > on linux, and just mprotect otherwise, but it may require a different > > approach on other system). > There is a system call named cacheflush(147) could be used to flush the > cache. In some systems, cache could be flushed only with the privilege, > so using assemble in use space may not be a good idea to do this. I was more interested in attempting to give less work in case someone works on it for other OS. The current code in http://github.com/pcpa/lightning/blob/master/lightning/mips/funcs.h#L42 was mostly a quick hack, and the assembly should be more like: cache 16,0($a0); cache 16,0($a1) what should invalidate instruction cache at start and end of jit buffer. But probably I will just remove the #if 0'ed code, as this should really be done by the kernel. Thanks again, Paulo > Regards, > Qi > > -- > LIU Qi > > liuqi at loongson.cn > liuqi82 at gmail.com > > Loongson Technology Co. Ltd. > > PGP Key fingerprint: > 3D29 FDFD AFB3 225D B744 > 7FAB 51C7 4820 63BA 272F From liuqi at loongson.cn Sun Oct 24 05:07:01 2010 From: liuqi at loongson.cn (LIU Qi) Date: Sun, 24 Oct 2010 20:07:01 +0800 Subject: [openjdk6-mips] 1 new changesets: 89199c685d4a Message-ID: <20101024120701.GA14647@loongson.cn> Hi guys, Cai Songsong has committed the following patches to the project openjdk6-mips: Fix the compiling bug for the product version. The mercurial repo. of project openjdk6-mips is located at: http://icedtea.classpath.org/hg/openjdk6-mips/ Also, we maintained a mirror located at: http://hg.printk.org/openjdk6-mips/ Regards, Qi -- LIU Qi liuqi at loongson.cn liuqi82 at gmail.com Loongson Technology Co. Ltd. PGP Key fingerprint: 3D29 FDFD AFB3 225D B744 7FAB 51C7 4820 63BA 272F From liuqi at icedtea.classpath.org Sun Oct 24 01:29:53 2010 From: liuqi at icedtea.classpath.org (liuqi at icedtea.classpath.org) Date: Sun, 24 Oct 2010 08:29:53 +0000 Subject: /hg/openjdk6-mips: 2 new changesets Message-ID: changeset 7eeee95a5a53 in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=7eeee95a5a53 author: YANG Yongqiang date: Sat Oct 23 21:08:56 2010 +0000 Fix five bugs related to safepoint_poll, double-precision operand, verify_oop operation and safepoint_return respectively. 1. pc_offset for oopMap at safepoint_poll used by add_debug_info_branch must be the offset of the instruction which causes an exception. 2. To avoid the failure of type-checking, when value of LIRConst, which is single-precision or double-precision, is got through a common path. However, as_jint_lo_bits and as_jint_hi_bits, which are much more general, should be used. 3. In the stack2reg function, when operand is double-precision, two float registers are filled with content of the same stack address. We should not do that. Fix it. 4. In the verify_oop_addr function, the address of the object to be verified may use SP, so the object must be loaded before changing SP. 5. Let safepoint_return use AT. 6. Do some codes cleaning work. changeset d3aee0aef6b6 in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=d3aee0aef6b6 author: YANG Yongqiang date: Sun Oct 24 14:32:13 2010 +0000 Avoid anti-dependency when moving long operand between registers(reg2reg) and enable the safepoint return. 1. Avoid anti-dependency when moving long operand between registers(reg2reg) 2. Enable the safepoint return. 3. Do some codes cleaning work. diffstat: 11 files changed, 1904 insertions(+), 3672 deletions(-) hotspot/src/cpu/mips/vm/assembler_mips.cpp | 84 hotspot/src/cpu/mips/vm/c1_CodeStubs_mips.cpp | 38 hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp | 3048 ++++++++++------------ hotspot/src/cpu/mips/vm/c1_Runtime1_mips.cpp | 436 --- hotspot/src/cpu/mips/vm/sharedRuntime_mips.cpp | 434 --- hotspot/src/cpu/mips/vm/stubGenerator_mips.cpp | 1483 +--------- hotspot/src/cpu/mips/vm/templateTable_mips.cpp | 20 hotspot/src/share/vm/oops/oop.inline.hpp | 4 hotspot/src/share/vm/runtime/frame.cpp | 2 hotspot/src/share/vm/runtime/reflection.cpp | 4 hotspot/src/share/vm/runtime/sharedRuntime.cpp | 23 diffs (truncated from 7425 to 500 lines): diff -r 3713353e23db -r d3aee0aef6b6 hotspot/src/cpu/mips/vm/assembler_mips.cpp --- a/hotspot/src/cpu/mips/vm/assembler_mips.cpp Fri Oct 15 20:37:51 2010 +0000 +++ b/hotspot/src/cpu/mips/vm/assembler_mips.cpp Sun Oct 24 14:32:13 2010 +0000 @@ -2051,44 +2051,11 @@ void MacroAssembler::verify_oop(Register void MacroAssembler::verify_oop_addr(Address addr, const char* s) { -/* - if (!VerifyOops) return; - - // Address adjust(addr.base(), addr.index(), addr.scale(), addr.disp() + BytesPerWord); - // Pass register number to verify_oop_subroutine - char* b = new char[strlen(s) + 50]; - sprintf(b, "verify_oop_addr: %s", s); - - push(rax); // save rax, - // addr may contain rsp so we will have to adjust it based on the push - // we just did - // NOTE: 64bit seemed to have had a bug in that it did movq(addr, rax); which - // stores rax into addr which is backwards of what was intended. - if (addr.uses(rsp)) { - lea(rax, addr); - pushptr(Address(rax, BytesPerWord)); - } else { - pushptr(addr); - } - - ExternalAddress buffer((address) b); - // pass msg argument - // avoid using pushptr, as it modifies scratch registers - // and our contract is not to modify anything - movptr(rax, buffer.addr()); - push(rax); - - // call indirectly to solve generation ordering problem - movptr(rax, ExternalAddress(StubRoutines::verify_oop_subroutine_entry_address())); - call(rax); - // Caller pops the arguments and restores rax, from the stack -*/ if (!VerifyOops) { nop(); return; } // Pass register number to verify_oop_subroutine - Address adjust(addr.base(),addr.disp()+BytesPerWord); char* b = new char[strlen(s) + 50]; sprintf(b, "verify_oop_addr: %s", s); @@ -2099,10 +2066,10 @@ void MacroAssembler::verify_oop_addr(Add sw(A1, SP, - 5*wordSize); sw(AT, SP, - 6*wordSize); sw(T9, SP, - 7*wordSize); + lw(A1, addr); // addr may use SP, so load from it before change SP addiu(SP, SP, - 7 * wordSize); move(A0, (int)b); - lw(A1, adjust); // call indirectly to solve generation ordering problem move(AT, (int)StubRoutines::verify_oop_subroutine_entry_address()); lw(T9, AT, 0); @@ -2120,11 +2087,11 @@ void MacroAssembler::verify_oop_addr(Add // used registers : T5, T6 void MacroAssembler::verify_oop_subroutine() { - // [sp - 1]: ra - // [sp + 0]: char* error message A0 - // [sp + 1]: oop object to verify A1 + // RA: ra + // A0: char* error message + // A1: oop object to verify - Label exit, error, error1,error2,error3,error4; + Label exit, error; // increment counter move(T5, (int)StubRoutines::verify_oop_count_addr()); lw(AT, T5, 0); @@ -2141,18 +2108,13 @@ void MacroAssembler::verify_oop_subrouti move(AT, oop_mask); andr(T5, A1, AT); move(AT, oop_bits); - /* - //jerome_for_debug bne(T5, AT, error); delayed()->nop(); - */ + // make sure klass is 'reasonable' lw(T5, A1, oopDesc::klass_offset_in_bytes()); // get klass - /* - //jerome_for_debug - beq(T5, ZERO, error1); // if klass is NULL it is broken + beq(T5, ZERO, error); // if klass is NULL it is broken delayed()->nop(); - */ // Check if the klass is in the right area of memory const int klass_mask = Universe::verify_klass_mask(); const int klass_bits = Universe::verify_klass_bits(); @@ -2160,18 +2122,17 @@ void MacroAssembler::verify_oop_subrouti move(AT, klass_mask); andr(T6, T5, AT); move(AT, klass_bits); - bne(T6, AT, error2); + bne(T6, AT, error); delayed()->nop(); - // make sure klass' klass is 'reasonable' lw(T5, T5, oopDesc::klass_offset_in_bytes()); // get klass' klass - beq(T5, ZERO, error3); // if klass' klass is NULL it is broken + beq(T5, ZERO, error); // if klass' klass is NULL it is broken delayed()->nop(); move(AT, klass_mask); andr(T6, T5, AT); move(AT, klass_bits); - bne(T6, AT, error4); + bne(T6, AT, error); delayed()->nop(); // if klass not in right area of memory it is broken too. // return if everything seems ok @@ -2182,35 +2143,14 @@ void MacroAssembler::verify_oop_subrouti // handle errors bind(error); - lw(AT, ZERO, 16); - sw(RA, SP, (-1) * wordSize); - sw(FP, SP, (-2) * wordSize); - //save_frame(::round_to(sizeof(RegistersForDebugging) / BytesPerWord, 2) + 2); - //RegistersForDebugging::save_registers(this); - //move(A1, SP); - //addi(SP, SP, (-2) * wordSize); pushad(); - addi(SP, SP, (-3) * wordSize); + addi(SP, SP, (-1) * wordSize); call(CAST_FROM_FN_PTR(address, MacroAssembler::debug), relocInfo::runtime_call_type); delayed()->nop(); - //addi(SP, SP, 2 * wordSize); - addiu(SP, SP, 3 * wordSize); + addiu(SP, SP, 1 * wordSize); popad(); - //RegistersForDebugging::restore_registers(this, SP); - //restore(); - lw(RA, SP, (-1) * wordSize); - lw(FP, SP, (-2) * wordSize); jr(RA); delayed()->nop(); - //jerome_for_debug - bind(error1); - stop("error1"); - bind(error2); - stop("error2"); - bind(error3); - stop("error3"); - bind(error4); - stop("error4"); } void MacroAssembler::verify_tlab(Register t1, Register t2) { diff -r 3713353e23db -r d3aee0aef6b6 hotspot/src/cpu/mips/vm/c1_CodeStubs_mips.cpp --- a/hotspot/src/cpu/mips/vm/c1_CodeStubs_mips.cpp Fri Oct 15 20:37:51 2010 +0000 +++ b/hotspot/src/cpu/mips/vm/c1_CodeStubs_mips.cpp Sun Oct 24 14:32:13 2010 +0000 @@ -33,42 +33,6 @@ double ConversionStub::double_zero = 0.0 double ConversionStub::double_zero = 0.0; void ConversionStub::emit_code(LIR_Assembler* ce) { - /* - __ bind(_entry); - assert(bytecode() == Bytecodes::_f2i || bytecode() == Bytecodes::_d2i, "other conversions do not require stub"); - - - if (input()->is_single_xmm()) { - __ comiss(input()->as_xmm_float_reg(), - ExternalAddress((address)&float_zero)); - } else if (input()->is_double_xmm()) { - __ comisd(input()->as_xmm_double_reg(), - ExternalAddress((address)&double_zero)); - } else { - LP64_ONLY(ShouldNotReachHere()); - __ push(rax); - __ ftst(); - __ fnstsw_ax(); - __ sahf(); - __ pop(rax); - } - - Label NaN, do_return; - __ jccb(Assembler::parity, NaN); - __ jccb(Assembler::below, do_return); - - // input is > 0 -> return maxInt - // result register already contains 0x80000000, so subtracting 1 gives 0x7fffffff - __ decrement(result()->as_register()); - __ jmpb(do_return); - - // input is NaN -> return 0 - __ bind(NaN); - __ xorptr(result()->as_register(), result()->as_register()); - - __ bind(do_return); - __ jmp(_continuation); - */ __ bind(_entry); assert(bytecode() == Bytecodes::_f2i || bytecode() == Bytecodes::_d2i, "other conversions do not require stub"); } @@ -471,7 +435,6 @@ void ImplicitNullCheckStub::emit_code(LI void ImplicitNullCheckStub::emit_code(LIR_Assembler* ce) { ce->compilation()->implicit_exception_table()->append(_offset, __ offset()); __ bind(_entry); - //__ call(RuntimeAddress(Runtime1::entry_for(Runtime1::throw_null_pointer_exception_id))); __ call(Runtime1::entry_for(Runtime1::throw_null_pointer_exception_id), relocInfo::runtime_call_type); __ delayed()->nop(); ce->add_call_info_here(_info); @@ -488,7 +451,6 @@ void SimpleExceptionStub::emit_code(LIR_ if (_obj->is_cpu_register()) { ce->store_parameter(_obj->as_register(), 0); } - //__ call(RuntimeAddress(Runtime1::entry_for(_stub))); __ call(Runtime1::entry_for(_stub), relocInfo::runtime_call_type); __ delayed()->nop(); ce->add_call_info_here(_info); diff -r 3713353e23db -r d3aee0aef6b6 hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp --- a/hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp Fri Oct 15 20:37:51 2010 +0000 +++ b/hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp Sun Oct 24 14:32:13 2010 +0000 @@ -53,7 +53,6 @@ static void select_different_registers(R assert_different_registers(tmp1, tmp2, tmp3, extra); tmp1 = extra; } else if (tmp2 == preserve) { - //////assert_different_registers(tmp1, tmp2, tmp3, extra); tmp2 = extra; } else if (tmp3 == preserve) { assert_different_registers(tmp1, tmp2, tmp3, extra); @@ -79,7 +78,6 @@ bool LIR_Assembler::is_small_constant(LI } //FIXME, which register should be used? LIR_Opr LIR_Assembler::receiverOpr() { - //return FrameMap::ecx_oop_opr; return FrameMap::_t0_oop_opr; } @@ -165,7 +163,6 @@ void LIR_Assembler::push(LIR_Opr opr) { } else { ShouldNotReachHere(); } - } else { ShouldNotReachHere(); } @@ -173,7 +170,6 @@ void LIR_Assembler::push(LIR_Opr opr) { void LIR_Assembler::pop(LIR_Opr opr) { if (opr->is_single_cpu() ) { - // __ pop(opr->rinfo().as_register()); __ pop(opr->as_register()); } else { assert(false, "Must be single word register or floating-point register"); @@ -184,7 +180,6 @@ Address LIR_Assembler::as_Address(LIR_Ad Address LIR_Assembler::as_Address(LIR_Address* addr) { Register reg = addr->base()->as_register(); // now we need this for parameter pass - //assert(reg != SP && reg != FP, "address must be in heap, not stack"); return Address(reg, addr->disp()); } @@ -244,7 +239,7 @@ void LIR_Assembler::osr_entry() { Register OSR_buf = osrBufferPointer()->as_register(); - // note: we do osr only if the expression stack at the loop beginning is empty, + // note: we do osr only if the expression stack at the loop beginning is empty, // in which case the spill area is empty too and we don't have to setup // spilled locals // @@ -320,11 +315,8 @@ void LIR_Assembler::monitorexit(LIR_Opr Address lock_addr = frame_map()->address_for_monitor_lock(monitor_no); __ lea(lock_reg, lock_addr); // unlock object - // MonitorAccessStub* slow_case = new MonitorExitStub(lock_, true, monitor_no); MonitorAccessStub* slow_case = new MonitorExitStub(lock_opr, true, monitor_no); - // _slow_case_stubs->append(slow_case); // temporary fix: must be created after exceptionhandler, therefore as call stub - //_call_stubs->append(slow_case); _slow_case_stubs->append(slow_case); if (UseFastLocking) { // try inlined fast unlocking first, revert to slow locking if it fails @@ -368,13 +360,11 @@ void LIR_Assembler::emit_exception_handl // but since this never gets executed it doesn't really make // much difference. // -// for (int i = 0; i < (NativeCall::instruction_size/4 + 1) ; i++ ) { - for (int i = 0; i < (NativeCall::instruction_size/2+1) ; i++ ) { + for (int i = 0; i < (NativeCall::instruction_size/4 + 1) ; i++ ) { __ nop(); } // generate code for exception handler - //address handler_base = __ start_a_stub(1*K);//by_css address handler_base = __ start_a_stub(exception_handler_size); if (handler_base == NULL) { //no enough space @@ -390,8 +380,6 @@ void LIR_Assembler::emit_exception_handl if (compilation()->has_exception_handlers() || JvmtiExport::can_post_exceptions()) { // the exception oop and pc are in V0 and V1 // no other registers need to be preserved, so invalidate them -// __ invalidate_registers(false, true, true, false, true, true); - // check that there is really an exception __ verify_not_null_oop(V0); @@ -405,8 +393,6 @@ void LIR_Assembler::emit_exception_handl // the exception oop is in V0 // no other registers need to be preserved, so invalidate them -// __ invalidate_registers(false, true, true, true, true, true); - // check that there is really an exception __ verify_not_null_oop(V0); @@ -419,19 +405,11 @@ void LIR_Assembler::emit_exception_handl // unwind activation and forward exception to caller // V0: exception - /*if (compilation()->jvmpi_event_method_exit_enabled()) { - __ jmp(Runtime1::entry_for(Runtime1::jvmpi_unwind_exception_id), - relocInfo::runtime_call_type); - } else*/ { - __ jmp(Runtime1::entry_for(Runtime1::unwind_exception_id), - relocInfo::runtime_call_type); - } + __ jmp(Runtime1::entry_for(Runtime1::unwind_exception_id), + relocInfo::runtime_call_type); __ delayed()->nop(); __ end_a_stub(); - - - - } +} void LIR_Assembler::emit_deopt_handler() { // if the last instruction is a call (typically to do a throw which @@ -459,11 +437,6 @@ void LIR_Assembler::emit_deopt_handler() //FIXE:: may be wrong, Address_Literal __ lw(AT, __ as_Address(here) ); __ push(AT); - - //XXXXX:FIXE need jump - -// __ jr(RuntimeAddress(SharedRuntime::deopt_blob()->unpack())); - assert(code_offset() - offset <= deopt_handler_size, "overflow"); __ end_a_stub(); @@ -478,12 +451,6 @@ void LIR_Assembler::emit_string_compare( // get two string object in T0&T1 //receiver already in T0 __ lw(T1, arg1->as_register()); - - // Get addresses of first characters from both Strings - { - // CodeEmitInfo* info = new CodeEmitInfo(scope, 0, NULL); - // add_debug_info_for_null_check_here(info); - } __ lw (T2, T0, java_lang_String::value_offset_in_bytes()); //value, T_CHAR array __ lw (AT, T0, java_lang_String::offset_offset_in_bytes()); //offset __ shl(AT, 1); @@ -491,10 +458,7 @@ void LIR_Assembler::emit_string_compare( __ addi(T2, T2, arrayOopDesc::base_offset_in_bytes(T_CHAR)); // Now T2 is the address of the first char in first string(T0) - { - // CodeEmitInfo* info = new CodeEmitInfo(scope, 0, NULL); - add_debug_info_for_null_check_here(info); - } + add_debug_info_for_null_check_here(info); __ lw (T3, T1, java_lang_String::value_offset_in_bytes()); __ lw (AT, T1, java_lang_String::offset_offset_in_bytes()); __ shl(AT, 1); @@ -537,44 +501,36 @@ void LIR_Assembler::emit_string_compare( __ subu(V0, T5, T6); __ bind(LoopEnd); - //return_op(FrameMap::_v0RInfo, false); - //FIXME return_op(FrameMap::_v0_opr); } -//void LIR_Assembler::return_op(RInfo result, bool result_is_oop) { void LIR_Assembler::return_op(LIR_Opr result) { assert(result->is_illegal() || !result->is_single_cpu() || result->as_register() == V0, "word returns are in V0"); // Pop the stack before the safepoint code __ leave(); - //FIXME I have no idea it is safe to use A0 - __ lui(A0, Assembler::split_high((intptr_t)os::get_polling_page() + __ lui(AT, Assembler::split_high((intptr_t)os::get_polling_page() + (SafepointPollOffset % os::vm_page_size()))); __ relocate(relocInfo::poll_return_type); - __ lw(AT, A0, Assembler::split_low((intptr_t)os::get_polling_page() + __ lw(AT, AT, Assembler::split_low((intptr_t)os::get_polling_page() + (SafepointPollOffset % os::vm_page_size()))); + __ jr(RA); __ delayed()->nop(); } //read protect mem to ZERO won't cause the exception only in godson-2e, So I modify ZERO to AT . at jerome,11/25,2006 int LIR_Assembler::safepoint_poll(LIR_Opr tmp, CodeEmitInfo* info) { - if (info != NULL) { - add_debug_info_for_branch(info); - }else{ - ShouldNotReachHere(); - } + assert(info != NULL, "info must not be null for safepoint poll"); int offset = __ offset(); Register r = tmp->as_register(); __ lui(r, Assembler::split_high((intptr_t)os::get_polling_page() + (SafepointPollOffset % os::vm_page_size()))); + add_debug_info_for_branch(info); __ relocate(relocInfo::poll_type); __ lw(AT, r, Assembler::split_low((intptr_t)os::get_polling_page() + (SafepointPollOffset % os::vm_page_size()))); - return offset; - } void LIR_Assembler::move_regs(Register from_reg, Register to_reg) { @@ -593,161 +549,151 @@ void LIR_Assembler::const2reg(LIR_Opr sr assert(dest->is_register(), "should not call otherwise"); LIR_Const* c = src->as_constant_ptr(); switch (c->type()) { - case T_INT: - { - jint con = c->as_jint(); - if (dest->is_single_cpu()) { - assert(patch_code == lir_patch_none, "no patching handled here"); - __ move(dest->as_register(), con); - } else { - assert(dest->is_single_fpu(), "wrong register kind"); - __ move(AT, con); - __ mtc1(AT, dest->as_float_reg()); - } - } - break; - - case T_LONG: - { - jlong con = c->as_jlong(); - jint* conhi = (jint*)&con + 1; - jint* conlow = (jint*)&con; - - if (dest->is_double_cpu()) { - __ move(dest->as_register_lo(), *conlow); - __ move(dest->as_register_hi(), *conhi); - } else { - // assert(dest->is_double(), "wrong register kind"); - __ move(AT, *conlow); - __ mtc1(AT, dest->as_double_reg()); - __ move(AT, *conhi); - __ mtc1(AT, dest->as_double_reg()+1); - } - } - break; - - case T_OBJECT: - { - if (patch_code == lir_patch_none) { - if (c->as_jobject() == NULL) { - NEEDS_CLEANUP - int oop_index = __ oop_recorder()->allocate_index(c->as_jobject()); - RelocationHolder rspec = oop_Relocation::spec(oop_index); - __ relocate(rspec); - __ lui(dest->as_register(), Assembler::split_high((int) c->as_jobject() )); - __ addiu( dest->as_register() , dest->as_register() , Assembler::split_low((int) c->as_jobject())); - - - //__ move(dest->as_register(), ZERO); - } else { - int oop_index = __ oop_recorder()->find_index(c->as_jobject()); - RelocationHolder rspec = oop_Relocation::spec(oop_index); - __ relocate(rspec); - __ lui(dest->as_register(), Assembler::split_high((int)c->as_jobject())); - __ addiu(dest->as_register(), dest->as_register(), Assembler::split_low((int)c->as_jobject())); - } - } else { - jobject2reg_with_patching(dest->as_register(), info); - } - } - break; - - case T_FLOAT: - { - address const_addr = float_constant(c->as_jfloat()); - assert (const_addr != NULL, "must create float constant in the constant table"); - - if (dest->is_single_fpu()) { - __ relocate(relocInfo::internal_pc_type); - __ lui(AT, Assembler::split_high((int)const_addr)); - __ addiu(AT, AT, Assembler::split_low((int)const_addr)); - __ lwc1(dest->as_float_reg(), AT, 0); - From liuqi at icedtea.classpath.org Sun Oct 24 05:02:26 2010 From: liuqi at icedtea.classpath.org (liuqi at icedtea.classpath.org) Date: Sun, 24 Oct 2010 12:02:26 +0000 Subject: /hg/openjdk6-mips: Fix the compiling bug for the product version. Message-ID: changeset 89199c685d4a in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=89199c685d4a author: Cai Songsong date: Mon Oct 25 01:07:09 2010 +0800 Fix the compiling bug for the product version. Because of the debug information, it will fail when the product version is compiled. Remove the debug information. diffstat: 1 file changed, 8 deletions(-) hotspot/src/cpu/mips/vm/c1_Runtime1_mips.cpp | 8 -------- diffs (18 lines): diff -r d3aee0aef6b6 -r 89199c685d4a hotspot/src/cpu/mips/vm/c1_Runtime1_mips.cpp --- a/hotspot/src/cpu/mips/vm/c1_Runtime1_mips.cpp Sun Oct 24 14:32:13 2010 +0000 +++ b/hotspot/src/cpu/mips/vm/c1_Runtime1_mips.cpp Mon Oct 25 01:07:09 2010 +0800 @@ -626,14 +626,6 @@ OopMapSet* Runtime1::generate_patching(S __ bne(V0,ZERO, skip); __ delayed()->nop(); // relocInfo::runtime_call_type); - __ pushad(); - __ move(A0, 0x66bb); - __ addiu(SP, SP, -4); - __ call(CAST_FROM_FN_PTR(address, SharedRuntime::print_int)); - __ delayed()->nop(); - __ addiu(SP, SP, 4); - __ popad(); - __ jmp(Runtime1::entry_for(Runtime1::forward_exception_id), relocInfo::runtime_call_type); __ delayed()->nop(); From liuqi at icedtea.classpath.org Sun Oct 24 07:58:19 2010 From: liuqi at icedtea.classpath.org (liuqi at icedtea.classpath.org) Date: Sun, 24 Oct 2010 14:58:19 +0000 Subject: /hg/openjdk6-mips: Remove the useless code used for debugging. Message-ID: changeset 71f3d14ed0eb in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=71f3d14ed0eb author: YANG Yongqiang date: Sun Oct 24 21:58:11 2010 +0800 Remove the useless code used for debugging. diffstat: 1 file changed, 12 deletions(-) hotspot/src/share/vm/prims/jvm.cpp | 12 ------------ diffs (22 lines): diff -r 89199c685d4a -r 71f3d14ed0eb hotspot/src/share/vm/prims/jvm.cpp --- a/hotspot/src/share/vm/prims/jvm.cpp Mon Oct 25 01:07:09 2010 +0800 +++ b/hotspot/src/share/vm/prims/jvm.cpp Sun Oct 24 21:58:11 2010 +0800 @@ -234,18 +234,6 @@ JVM_ENTRY(void, JVM_ArrayCopy(JNIEnv *en arrayOop d = arrayOop(JNIHandles::resolve_non_null(dst)); assert(s->is_oop(), "JVM_ArrayCopy: src not an oop"); assert(d->is_oop(), "JVM_ArrayCopy: dst not an oop"); - - oop p = oop(JNIHandles::resolve_non_null(dst)); - if(dst_pos == badHeapWordVal || length == badHeapWordVal) { - //tty->print_cr("%s:%d: %x-%x %x-%x %x %x ", __FILE__, __LINE__, s, d, src_pos, dst_pos, length, p); - for(int i = 0; i < 4; i ++) { - tty->print("%x ",*((int*)p + i) ); - } - p->print(); - s->print(); - d->print(); - } - // Do copy Klass::cast(s->klass())->copy_array(s, src_pos, d, dst_pos, length, thread); JVM_END From liuqi at icedtea.classpath.org Mon Oct 25 01:19:37 2010 From: liuqi at icedtea.classpath.org (liuqi at icedtea.classpath.org) Date: Mon, 25 Oct 2010 08:19:37 +0000 Subject: /hg/openjdk6-mips: Fix a bug in computing the size of an array. Message-ID: changeset d1c481f44844 in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=d1c481f44844 author: YANG Yongqiang date: Mon Oct 25 15:43:04 2010 +0800 Fix a bug in computing the size of an array. The size of an array is computed with error in the stub (either new_type_array_id or new_object_array_id) which allocates space for arrays. diffstat: 1 file changed, 17 insertions(+), 18 deletions(-) hotspot/src/cpu/mips/vm/c1_Runtime1_mips.cpp | 35 ++++++++++++-------------- diffs (74 lines): diff -r 71f3d14ed0eb -r d1c481f44844 hotspot/src/cpu/mips/vm/c1_Runtime1_mips.cpp --- a/hotspot/src/cpu/mips/vm/c1_Runtime1_mips.cpp Sun Oct 24 21:58:11 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/c1_Runtime1_mips.cpp Mon Oct 25 15:43:04 2010 +0800 @@ -894,26 +894,26 @@ OopMapSet* Runtime1::generate_code_for(S __ slt(AT, AT, length); __ bne(AT, ZERO, slow_path); __ delayed()->nop(); - + // if we got here then the TLAB allocation failed, so try // refilling the TLAB or allocating directly from eden. Label retry_tlab, try_eden; //T0,T1,T5,T8 have changed! - __ tlab_refill(retry_tlab, try_eden, slow_path); // preserves ebx & edx + __ tlab_refill(retry_tlab, try_eden, slow_path); // preserves T2 & T4 __ bind(retry_tlab); // get the allocation size: (length << (layout_helper & 0x1F)) + header_size __ lw(t1, klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes()); - __ srl(AT, t1, Klass::_lh_log2_element_size_shift); - __ andi(AT, AT, Klass::_lh_log2_element_size_mask); + __ andi(AT, t1, 0x1f); __ sllv(arr_size, length, AT); - __ srl(AT, t1, Klass::_lh_header_size_shift); - __ andi(AT, AT, Klass::_lh_header_size_mask); - __ add(arr_size, AT, arr_size); + __ srl(t1, t1, Klass::_lh_header_size_shift); + __ andi(t1, t1, Klass::_lh_header_size_mask); + __ add(arr_size, t1, arr_size); __ addi(arr_size, arr_size, MinObjAlignmentInBytesMask); // align up - __ andi(arr_size, arr_size, ~MinObjAlignmentInBytesMask); + __ move(AT, ~MinObjAlignmentInBytesMask); + __ andr(arr_size, arr_size, AT); __ tlab_allocate(obj, arr_size, 0, t1, t2, slow_path); // preserves arr_size @@ -921,6 +921,8 @@ OopMapSet* Runtime1::generate_code_for(S __ lbu(t1, Address(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes() + (Klass::_lh_header_size_shift / BitsPerByte))); + assert(Klass::_lh_header_size_shift % BitsPerByte == 0, "bytewise"); + assert(Klass::_lh_header_size_mask <= 0xFF, "bytewise"); __ andi(t1, t1, Klass::_lh_header_size_mask); __ sub(arr_size, arr_size, t1); // body length __ add(t1, t1, obj); // body start @@ -932,19 +934,16 @@ OopMapSet* Runtime1::generate_code_for(S __ bind(try_eden); // get the allocation size: (length << (layout_helper & 0x1F)) + header_size __ lw(t1, klass, klassOopDesc::header_size() * HeapWordSize - + Klass::layout_helper_offset_in_bytes()); - __ srl(AT, t1, Klass::_lh_log2_element_size_shift); - __ andi(AT, AT, Klass::_lh_log2_element_size_mask); + + Klass::layout_helper_offset_in_bytes()); + __ andi(AT, t1, 0x1f); __ sllv(arr_size, length, AT); - __ srl(AT, t1, Klass::_lh_header_size_shift); - __ andi(AT, AT, Klass::_lh_header_size_mask); - __ add(arr_size, AT, arr_size); + __ srl(t1, t1, Klass::_lh_header_size_shift); + __ andi(t1, t1, Klass::_lh_header_size_mask); + __ add(arr_size, t1, arr_size); __ addi(arr_size, arr_size, MinObjAlignmentInBytesMask); // align up - __ andi(arr_size, arr_size, ~MinObjAlignmentInBytesMask); - - + __ move(AT, ~MinObjAlignmentInBytesMask); + __ andr(arr_size, arr_size, AT); __ eden_allocate(obj, arr_size, 0, t1, t2, slow_path); // preserves arr_size - __ initialize_header(obj, klass, length,t1,t2); __ lbu(t1, Address(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes() From omajid at redhat.com Mon Oct 25 06:42:44 2010 From: omajid at redhat.com (Omair Majid) Date: Mon, 25 Oct 2010 09:42:44 -0400 Subject: [RFC] netx: add support for parsing and saving deployment.config files In-Reply-To: <20101021213940.GG26975@redhat.com> References: <4CBC6C17.6090602@redhat.com> <20101021210504.GE26975@redhat.com> <4CC0AFFB.9060601@redhat.com> <20101021213940.GG26975@redhat.com> Message-ID: <4CC58954.5040206@redhat.com> On 10/21/2010 05:39 PM, Deepak Bhole wrote: > * Omair Majid [2010-10-21 17:26]: >> On 10/21/2010 05:05 PM, Deepak Bhole wrote: >>> * Omair Majid [2010-10-18 11:48]: >>>> Hi, >>>> >>>> As described on [1], The Java Plug-in and Java Web Start support >>>> using various deployment.properties and deployment.config files to >>>> set behaviour of these tools. The patch adds support for parsing and >>>> saving these files to netx. This patch does not actually use any of >>>> these settings; it just adds support so other parts of netx can >>>> start using them. >>>> >>>> This was filed as a bug by someone against the original netx project [2]. >>>> >>>> Any comments or concerns? >>>> >>>> Thanks, >>>> Omair >>>> >>>> [1] http://download.oracle.com/javase/1.5.0/docs/guide/deployment/deployment-guide/properties.html >>>> [2] http://sourceforge.net/tracker/?func=detail&aid=2832947&group_id=72541&atid=534854 >>> >>> >>> >>>> + >>>> + /** >>>> + * Loads properties properties file, if one exists >>>> + * >>> >>> Minor typo above. >> >> Fixed. >> >>> >>>> + * @param type the ConfigType to load >>>> + * @param file the File to load Properties from >>> >>> >>> >>>> + /* exit if there is a fatal exception loading the configuration */ >>>> + if (isApplication) { >>>> + System.out.println(getMessage("RConfigurationError")); >>>> + System.exit(-1); >>> >>> >>> Is there a reason you chose negative exit code? NetX uses +1 everywhere >>> else. >>> >> >> Ah, I didnt see that netx uses 1. I have fixed it now. >> >> Thanks for reviewing the patch. Area there other issues I should fix? >> > > Nope, rest looks fine. Ok for commit to HEAD. > Thanks for the review Deepak. Here is a a slightly updated version that I plan to commit. I made a few minor tweaks to make this class easier to use. 1. The class is now final and public so it can be used by other packages not part of net.sourceforge.jnlp.runtime 2. I renamed the methods so they make more sense. "save" and "load" are now used for saving and loading the configuration respectively. 3. Security checks have been added for getProperty(), getPropertyNames() and setProperty(). Ok to commit? Thanks, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea6-netx-deployment-config-02.patch Type: text/x-patch Size: 25320 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101025/3f59888e/icedtea6-netx-deployment-config-02.patch From asu at redhat.com Mon Oct 25 08:04:48 2010 From: asu at redhat.com (Andrew Su) Date: Mon, 25 Oct 2010 11:04:48 -0400 (EDT) Subject: [RFC] icedtea-web: make clean errors when building in a separate directory In-Reply-To: <88726091.3081288018347234.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <600997675.5561288019088314.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Hi, This patch fixes the order of cleaning the directory for the "launcher". It was removing launcher folder after trying to rmdir the icedteanp folder (this folder is not empty but folders are not considered "stuff" inside the folder). This patch just reorders it to remove the launcher folder before doing the rest of the clean. Makefile.am: (clean-IcedTeaPlugin): Remove launcher folder first (clean-plugin): removed called to remove launcher folder Cheers, Andrew -------------- next part -------------- A non-text attachment was scrubbed... Name: 20101025_fix_remove_launcher_on_make_clean.patch Type: text/x-patch Size: 563 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101025/f69fe307/20101025_fix_remove_launcher_on_make_clean.patch From dbhole at redhat.com Mon Oct 25 08:10:27 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Mon, 25 Oct 2010 11:10:27 -0400 Subject: [RFC] icedtea-web: make clean errors when building in a separate directory In-Reply-To: <600997675.5561288019088314.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> References: <88726091.3081288018347234.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> <600997675.5561288019088314.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <20101025151027.GB29650@redhat.com> * Andrew Su [2010-10-25 11:05]: > Hi, > > This patch fixes the order of cleaning the directory for the "launcher". > It was removing launcher folder after trying to rmdir the icedteanp folder (this folder is not empty but folders are not considered "stuff" inside the folder). > This patch just reorders it to remove the launcher folder before doing the rest of the clean. > > Makefile.am: > (clean-IcedTeaPlugin): Remove launcher folder first > (clean-plugin): removed called to remove launcher folder > > Cheers, > Andrew Looks good! OK for HEAD. Cheers, Deepak > diff -r eb998ed0ab1a Makefile.am > --- a/Makefile.am Fri Oct 22 10:44:12 2010 -0400 > +++ b/Makefile.am Mon Oct 25 10:45:44 2010 -0400 > @@ -188,6 +188,7 @@ > $(CC) $(LAUNCHER_LINK) $(PLUGIN_LAUNCHER_OBJECTS) > > clean-IcedTeaPlugin: > + rm -rf $(PLUGIN_DIR)/launcher > rm -f $(PLUGIN_DIR)/*.o > rm -f $(PLUGIN_DIR)/IcedTeaPlugin.so > if [ $(abs_top_srcdir) != $(abs_top_builddir) ]; then \ > @@ -203,7 +204,6 @@ > touch stamps/plugin.stamp > > clean-plugin: $(ICEDTEAPLUGIN_CLEAN) > - rm -rf $(PLUGIN_DIR)/launcher > rm -f stamps/plugin.stamp > > liveconnect-source-files.txt: From asu at redhat.com Mon Oct 25 08:27:20 2010 From: asu at redhat.com (Andrew Su) Date: Mon, 25 Oct 2010 11:27:20 -0400 (EDT) Subject: [RFC] icedtea-web: fix make clean error In-Reply-To: <1835156949.9971288020428538.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <1924788857.9991288020440576.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Hi, This patch fixes the order of cleaning the directory for the "launcher". It was removing launcher folder after trying to rmdir the icedteanp folder (this folder is not empty but folders are not considered "stuff" inside the folder). This patch just reorders it to remove the launcher folder before doing the rest of the clean. Makefile.am: (clean-IcedTeaPlugin): Remove launcher folder first (clean-plugin): removed called to remove launcher folder Cheers, Andrew -------------- next part -------------- A non-text attachment was scrubbed... Name: 20101025_fix_remove_launcher_on_make_clean.patch Type: text/x-patch Size: 563 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101025/e05ca09a/20101025_fix_remove_launcher_on_make_clean.patch From asu at redhat.com Mon Oct 25 08:35:03 2010 From: asu at redhat.com (Andrew Su) Date: Mon, 25 Oct 2010 11:35:03 -0400 (EDT) Subject: [RFC] icedtea-web: fix make clean error In-Reply-To: <847828571.10511288020894739.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <1043989460.10531288020903448.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Hi, This patch fixes the order of cleaning the directory for the "launcher" when building out of tree. It was removing launcher folder after trying to rmdir the icedteanp folder (this folder is not empty but folders are not considered "stuff" inside the folder). This patch just reorders it to remove the launcher folder before doing the rest of the clean. Makefile.am: (clean-IcedTeaPlugin): Remove launcher folder first (clean-plugin): removed called to remove launcher folder Cheers, Andrew -------------- next part -------------- A non-text attachment was scrubbed... Name: 20101025_fix_remove_launcher_on_make_clean.patch Type: text/x-patch Size: 563 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101025/fb6ce416/20101025_fix_remove_launcher_on_make_clean.patch From asu at icedtea.classpath.org Mon Oct 25 09:14:35 2010 From: asu at icedtea.classpath.org (asu at icedtea.classpath.org) Date: Mon, 25 Oct 2010 16:14:35 +0000 Subject: /hg/icedtea-web: Fix error on make clean. Message-ID: changeset e9910d92b046 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=e9910d92b046 author: Andrew Su date: Mon Oct 25 12:14:33 2010 -0400 Fix error on make clean. diffstat: 2 files changed, 7 insertions(+), 1 deletion(-) ChangeLog | 6 ++++++ Makefile.am | 2 +- diffs (32 lines): diff -r eb998ed0ab1a -r e9910d92b046 ChangeLog --- a/ChangeLog Fri Oct 22 10:44:12 2010 -0400 +++ b/ChangeLog Mon Oct 25 12:14:33 2010 -0400 @@ -1,3 +1,9 @@ 2010-10-22 Omair Majid + + * Makefile.am: + (clean-IcedTeaPlugin): Remove launcher folder first. + (clean-plugin): Removed called to remove launcher folder + 2010-10-22 Omair Majid * netx/net/sourceforge/jnlp/NetxPanel.java diff -r eb998ed0ab1a -r e9910d92b046 Makefile.am --- a/Makefile.am Fri Oct 22 10:44:12 2010 -0400 +++ b/Makefile.am Mon Oct 25 12:14:33 2010 -0400 @@ -188,6 +188,7 @@ PLUGIN_OBJECTS=IcedTeaNPPlugin.o IcedTea $(CC) $(LAUNCHER_LINK) $(PLUGIN_LAUNCHER_OBJECTS) clean-IcedTeaPlugin: + rm -rf $(PLUGIN_DIR)/launcher rm -f $(PLUGIN_DIR)/*.o rm -f $(PLUGIN_DIR)/IcedTeaPlugin.so if [ $(abs_top_srcdir) != $(abs_top_builddir) ]; then \ @@ -203,7 +204,6 @@ stamps/plugin.stamp: $(ICEDTEAPLUGIN_TAR touch stamps/plugin.stamp clean-plugin: $(ICEDTEAPLUGIN_CLEAN) - rm -rf $(PLUGIN_DIR)/launcher rm -f stamps/plugin.stamp liveconnect-source-files.txt: From doko at ubuntu.com Mon Oct 25 09:23:20 2010 From: doko at ubuntu.com (Matthias Klose) Date: Mon, 25 Oct 2010 18:23:20 +0200 Subject: openjdk6-mips port added to icedtea server In-Reply-To: <20101024063409.GA3359@loongson.cn> References: <1287738763.2755.50.camel@springer.wildebeest.org> <20101023094900.GA9736@loongson.cn> <504d12434baafd10854ffdc5aef06f7e.squirrel@webmail.mandriva.com.br> <20101024063409.GA3359@loongson.cn> Message-ID: <4CC5AEF8.40002@ubuntu.com> On 24.10.2010 08:34, LIU Qi wrote: > > o Pointers to download of images (for godson/loongson) of a system > > with gcc and binutils devel, running either 64 bits mode, big endian > > mode or another abi are also welcome, so that I can test all > > alternatives before considering it done > You could use the Debian mipsel system for the development. Loongson > support only little endian. That would be the mips port, not the mipsel port. Matthias From omajid at redhat.com Mon Oct 25 09:54:13 2010 From: omajid at redhat.com (Omair Majid) Date: Mon, 25 Oct 2010 12:54:13 -0400 Subject: [icedtea-web] RFC: unify localization code Message-ID: <4CC5B635.5030902@redhat.com> Hi, Netx contains a number of duplicate methods named "R" defined in various files that act as a wrapper for JNLPRuntime.getMessage(). The attached patch creates a new class Translate and moves all the "R" methods to it. This set of overloaded "R" methods is then statically imported anywhere that needs localized strings. Changelog: 2010-10-25 Omair Majid * net/sourceforge/jnlp/ExtensionDesc.java: Import Translate.R and use that. * net/sourceforge/jnlp/JNLPFile.java: Import Translate.R. (R): Remove. * net/sourceforge/jnlp/JREDesc.java: Import Translate.R. (checkHeapSize): Use R instead of JNLPRuntime.getMessage. * net/sourceforge/jnlp/Launcher.java: Import Translate.R. (R): Remove. * net/sourceforge/jnlp/Parser.java: Import Translate.R (R(String)): Remove. (R(String,Object)): Remove. (R(String,Object,Object)): Remove. (R(String,Object,Object,Object)): Remove. * net/sourceforge/jnlp/cache/CacheEntry.java: Import Translate.R (CacheEntry): Use R instead of JNLPRuntime.getMessage. * net/sourceforge/jnlp/cache/CacheUtil.java: Import Translate.R (R(String)): Remove. (R(String,Object)): Remove. * net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java: Import Translate.R and use that instead of JNLPRuntime.getMessage. * net/sourceforge/jnlp/runtime/Boot.java: Import Translate.R. (R(String)): Remove. (R(String, Object)): Remove. (run): Use R instead of JNLPRuntime.getMessage. * net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Import Translate.R. (R): Remove. * net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: Import Translate.R. Use it instead of JNLPRuntime.getMeesage. (R): Remove. * net/sourceforge/jnlp/security/AccessWarningPane.java: Import Translate.R. * net/sourceforge/jnlp/security/CertWarningPane.java: Likewise. * net/sourceforge/jnlp/security/HttpsCertVerifier.java: Import Translate.R. (R(String)): Remove. (R(String,String,String)): Remove. * net/sourceforge/jnlp/security/MoreInfoPane.java Import Translate.R. * net/sourceforge/jnlp/security/SecurityDialogPanel.java (R(String)): Remove. (R(String,Object)): Remove. * net/sourceforge/jnlp/services/ServiceUtil.java (R): Remove. * net/sourceforge/jnlp/services/SingleInstanceLock.java: Import Translate.R (R(String)): Remove. (R(String,Object)): Remove. * net/sourceforge/jnlp/tools/JarSigner.java: Import Translate.R. (R): Remove * net/sourceforge/jnlp/runtime/Translate.java: New file (R(String)): New method. (R(String,Object)): Likewise. (R(String,Object,Object)): Likewise. (R(String,Object,Object,Object)): Likewise. (R(String,Object[])): Likewise. Any comments? Thanks, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-web-unify-localization-methods.patch Type: text/x-patch Size: 19138 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101025/6e248139/icedtea-web-unify-localization-methods.patch From dbhole at redhat.com Mon Oct 25 10:22:45 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Mon, 25 Oct 2010 13:22:45 -0400 Subject: [icedtea-web] RFC: unify localization code In-Reply-To: <4CC5B635.5030902@redhat.com> References: <4CC5B635.5030902@redhat.com> Message-ID: <20101025172244.GA31205@redhat.com> * Omair Majid [2010-10-25 12:54]: > Hi, > > Netx contains a number of duplicate methods named "R" defined in > various files that act as a wrapper for JNLPRuntime.getMessage(). > The attached patch creates a new class Translate and moves all the > "R" methods to it. This set of overloaded "R" methods is then > statically imported anywhere that needs localized strings. > While it is being refactored, why not use varargs for R()? Deepak > Changelog: > 2010-10-25 Omair Majid > * net/sourceforge/jnlp/ExtensionDesc.java: Import Translate.R > and use that. > * net/sourceforge/jnlp/JNLPFile.java: Import Translate.R. > (R): Remove. > * net/sourceforge/jnlp/JREDesc.java: Import Translate.R. > (checkHeapSize): Use R instead of JNLPRuntime.getMessage. > * net/sourceforge/jnlp/Launcher.java: Import Translate.R. > (R): Remove. > * net/sourceforge/jnlp/Parser.java: Import Translate.R > (R(String)): Remove. > (R(String,Object)): Remove. > (R(String,Object,Object)): Remove. > (R(String,Object,Object,Object)): Remove. > * net/sourceforge/jnlp/cache/CacheEntry.java: Import > Translate.R > (CacheEntry): Use R instead of JNLPRuntime.getMessage. > * net/sourceforge/jnlp/cache/CacheUtil.java: Import > Translate.R > (R(String)): Remove. > (R(String,Object)): Remove. > * net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java: > Import Translate.R and use that instead of > JNLPRuntime.getMessage. > * net/sourceforge/jnlp/runtime/Boot.java: Import Translate.R. > (R(String)): Remove. > (R(String, Object)): Remove. > (run): Use R instead of JNLPRuntime.getMessage. > * net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Import > Translate.R. > (R): Remove. > * net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: > Import Translate.R. Use it instead of JNLPRuntime.getMeesage. > (R): Remove. > * net/sourceforge/jnlp/security/AccessWarningPane.java: > Import Translate.R. > * net/sourceforge/jnlp/security/CertWarningPane.java: > Likewise. > * net/sourceforge/jnlp/security/HttpsCertVerifier.java: > Import Translate.R. > (R(String)): Remove. > (R(String,String,String)): Remove. > * net/sourceforge/jnlp/security/MoreInfoPane.java > Import Translate.R. > * net/sourceforge/jnlp/security/SecurityDialogPanel.java > (R(String)): Remove. > (R(String,Object)): Remove. > * net/sourceforge/jnlp/services/ServiceUtil.java > (R): Remove. > * net/sourceforge/jnlp/services/SingleInstanceLock.java: > Import Translate.R > (R(String)): Remove. > (R(String,Object)): Remove. > * net/sourceforge/jnlp/tools/JarSigner.java: Import > Translate.R. > (R): Remove > * net/sourceforge/jnlp/runtime/Translate.java: New file > (R(String)): New method. > (R(String,Object)): Likewise. > (R(String,Object,Object)): Likewise. > (R(String,Object,Object,Object)): Likewise. > (R(String,Object[])): Likewise. > > Any comments? > > Thanks, > Omair > diff -r eb998ed0ab1a netx/net/sourceforge/jnlp/ExtensionDesc.java > --- a/netx/net/sourceforge/jnlp/ExtensionDesc.java Fri Oct 22 10:44:12 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/ExtensionDesc.java Mon Oct 25 12:38:47 2010 -0400 > @@ -17,13 +17,14 @@ > > package net.sourceforge.jnlp; > > +import static net.sourceforge.jnlp.runtime.Translate.R; > + > import java.io.*; > import java.net.*; > import java.util.*; > > import net.sourceforge.jnlp.runtime.JNLPRuntime; > > - > /** > * The extension element. > * > @@ -128,7 +129,7 @@ > > // check for it being an extension descriptor > if (!file.isComponent() && !file.isInstaller()) > - throw new ParseException(JNLPRuntime.getMessage("JInvalidExtensionDescriptor", new Object[] {name, location} )); > + throw new ParseException(R("JInvalidExtensionDescriptor", name, location)); > } > > } > diff -r eb998ed0ab1a netx/net/sourceforge/jnlp/JNLPFile.java > --- a/netx/net/sourceforge/jnlp/JNLPFile.java Fri Oct 22 10:44:12 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/JNLPFile.java Mon Oct 25 12:38:47 2010 -0400 > @@ -17,6 +17,8 @@ > > package net.sourceforge.jnlp; > > +import static net.sourceforge.jnlp.runtime.Translate.R; > + > import java.io.IOException; > import java.io.InputStream; > import java.io.Reader; > @@ -32,6 +34,7 @@ > import net.sourceforge.jnlp.cache.UpdatePolicy; > import net.sourceforge.jnlp.runtime.JNLPRuntime; > > + > /** > * Provides methods to access the information in a Java Network > * Launching Protocol (JNLP) file. The Java Network Launching > @@ -60,8 +63,6 @@ > // todo: currently does not filter resources by jvm version. > // > > - private static String R(String key) { return JNLPRuntime.getMessage(key); } > - > /** the location this JNLP file was created from */ > protected URL sourceLocation = null; > > diff -r eb998ed0ab1a netx/net/sourceforge/jnlp/JREDesc.java > --- a/netx/net/sourceforge/jnlp/JREDesc.java Fri Oct 22 10:44:12 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/JREDesc.java Mon Oct 25 12:38:47 2010 -0400 > @@ -17,12 +17,12 @@ > > package net.sourceforge.jnlp; > > +import static net.sourceforge.jnlp.runtime.Translate.R; > + > import java.io.*; > import java.net.*; > import java.util.*; > > -import net.sourceforge.jnlp.runtime.JNLPRuntime; > - > /** > * The J2SE/Java element. > * > @@ -143,7 +143,7 @@ > if ((lastChar < '0' || lastChar > '9')) { > lastCharacterIsDigit = false; > if (lastChar != 'k' && lastChar!= 'm' ) { > - throw new ParseException(JNLPRuntime.getMessage("PBadHeapSize",new Object[] {heapSize})); > + throw new ParseException(R("PBadHeapSize", heapSize)); > } > } > > @@ -157,7 +157,7 @@ > // check that the number is a number! > Integer.valueOf(size); > } catch (NumberFormatException numberFormat) { > - throw new ParseException(JNLPRuntime.getMessage("PBadHeapSize", new Object[] {heapSize}), numberFormat); > + throw new ParseException(R("PBadHeapSize", heapSize), numberFormat); > } > > } > diff -r eb998ed0ab1a netx/net/sourceforge/jnlp/Launcher.java > --- a/netx/net/sourceforge/jnlp/Launcher.java Fri Oct 22 10:44:12 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/Launcher.java Mon Oct 25 12:38:47 2010 -0400 > @@ -17,6 +17,8 @@ > > package net.sourceforge.jnlp; > > +import static net.sourceforge.jnlp.runtime.Translate.R; > + > import java.applet.Applet; > import java.awt.Container; > import java.io.File; > @@ -51,6 +53,7 @@ > > import sun.awt.SunToolkit; > > + > /** > * Launches JNLPFiles either in the foreground or background.

    > * > @@ -67,9 +70,6 @@ > > // defines class Launcher.BgRunner, Launcher.TgThread > > - /** shortcut for resources */ > - private static String R(String key) { return JNLPRuntime.getMessage(key); } > - > /** shared thread group */ > /*package*/ static final ThreadGroup mainGroup = new ThreadGroup(R("LAllThreadGroup")); > > diff -r eb998ed0ab1a netx/net/sourceforge/jnlp/Parser.java > --- a/netx/net/sourceforge/jnlp/Parser.java Fri Oct 22 10:44:12 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/Parser.java Mon Oct 25 12:38:47 2010 -0400 > @@ -18,6 +18,8 @@ > > package net.sourceforge.jnlp; > > +import static net.sourceforge.jnlp.runtime.Translate.R; > + > import java.io.*; > import java.net.*; > import java.util.*; > @@ -27,10 +29,8 @@ > //import gd.xml.tiny.*; > import net.sourceforge.jnlp.UpdateDesc.Check; > import net.sourceforge.jnlp.UpdateDesc.Policy; > -import net.sourceforge.jnlp.runtime.JNLPRuntime; > import net.sourceforge.nanoxml.*; > > - > /** > * Contains methods to parse an XML document into a JNLPFile. > * Implements JNLP specification version 1.0. > @@ -40,12 +40,6 @@ > */ > class Parser { > > - private static String R(String key) { return JNLPRuntime.getMessage(key); } > - private static String R(String key, Object p1) { return R(key, p1, null); } > - private static String R(String key, Object p1, Object p2) { return R(key, p1, p2, null); } > - private static String R(String key, Object p1, Object p2, Object p3) { return JNLPRuntime.getMessage(key, new Object[] { p1, p2, p3 }); } > - > - > // defines netx.jnlp.Node class if using Tiny XML or Nano XML > > // Currently uses the Nano XML parse. Search for "SAX" or > diff -r eb998ed0ab1a netx/net/sourceforge/jnlp/cache/CacheEntry.java > --- a/netx/net/sourceforge/jnlp/cache/CacheEntry.java Fri Oct 22 10:44:12 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/cache/CacheEntry.java Mon Oct 25 12:38:47 2010 -0400 > @@ -17,6 +17,8 @@ > > package net.sourceforge.jnlp.cache; > > +import static net.sourceforge.jnlp.runtime.Translate.R; > + > import java.io.*; > import java.net.*; > import java.util.*; > @@ -60,7 +62,7 @@ > File infoFile = CacheUtil.getCacheFile(location, version); > infoFile = new File(infoFile.getPath()+".info"); // replace with something that can't be clobbered > > - properties = new PropertiesFile(infoFile, JNLPRuntime.getMessage("CAutoGen")); > + properties = new PropertiesFile(infoFile, R("CAutoGen")); > } > > /** > diff -r eb998ed0ab1a netx/net/sourceforge/jnlp/cache/CacheUtil.java > --- a/netx/net/sourceforge/jnlp/cache/CacheUtil.java Fri Oct 22 10:44:12 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/cache/CacheUtil.java Mon Oct 25 12:38:47 2010 -0400 > @@ -17,6 +17,8 @@ > > package net.sourceforge.jnlp.cache; > > +import static net.sourceforge.jnlp.runtime.Translate.R; > + > import java.io.*; > import java.net.*; > import java.nio.channels.FileChannel; > @@ -38,14 +40,6 @@ > */ > public class CacheUtil { > > - private static String R(String key) { > - return JNLPRuntime.getMessage(key); > - } > - > - private static String R(String key, Object param) { > - return JNLPRuntime.getMessage(key, new Object[] {param}); > - } > - > /** > * Compares a URL using string compare of its protocol, host, > * port, path, query, and anchor. This method avoids the host > diff -r eb998ed0ab1a netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java > --- a/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java Fri Oct 22 10:44:12 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java Mon Oct 25 12:38:47 2010 -0400 > @@ -17,6 +17,8 @@ > > package net.sourceforge.jnlp.cache; > > +import static net.sourceforge.jnlp.runtime.Translate.R; > + > import java.awt.*; > import java.awt.event.*; > import java.net.*; > @@ -49,8 +51,8 @@ > // todo: this should be synchronized at some point but conflicts > // aren't very likely. > > - private static String downloading = JNLPRuntime.getMessage("CDownloading"); > - private static String complete = JNLPRuntime.getMessage("CComplete"); > + private static String downloading = R("CDownloading"); > + private static String complete = R("CComplete"); > > /** time to wait after completing but before window closes */ > private static final int CLOSE_DELAY = 750; > diff -r eb998ed0ab1a netx/net/sourceforge/jnlp/runtime/Boot.java > --- a/netx/net/sourceforge/jnlp/runtime/Boot.java Fri Oct 22 10:44:12 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/Boot.java Mon Oct 25 12:38:47 2010 -0400 > @@ -17,6 +17,8 @@ > > package net.sourceforge.jnlp.runtime; > > +import static net.sourceforge.jnlp.runtime.Translate.R; > + > import java.io.File; > import java.io.IOException; > import java.net.MalformedURLException; > @@ -63,9 +65,6 @@ > // todo: decide whether a spawned netx (external launch) > // should inherit the same options as this instance (store argv?) > > - private static String R(String key) { return JNLPRuntime.getMessage(key); } > - private static String R(String key, Object param) { return JNLPRuntime.getMessage(key, new Object[] {param}); } > - > private static final String version = "0.5"; > > /** the text to display before launching the about link */ > @@ -225,8 +224,7 @@ > if (JNLPRuntime.isDebug()) > ex.printStackTrace(); > > - fatalError(JNLPRuntime.getMessage("RUnexpected", > - new Object[] {ex.toString(), ex.getStackTrace()[0]} )); > + fatalError(R("RUnexpected", ex.toString(), ex.getStackTrace()[0])); > } > > return null; > diff -r eb998ed0ab1a netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Fri Oct 22 10:44:12 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Mon Oct 25 12:38:47 2010 -0400 > @@ -17,6 +17,8 @@ > > package net.sourceforge.jnlp.runtime; > > +import static net.sourceforge.jnlp.runtime.Translate.R; > + > import java.io.File; > import java.io.FileOutputStream; > import java.io.IOException; > @@ -78,9 +80,6 @@ > // extension classes too so that main file classes can load > // resources in an extension. > > - /** shortcut for resources */ > - private static String R(String key) { return JNLPRuntime.getMessage(key); } > - > /** map from JNLPFile url to shared classloader */ > private static Map urlToLoader = > new HashMap(); // never garbage collected! > diff -r eb998ed0ab1a netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java Fri Oct 22 10:44:12 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java Mon Oct 25 12:38:47 2010 -0400 > @@ -17,6 +17,8 @@ > > package net.sourceforge.jnlp.runtime; > > +import static net.sourceforge.jnlp.runtime.Translate.R; > + > import java.awt.Frame; > import java.awt.Window; > import java.awt.event.WindowAdapter; > @@ -88,14 +90,12 @@ > // another way for different apps to have different properties > // in java.lang.Sytem with the same names. > > - private static String R(String key) { return JNLPRuntime.getMessage(key); } > - > /** only class that can exit the JVM, if set */ > private Object exitClass = null; > > /** this exception prevents exiting the JVM */ > private SecurityException closeAppEx = // making here prevents huge stack traces > - new SecurityException(JNLPRuntime.getMessage("RShutdown")); > + new SecurityException(R("RShutdown")); > > /** weak list of windows created */ > private WeakList weakWindows = new WeakList(); > diff -r eb998ed0ab1a netx/net/sourceforge/jnlp/runtime/Translate.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/jnlp/runtime/Translate.java Mon Oct 25 12:38:47 2010 -0400 > @@ -0,0 +1,59 @@ > +// Copyright (C) 2010 Red Hat, Inc. > +// > +// This library is free software; you can redistribute it and/or > +// modify it under the terms of the GNU Lesser General Public > +// License as published by the Free Software Foundation; either > +// version 2.1 of the License, or (at your option) any later version. > +// > +// This library is distributed in the hope that it will be useful, > +// but WITHOUT ANY WARRANTY; without even the implied warranty of > +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > +// Lesser General Public License for more details. > +// > +// You should have received a copy of the GNU Lesser General Public > +// License along with this library; if not, write to the Free Software > +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. > + > +package net.sourceforge.jnlp.runtime; > + > +/** > + * Utility class to provide simple methods to help localize messages > + */ > +public class Translate { > + > + /** > + * @return the localized string for the message > + */ > + public static String R(String message) { > + return JNLPRuntime.getMessage(message); > + } > + > + /** > + * @return the localized string for the message > + */ > + public static String R(String message, Object param) { > + return JNLPRuntime.getMessage(message, new Object[] { param }); > + } > + > + /** > + * @return the localized string for the message > + */ > + public static String R(String message, Object param1, Object param2) { > + return JNLPRuntime.getMessage(message, new Object[] { param1, param2 }); > + } > + > + /** > + * @return the localized string for the message > + */ > + public static String R(String message, Object param1, Object param2, Object param3) { > + return JNLPRuntime.getMessage(message, new Object[] { param1, param2, param3 }); > + } > + > + /** > + * @return the localized string for the message > + */ > + public static String R(String message, Object[] params) { > + return JNLPRuntime.getMessage(message, params); > + } > + > +} > diff -r eb998ed0ab1a netx/net/sourceforge/jnlp/security/AccessWarningPane.java > --- a/netx/net/sourceforge/jnlp/security/AccessWarningPane.java Fri Oct 22 10:44:12 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/security/AccessWarningPane.java Mon Oct 25 12:38:47 2010 -0400 > @@ -37,6 +37,8 @@ > > package net.sourceforge.jnlp.security; > > +import static net.sourceforge.jnlp.runtime.Translate.R; > + > import java.awt.BorderLayout; > import java.awt.Color; > import java.awt.Dimension; > diff -r eb998ed0ab1a netx/net/sourceforge/jnlp/security/CertWarningPane.java > --- a/netx/net/sourceforge/jnlp/security/CertWarningPane.java Fri Oct 22 10:44:12 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/security/CertWarningPane.java Mon Oct 25 12:38:47 2010 -0400 > @@ -37,6 +37,8 @@ > > package net.sourceforge.jnlp.security; > > +import static net.sourceforge.jnlp.runtime.Translate.R; > + > import java.awt.BorderLayout; > import java.awt.Color; > import java.awt.Dimension; > diff -r eb998ed0ab1a netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java > --- a/netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java Fri Oct 22 10:44:12 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java Mon Oct 25 12:38:47 2010 -0400 > @@ -37,6 +37,8 @@ > > package net.sourceforge.jnlp.security; > > +import static net.sourceforge.jnlp.runtime.Translate.R; > + > import java.io.IOException; > import java.security.cert.CertPath; > import java.security.cert.Certificate; > @@ -50,7 +52,6 @@ > import java.util.Collection; > import java.util.List; > > -import net.sourceforge.jnlp.runtime.JNLPRuntime; > import net.sourceforge.jnlp.tools.KeyTool; > import sun.security.util.DerValue; > import sun.security.util.HostnameChecker; > @@ -198,14 +199,6 @@ > details.add(detail); > } > > - private static String R(String key) { > - return JNLPRuntime.getMessage(key); > - } > - > - private static String R(String key, String arg1, String arg2) { > - return JNLPRuntime.getMessage(key, new Object[] { arg1, arg2 }); > - } > - > public Certificate getPublisher() { > if (chain.length > 0) > return (Certificate)chain[0]; > diff -r eb998ed0ab1a netx/net/sourceforge/jnlp/security/MoreInfoPane.java > --- a/netx/net/sourceforge/jnlp/security/MoreInfoPane.java Fri Oct 22 10:44:12 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/security/MoreInfoPane.java Mon Oct 25 12:38:47 2010 -0400 > @@ -37,6 +37,8 @@ > > package net.sourceforge.jnlp.security; > > +import static net.sourceforge.jnlp.runtime.Translate.R; > + > import java.awt.BorderLayout; > import java.awt.Dimension; > import java.awt.GridLayout; > diff -r eb998ed0ab1a netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java > --- a/netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java Fri Oct 22 10:44:12 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java Mon Oct 25 12:38:47 2010 -0400 > @@ -44,9 +44,6 @@ > import javax.swing.JComponent; > import javax.swing.JPanel; > > - > -import net.sourceforge.jnlp.runtime.JNLPRuntime; > - > /** > * Provides a JPanel for use in JNLP warning dialogs. > */ > @@ -69,18 +66,6 @@ > this.setLayout(new BorderLayout()); > } > > - /* > - * String translation functions > - */ > - > - protected static String R(String key) { > - return JNLPRuntime.getMessage(key); > - } > - > - protected static String R(String key, Object param) { > - return JNLPRuntime.getMessage(key, new Object[] {param}); > - } > - > /** > * Needed to get word wrap working in JLabels. > */ > diff -r eb998ed0ab1a netx/net/sourceforge/jnlp/services/ServiceUtil.java > --- a/netx/net/sourceforge/jnlp/services/ServiceUtil.java Fri Oct 22 10:44:12 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/services/ServiceUtil.java Mon Oct 25 12:38:47 2010 -0400 > @@ -53,10 +53,6 @@ > */ > public class ServiceUtil { > > - private static String R(String key) { > - return JNLPRuntime.getMessage(key); > - } > - > /** > * Returns the BasicService reference, or null if the service is > * unavailable. > diff -r eb998ed0ab1a netx/net/sourceforge/jnlp/services/SingleInstanceLock.java > --- a/netx/net/sourceforge/jnlp/services/SingleInstanceLock.java Fri Oct 22 10:44:12 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/services/SingleInstanceLock.java Mon Oct 25 12:38:47 2010 -0400 > @@ -16,6 +16,8 @@ > > package net.sourceforge.jnlp.services; > > +import static net.sourceforge.jnlp.runtime.Translate.R; > + > import java.io.BufferedReader; > import java.io.BufferedWriter; > import java.io.File; > @@ -183,12 +185,4 @@ > return (display == null) ? "" : display; > } > > - private static String R(String key) { > - return JNLPRuntime.getMessage(key); > - } > - > - private static String R(String key, Object param) { > - return JNLPRuntime.getMessage(key, new Object[] { param }); > - } > - > } > diff -r eb998ed0ab1a netx/net/sourceforge/jnlp/tools/JarSigner.java > --- a/netx/net/sourceforge/jnlp/tools/JarSigner.java Fri Oct 22 10:44:12 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/tools/JarSigner.java Mon Oct 25 12:38:47 2010 -0400 > @@ -25,6 +25,8 @@ > > package net.sourceforge.jnlp.tools; > > +import static net.sourceforge.jnlp.runtime.Translate.R; > + > import java.io.*; > import java.util.*; > import java.util.zip.*; > @@ -40,7 +42,6 @@ > > import net.sourceforge.jnlp.*; > import net.sourceforge.jnlp.cache.*; > -import net.sourceforge.jnlp.runtime.*; > import net.sourceforge.jnlp.security.*; > > /** > @@ -52,10 +53,6 @@ > > public class JarSigner implements CertVerifier { > > - private static String R(String key) { > - return JNLPRuntime.getMessage(key); > - } > - > private static final Collator collator = Collator.getInstance(); > static { > // this is for case insensitive string comparisions From omajid at redhat.com Mon Oct 25 10:37:18 2010 From: omajid at redhat.com (Omair Majid) Date: Mon, 25 Oct 2010 13:37:18 -0400 Subject: [icedtea-web] RFC: get the security handler in a privileged operation Message-ID: <4CC5C04E.7050702@redhat.com> Hi, The attached patch ensures that posting a security message is done with full privileges. This is being done already in the EDT (EventDispatchThread) case, but not in the non-EDT case. ChangeLog: 2010-10-25 Omair Majid * netx/net/sourceforge/jnlp/security/SecurityWarning.java (getUserResponse): Get the SecurityDialogHandler with full prvileges. Any objections? Thanks, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-web-get-handler-as-privileged.patch Type: text/x-patch Size: 816 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101025/468f0ca2/icedtea-web-get-handler-as-privileged.patch From dbhole at redhat.com Mon Oct 25 10:45:44 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Mon, 25 Oct 2010 13:45:44 -0400 Subject: [icedtea-web] RFC: get the security handler in a privileged operation In-Reply-To: <4CC5C04E.7050702@redhat.com> References: <4CC5C04E.7050702@redhat.com> Message-ID: <20101025174543.GB31205@redhat.com> * Omair Majid [2010-10-25 13:37]: > Hi, > > The attached patch ensures that posting a security message is done > with full privileges. This is being done already in the EDT > (EventDispatchThread) case, but not in the non-EDT case. > Are there any problems if it doesn't have full permissions? I'd rather give it less permissions than more unless really needed... If not needed, the doProvileged() from EDT should be removed as well. Deepak > ChangeLog: > 2010-10-25 Omair Majid > > * netx/net/sourceforge/jnlp/security/SecurityWarning.java > (getUserResponse): Get the SecurityDialogHandler with full > prvileges. > > Any objections? > > Thanks, > Omair > diff -r e9910d92b046 netx/net/sourceforge/jnlp/security/SecurityWarning.java > --- a/netx/net/sourceforge/jnlp/security/SecurityWarning.java Mon Oct 25 12:14:33 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/security/SecurityWarning.java Mon Oct 25 13:31:30 2010 -0400 > @@ -278,7 +278,13 @@ > */ > message.toDispose = null; > message.lock = new Semaphore(0); > - JNLPRuntime.getSecurityDialogHandler().postMessage(message); > + AccessController.doPrivileged(new PrivilegedAction() { > + @Override > + public Void run() { > + JNLPRuntime.getSecurityDialogHandler().postMessage(message); > + return null; > + } > + }); > > boolean done = false; > while (!done) { From omajid at redhat.com Mon Oct 25 11:09:59 2010 From: omajid at redhat.com (Omair Majid) Date: Mon, 25 Oct 2010 14:09:59 -0400 Subject: [icedtea-web] RFC: get the security handler in a privileged operation In-Reply-To: <20101025174543.GB31205@redhat.com> References: <4CC5C04E.7050702@redhat.com> <20101025174543.GB31205@redhat.com> Message-ID: <4CC5C7F7.3050104@redhat.com> On 10/25/2010 01:45 PM, Deepak Bhole wrote: > * Omair Majid [2010-10-25 13:37]: >> Hi, >> >> The attached patch ensures that posting a security message is done >> with full privileges. This is being done already in the EDT >> (EventDispatchThread) case, but not in the non-EDT case. >> > > Are there any problems if it doesn't have full permissions? I'd rather > give it less permissions than more unless really needed... > JNLPRuntime.getSecurityDialogHandler() throws a SecurityException if the caller does not have AllPerissions. If SecurityWarning.* is ever called from something which does not have full permissions, it will fail. However, on further going through code, everything that currently calls SecurityWarning.* is (as far as I can tell) fully privileged (is this a good idea?). So avoiding this doPrivileged() should not cause a problem. > If not needed, the doProvileged() from EDT should be removed as well. > I will do that then. > Deepak > >> ChangeLog: >> 2010-10-25 Omair Majid >> >> * netx/net/sourceforge/jnlp/security/SecurityWarning.java >> (getUserResponse): Get the SecurityDialogHandler with full >> prvileges. >> >> Any objections? >> >> Thanks, >> Omair > >> diff -r e9910d92b046 netx/net/sourceforge/jnlp/security/SecurityWarning.java >> --- a/netx/net/sourceforge/jnlp/security/SecurityWarning.java Mon Oct 25 12:14:33 2010 -0400 >> +++ b/netx/net/sourceforge/jnlp/security/SecurityWarning.java Mon Oct 25 13:31:30 2010 -0400 >> @@ -278,7 +278,13 @@ >> */ >> message.toDispose = null; >> message.lock = new Semaphore(0); >> - JNLPRuntime.getSecurityDialogHandler().postMessage(message); >> + AccessController.doPrivileged(new PrivilegedAction() { >> + @Override >> + public Void run() { >> + JNLPRuntime.getSecurityDialogHandler().postMessage(message); >> + return null; >> + } >> + }); >> >> boolean done = false; >> while (!done) { > From dbhole at redhat.com Mon Oct 25 11:12:00 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Mon, 25 Oct 2010 14:12:00 -0400 Subject: [icedtea-web] RFC: get the security handler in a privileged operation In-Reply-To: <4CC5C7F7.3050104@redhat.com> References: <4CC5C04E.7050702@redhat.com> <20101025174543.GB31205@redhat.com> <4CC5C7F7.3050104@redhat.com> Message-ID: <20101025181158.GC31205@redhat.com> * Omair Majid [2010-10-25 14:10]: > On 10/25/2010 01:45 PM, Deepak Bhole wrote: > >* Omair Majid [2010-10-25 13:37]: > >>Hi, > >> > >>The attached patch ensures that posting a security message is done > >>with full privileges. This is being done already in the EDT > >>(EventDispatchThread) case, but not in the non-EDT case. > >> > > > >Are there any problems if it doesn't have full permissions? I'd rather > >give it less permissions than more unless really needed... > > > > JNLPRuntime.getSecurityDialogHandler() throws a SecurityException if > the caller does not have AllPerissions. If SecurityWarning.* is ever > called from something which does not have full permissions, it will > fail. > > However, on further going through code, everything that currently > calls SecurityWarning.* is (as far as I can tell) fully privileged > (is this a good idea?). So avoiding this doPrivileged() should not > cause a problem. > It should only be privileged if it needs to be. Unnecessary privileged calls can cause security issues down the road if the code at the callee end is modified without due consideration. Cheers, Deepak > >If not needed, the doProvileged() from EDT should be removed as well. > > > > I will do that then. > > >Deepak > > > >>ChangeLog: > >>2010-10-25 Omair Majid > >> > >> * netx/net/sourceforge/jnlp/security/SecurityWarning.java > >> (getUserResponse): Get the SecurityDialogHandler with full > >> prvileges. > >> > >>Any objections? > >> > >>Thanks, > >>Omair > > > >>diff -r e9910d92b046 netx/net/sourceforge/jnlp/security/SecurityWarning.java > >>--- a/netx/net/sourceforge/jnlp/security/SecurityWarning.java Mon Oct 25 12:14:33 2010 -0400 > >>+++ b/netx/net/sourceforge/jnlp/security/SecurityWarning.java Mon Oct 25 13:31:30 2010 -0400 > >>@@ -278,7 +278,13 @@ > >> */ > >> message.toDispose = null; > >> message.lock = new Semaphore(0); > >>- JNLPRuntime.getSecurityDialogHandler().postMessage(message); > >>+ AccessController.doPrivileged(new PrivilegedAction() { > >>+ @Override > >>+ public Void run() { > >>+ JNLPRuntime.getSecurityDialogHandler().postMessage(message); > >>+ return null; > >>+ } > >>+ }); > >> > >> boolean done = false; > >> while (!done) { > > > From omajid at redhat.com Mon Oct 25 11:20:35 2010 From: omajid at redhat.com (Omair Majid) Date: Mon, 25 Oct 2010 14:20:35 -0400 Subject: [icedtea-web] RFC: unify localization code In-Reply-To: <20101025172244.GA31205@redhat.com> References: <4CC5B635.5030902@redhat.com> <20101025172244.GA31205@redhat.com> Message-ID: <4CC5CA73.6080204@redhat.com> On 10/25/2010 01:22 PM, Deepak Bhole wrote: > * Omair Majid [2010-10-25 12:54]: >> Hi, >> >> Netx contains a number of duplicate methods named "R" defined in >> various files that act as a wrapper for JNLPRuntime.getMessage(). >> The attached patch creates a new class Translate and moves all the >> "R" methods to it. This set of overloaded "R" methods is then >> statically imported anywhere that needs localized strings. >> > > While it is being refactored, why not use varargs for R()? > Fixed. Changelog: 2010-10-25 Omair Majid * net/sourceforge/jnlp/ExtensionDesc.java: Import Translator.R and use that. * net/sourceforge/jnlp/JNLPFile.java: Import Translator.R. (R): Remove. * net/sourceforge/jnlp/JREDesc.java: Import Translator.R. (checkHeapSize): Use R instead of JNLPRuntime.getMessage. * net/sourceforge/jnlp/Launcher.java: Import Translator.R. (R): Remove. * net/sourceforge/jnlp/Parser.java: Import Translator.R (R(String)): Remove. (R(String,Object)): Remove. (R(String,Object,Object)): Remove. (R(String,Object,Object,Object)): Remove. * net/sourceforge/jnlp/cache/CacheEntry.java: Import Translator.R (CacheEntry): Use R instead of JNLPRuntime.getMessage. * net/sourceforge/jnlp/cache/CacheUtil.java: Import Translator.R (R(String)): Remove. (R(String,Object)): Remove. * net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java: Import Translator.R and use that instead of JNLPRuntime.getMessage. * net/sourceforge/jnlp/runtime/Boot.java: Import Translator.R. (R(String)): Remove. (R(String, Object)): Remove. (run): Use R instead of JNLPRuntime.getMessage. * net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Import Translator.R. (R): Remove. * net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: Import Translator.R. Use it instead of JNLPRuntime.getMeesage. (R): Remove. * net/sourceforge/jnlp/security/AccessWarningPane.java: Import Translator.R. * net/sourceforge/jnlp/security/CertWarningPane.java: Likewise. * net/sourceforge/jnlp/security/HttpsCertVerifier.java: Import Translator.R. (R(String)): Remove. (R(String,String,String)): Remove. * net/sourceforge/jnlp/security/MoreInfoPane.java Import Translator.R. * net/sourceforge/jnlp/security/SecurityDialogPanel.java (R(String)): Remove. (R(String,Object)): Remove. * net/sourceforge/jnlp/services/ServiceUtil.java (R): Remove. * net/sourceforge/jnlp/services/SingleInstanceLock.java: Import Translator.R (R(String)): Remove. (R(String,Object)): Remove. * net/sourceforge/jnlp/tools/JarSigner.java: Import Translator.R. (R): Remove * net/sourceforge/jnlp/runtime/Translator.java: New file (R(String)): New method. (R(String,Object)): Likewise. (R(String,Object,Object)): Likewise. (R(String,Object,Object,Object)): Likewise. (R(String,Object[])): Likewise. Thanks, Omair From omajid at redhat.com Mon Oct 25 11:22:28 2010 From: omajid at redhat.com (Omair Majid) Date: Mon, 25 Oct 2010 14:22:28 -0400 Subject: [icedtea-web] RFC: unify localization code In-Reply-To: <4CC5CA73.6080204@redhat.com> References: <4CC5B635.5030902@redhat.com> <20101025172244.GA31205@redhat.com> <4CC5CA73.6080204@redhat.com> Message-ID: <4CC5CAE4.8030300@redhat.com> On 10/25/2010 02:20 PM, Omair Majid wrote: > On 10/25/2010 01:22 PM, Deepak Bhole wrote: >> * Omair Majid [2010-10-25 12:54]: >>> Hi, >>> >>> Netx contains a number of duplicate methods named "R" defined in >>> various files that act as a wrapper for JNLPRuntime.getMessage(). >>> The attached patch creates a new class Translate and moves all the >>> "R" methods to it. This set of overloaded "R" methods is then >>> statically imported anywhere that needs localized strings. >>> >> >> While it is being refactored, why not use varargs for R()? >> > > Fixed. Grr.. Accceidentally sent without finishing email :( Here is the attachment. Thanks, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-web-unify-localization-methods-02.patch Type: text/x-patch Size: 18828 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101025/f6335df6/icedtea-web-unify-localization-methods-02.patch From dbhole at redhat.com Mon Oct 25 11:24:46 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Mon, 25 Oct 2010 14:24:46 -0400 Subject: [icedtea-web] RFC: unify localization code In-Reply-To: <4CC5CAE4.8030300@redhat.com> References: <4CC5B635.5030902@redhat.com> <20101025172244.GA31205@redhat.com> <4CC5CA73.6080204@redhat.com> <4CC5CAE4.8030300@redhat.com> Message-ID: <20101025182445.GD31205@redhat.com> * Omair Majid [2010-10-25 14:22]: > On 10/25/2010 02:20 PM, Omair Majid wrote: > >On 10/25/2010 01:22 PM, Deepak Bhole wrote: > >>* Omair Majid [2010-10-25 12:54]: > >>>Hi, > >>> > >>>Netx contains a number of duplicate methods named "R" defined in > >>>various files that act as a wrapper for JNLPRuntime.getMessage(). > >>>The attached patch creates a new class Translate and moves all the > >>>"R" methods to it. This set of overloaded "R" methods is then > >>>statically imported anywhere that needs localized strings. > >>> > >> > >>While it is being refactored, why not use varargs for R()? > >> > > > >Fixed. > > Grr.. Accceidentally sent without finishing email :( > > Here is the attachment. > Looks good. Okay for commit to HEAD. Deepak > Thanks, > Omair > > diff -r e9910d92b046 netx/net/sourceforge/jnlp/ExtensionDesc.java > --- a/netx/net/sourceforge/jnlp/ExtensionDesc.java Mon Oct 25 12:14:33 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/ExtensionDesc.java Mon Oct 25 14:15:45 2010 -0400 > @@ -17,13 +17,14 @@ > > package net.sourceforge.jnlp; > > +import static net.sourceforge.jnlp.runtime.Translator.R; > + > import java.io.*; > import java.net.*; > import java.util.*; > > import net.sourceforge.jnlp.runtime.JNLPRuntime; > > - > /** > * The extension element. > * > @@ -128,7 +129,7 @@ > > // check for it being an extension descriptor > if (!file.isComponent() && !file.isInstaller()) > - throw new ParseException(JNLPRuntime.getMessage("JInvalidExtensionDescriptor", new Object[] {name, location} )); > + throw new ParseException(R("JInvalidExtensionDescriptor", name, location)); > } > > } > diff -r e9910d92b046 netx/net/sourceforge/jnlp/JNLPFile.java > --- a/netx/net/sourceforge/jnlp/JNLPFile.java Mon Oct 25 12:14:33 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/JNLPFile.java Mon Oct 25 14:15:45 2010 -0400 > @@ -17,6 +17,8 @@ > > package net.sourceforge.jnlp; > > +import static net.sourceforge.jnlp.runtime.Translator.R; > + > import java.io.IOException; > import java.io.InputStream; > import java.io.Reader; > @@ -32,6 +34,7 @@ > import net.sourceforge.jnlp.cache.UpdatePolicy; > import net.sourceforge.jnlp.runtime.JNLPRuntime; > > + > /** > * Provides methods to access the information in a Java Network > * Launching Protocol (JNLP) file. The Java Network Launching > @@ -60,8 +63,6 @@ > // todo: currently does not filter resources by jvm version. > // > > - private static String R(String key) { return JNLPRuntime.getMessage(key); } > - > /** the location this JNLP file was created from */ > protected URL sourceLocation = null; > > diff -r e9910d92b046 netx/net/sourceforge/jnlp/JREDesc.java > --- a/netx/net/sourceforge/jnlp/JREDesc.java Mon Oct 25 12:14:33 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/JREDesc.java Mon Oct 25 14:15:45 2010 -0400 > @@ -17,12 +17,12 @@ > > package net.sourceforge.jnlp; > > +import static net.sourceforge.jnlp.runtime.Translator.R; > + > import java.io.*; > import java.net.*; > import java.util.*; > > -import net.sourceforge.jnlp.runtime.JNLPRuntime; > - > /** > * The J2SE/Java element. > * > @@ -143,7 +143,7 @@ > if ((lastChar < '0' || lastChar > '9')) { > lastCharacterIsDigit = false; > if (lastChar != 'k' && lastChar!= 'm' ) { > - throw new ParseException(JNLPRuntime.getMessage("PBadHeapSize",new Object[] {heapSize})); > + throw new ParseException(R("PBadHeapSize", heapSize)); > } > } > > @@ -157,7 +157,7 @@ > // check that the number is a number! > Integer.valueOf(size); > } catch (NumberFormatException numberFormat) { > - throw new ParseException(JNLPRuntime.getMessage("PBadHeapSize", new Object[] {heapSize}), numberFormat); > + throw new ParseException(R("PBadHeapSize", heapSize), numberFormat); > } > > } > diff -r e9910d92b046 netx/net/sourceforge/jnlp/Launcher.java > --- a/netx/net/sourceforge/jnlp/Launcher.java Mon Oct 25 12:14:33 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/Launcher.java Mon Oct 25 14:15:45 2010 -0400 > @@ -17,6 +17,8 @@ > > package net.sourceforge.jnlp; > > +import static net.sourceforge.jnlp.runtime.Translator.R; > + > import java.applet.Applet; > import java.awt.Container; > import java.io.File; > @@ -51,6 +53,7 @@ > > import sun.awt.SunToolkit; > > + > /** > * Launches JNLPFiles either in the foreground or background.

    > * > @@ -67,9 +70,6 @@ > > // defines class Launcher.BgRunner, Launcher.TgThread > > - /** shortcut for resources */ > - private static String R(String key) { return JNLPRuntime.getMessage(key); } > - > /** shared thread group */ > /*package*/ static final ThreadGroup mainGroup = new ThreadGroup(R("LAllThreadGroup")); > > diff -r e9910d92b046 netx/net/sourceforge/jnlp/Parser.java > --- a/netx/net/sourceforge/jnlp/Parser.java Mon Oct 25 12:14:33 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/Parser.java Mon Oct 25 14:15:45 2010 -0400 > @@ -18,6 +18,8 @@ > > package net.sourceforge.jnlp; > > +import static net.sourceforge.jnlp.runtime.Translator.R; > + > import java.io.*; > import java.net.*; > import java.util.*; > @@ -27,10 +29,8 @@ > //import gd.xml.tiny.*; > import net.sourceforge.jnlp.UpdateDesc.Check; > import net.sourceforge.jnlp.UpdateDesc.Policy; > -import net.sourceforge.jnlp.runtime.JNLPRuntime; > import net.sourceforge.nanoxml.*; > > - > /** > * Contains methods to parse an XML document into a JNLPFile. > * Implements JNLP specification version 1.0. > @@ -40,12 +40,6 @@ > */ > class Parser { > > - private static String R(String key) { return JNLPRuntime.getMessage(key); } > - private static String R(String key, Object p1) { return R(key, p1, null); } > - private static String R(String key, Object p1, Object p2) { return R(key, p1, p2, null); } > - private static String R(String key, Object p1, Object p2, Object p3) { return JNLPRuntime.getMessage(key, new Object[] { p1, p2, p3 }); } > - > - > // defines netx.jnlp.Node class if using Tiny XML or Nano XML > > // Currently uses the Nano XML parse. Search for "SAX" or > diff -r e9910d92b046 netx/net/sourceforge/jnlp/cache/CacheEntry.java > --- a/netx/net/sourceforge/jnlp/cache/CacheEntry.java Mon Oct 25 12:14:33 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/cache/CacheEntry.java Mon Oct 25 14:15:45 2010 -0400 > @@ -17,6 +17,8 @@ > > package net.sourceforge.jnlp.cache; > > +import static net.sourceforge.jnlp.runtime.Translator.R; > + > import java.io.*; > import java.net.*; > import java.util.*; > @@ -60,7 +62,7 @@ > File infoFile = CacheUtil.getCacheFile(location, version); > infoFile = new File(infoFile.getPath()+".info"); // replace with something that can't be clobbered > > - properties = new PropertiesFile(infoFile, JNLPRuntime.getMessage("CAutoGen")); > + properties = new PropertiesFile(infoFile, R("CAutoGen")); > } > > /** > diff -r e9910d92b046 netx/net/sourceforge/jnlp/cache/CacheUtil.java > --- a/netx/net/sourceforge/jnlp/cache/CacheUtil.java Mon Oct 25 12:14:33 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/cache/CacheUtil.java Mon Oct 25 14:15:45 2010 -0400 > @@ -17,6 +17,8 @@ > > package net.sourceforge.jnlp.cache; > > +import static net.sourceforge.jnlp.runtime.Translator.R; > + > import java.io.*; > import java.net.*; > import java.nio.channels.FileChannel; > @@ -38,14 +40,6 @@ > */ > public class CacheUtil { > > - private static String R(String key) { > - return JNLPRuntime.getMessage(key); > - } > - > - private static String R(String key, Object param) { > - return JNLPRuntime.getMessage(key, new Object[] {param}); > - } > - > /** > * Compares a URL using string compare of its protocol, host, > * port, path, query, and anchor. This method avoids the host > diff -r e9910d92b046 netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java > --- a/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java Mon Oct 25 12:14:33 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java Mon Oct 25 14:15:45 2010 -0400 > @@ -17,6 +17,8 @@ > > package net.sourceforge.jnlp.cache; > > +import static net.sourceforge.jnlp.runtime.Translator.R; > + > import java.awt.*; > import java.awt.event.*; > import java.net.*; > @@ -49,8 +51,8 @@ > // todo: this should be synchronized at some point but conflicts > // aren't very likely. > > - private static String downloading = JNLPRuntime.getMessage("CDownloading"); > - private static String complete = JNLPRuntime.getMessage("CComplete"); > + private static String downloading = R("CDownloading"); > + private static String complete = R("CComplete"); > > /** time to wait after completing but before window closes */ > private static final int CLOSE_DELAY = 750; > diff -r e9910d92b046 netx/net/sourceforge/jnlp/runtime/Boot.java > --- a/netx/net/sourceforge/jnlp/runtime/Boot.java Mon Oct 25 12:14:33 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/Boot.java Mon Oct 25 14:15:45 2010 -0400 > @@ -17,6 +17,8 @@ > > package net.sourceforge.jnlp.runtime; > > +import static net.sourceforge.jnlp.runtime.Translator.R; > + > import java.io.File; > import java.io.IOException; > import java.net.MalformedURLException; > @@ -63,9 +65,6 @@ > // todo: decide whether a spawned netx (external launch) > // should inherit the same options as this instance (store argv?) > > - private static String R(String key) { return JNLPRuntime.getMessage(key); } > - private static String R(String key, Object param) { return JNLPRuntime.getMessage(key, new Object[] {param}); } > - > private static final String version = "0.5"; > > /** the text to display before launching the about link */ > @@ -225,8 +224,7 @@ > if (JNLPRuntime.isDebug()) > ex.printStackTrace(); > > - fatalError(JNLPRuntime.getMessage("RUnexpected", > - new Object[] {ex.toString(), ex.getStackTrace()[0]} )); > + fatalError(R("RUnexpected", ex.toString(), ex.getStackTrace()[0])); > } > > return null; > diff -r e9910d92b046 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Mon Oct 25 12:14:33 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Mon Oct 25 14:15:45 2010 -0400 > @@ -17,6 +17,8 @@ > > package net.sourceforge.jnlp.runtime; > > +import static net.sourceforge.jnlp.runtime.Translator.R; > + > import java.io.File; > import java.io.FileOutputStream; > import java.io.IOException; > @@ -78,9 +80,6 @@ > // extension classes too so that main file classes can load > // resources in an extension. > > - /** shortcut for resources */ > - private static String R(String key) { return JNLPRuntime.getMessage(key); } > - > /** map from JNLPFile url to shared classloader */ > private static Map urlToLoader = > new HashMap(); // never garbage collected! > diff -r e9910d92b046 netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Mon Oct 25 12:14:33 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Mon Oct 25 14:15:45 2010 -0400 > @@ -522,7 +522,7 @@ > * > * @param args the formatting arguments to the resource string > */ > - public static String getMessage(String key, Object args[]) { > + public static String getMessage(String key, Object... args) { > return MessageFormat.format(getMessage(key), args); > } > > diff -r e9910d92b046 netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java Mon Oct 25 12:14:33 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java Mon Oct 25 14:15:45 2010 -0400 > @@ -17,6 +17,8 @@ > > package net.sourceforge.jnlp.runtime; > > +import static net.sourceforge.jnlp.runtime.Translator.R; > + > import java.awt.Frame; > import java.awt.Window; > import java.awt.event.WindowAdapter; > @@ -88,14 +90,12 @@ > // another way for different apps to have different properties > // in java.lang.Sytem with the same names. > > - private static String R(String key) { return JNLPRuntime.getMessage(key); } > - > /** only class that can exit the JVM, if set */ > private Object exitClass = null; > > /** this exception prevents exiting the JVM */ > private SecurityException closeAppEx = // making here prevents huge stack traces > - new SecurityException(JNLPRuntime.getMessage("RShutdown")); > + new SecurityException(R("RShutdown")); > > /** weak list of windows created */ > private WeakList weakWindows = new WeakList(); > diff -r e9910d92b046 netx/net/sourceforge/jnlp/runtime/Translator.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/jnlp/runtime/Translator.java Mon Oct 25 14:15:45 2010 -0400 > @@ -0,0 +1,31 @@ > +// Copyright (C) 2010 Red Hat, Inc. > +// > +// This library is free software; you can redistribute it and/or > +// modify it under the terms of the GNU Lesser General Public > +// License as published by the Free Software Foundation; either > +// version 2.1 of the License, or (at your option) any later version. > +// > +// This library is distributed in the hope that it will be useful, > +// but WITHOUT ANY WARRANTY; without even the implied warranty of > +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > +// Lesser General Public License for more details. > +// > +// You should have received a copy of the GNU Lesser General Public > +// License along with this library; if not, write to the Free Software > +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. > + > +package net.sourceforge.jnlp.runtime; > + > +/** > + * Utility class to provide simple methods to help localize messages > + */ > +public class Translator { > + > + /** > + * @return the localized string for the message > + */ > + public static String R(String message, Object... params) { > + return JNLPRuntime.getMessage(message, params); > + } > + > +} > diff -r e9910d92b046 netx/net/sourceforge/jnlp/security/AccessWarningPane.java > --- a/netx/net/sourceforge/jnlp/security/AccessWarningPane.java Mon Oct 25 12:14:33 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/security/AccessWarningPane.java Mon Oct 25 14:15:45 2010 -0400 > @@ -37,6 +37,8 @@ > > package net.sourceforge.jnlp.security; > > +import static net.sourceforge.jnlp.runtime.Translator.R; > + > import java.awt.BorderLayout; > import java.awt.Color; > import java.awt.Dimension; > diff -r e9910d92b046 netx/net/sourceforge/jnlp/security/CertWarningPane.java > --- a/netx/net/sourceforge/jnlp/security/CertWarningPane.java Mon Oct 25 12:14:33 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/security/CertWarningPane.java Mon Oct 25 14:15:45 2010 -0400 > @@ -37,6 +37,8 @@ > > package net.sourceforge.jnlp.security; > > +import static net.sourceforge.jnlp.runtime.Translator.R; > + > import java.awt.BorderLayout; > import java.awt.Color; > import java.awt.Dimension; > diff -r e9910d92b046 netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java > --- a/netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java Mon Oct 25 12:14:33 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java Mon Oct 25 14:15:45 2010 -0400 > @@ -37,6 +37,8 @@ > > package net.sourceforge.jnlp.security; > > +import static net.sourceforge.jnlp.runtime.Translator.R; > + > import java.io.IOException; > import java.security.cert.CertPath; > import java.security.cert.Certificate; > @@ -50,7 +52,6 @@ > import java.util.Collection; > import java.util.List; > > -import net.sourceforge.jnlp.runtime.JNLPRuntime; > import net.sourceforge.jnlp.tools.KeyTool; > import sun.security.util.DerValue; > import sun.security.util.HostnameChecker; > @@ -198,14 +199,6 @@ > details.add(detail); > } > > - private static String R(String key) { > - return JNLPRuntime.getMessage(key); > - } > - > - private static String R(String key, String arg1, String arg2) { > - return JNLPRuntime.getMessage(key, new Object[] { arg1, arg2 }); > - } > - > public Certificate getPublisher() { > if (chain.length > 0) > return (Certificate)chain[0]; > diff -r e9910d92b046 netx/net/sourceforge/jnlp/security/MoreInfoPane.java > --- a/netx/net/sourceforge/jnlp/security/MoreInfoPane.java Mon Oct 25 12:14:33 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/security/MoreInfoPane.java Mon Oct 25 14:15:45 2010 -0400 > @@ -37,6 +37,8 @@ > > package net.sourceforge.jnlp.security; > > +import static net.sourceforge.jnlp.runtime.Translator.R; > + > import java.awt.BorderLayout; > import java.awt.Dimension; > import java.awt.GridLayout; > diff -r e9910d92b046 netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java > --- a/netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java Mon Oct 25 12:14:33 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java Mon Oct 25 14:15:45 2010 -0400 > @@ -44,9 +44,6 @@ > import javax.swing.JComponent; > import javax.swing.JPanel; > > - > -import net.sourceforge.jnlp.runtime.JNLPRuntime; > - > /** > * Provides a JPanel for use in JNLP warning dialogs. > */ > @@ -69,18 +66,6 @@ > this.setLayout(new BorderLayout()); > } > > - /* > - * String translation functions > - */ > - > - protected static String R(String key) { > - return JNLPRuntime.getMessage(key); > - } > - > - protected static String R(String key, Object param) { > - return JNLPRuntime.getMessage(key, new Object[] {param}); > - } > - > /** > * Needed to get word wrap working in JLabels. > */ > diff -r e9910d92b046 netx/net/sourceforge/jnlp/services/ServiceUtil.java > --- a/netx/net/sourceforge/jnlp/services/ServiceUtil.java Mon Oct 25 12:14:33 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/services/ServiceUtil.java Mon Oct 25 14:15:45 2010 -0400 > @@ -53,10 +53,6 @@ > */ > public class ServiceUtil { > > - private static String R(String key) { > - return JNLPRuntime.getMessage(key); > - } > - > /** > * Returns the BasicService reference, or null if the service is > * unavailable. > diff -r e9910d92b046 netx/net/sourceforge/jnlp/services/SingleInstanceLock.java > --- a/netx/net/sourceforge/jnlp/services/SingleInstanceLock.java Mon Oct 25 12:14:33 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/services/SingleInstanceLock.java Mon Oct 25 14:15:45 2010 -0400 > @@ -16,6 +16,8 @@ > > package net.sourceforge.jnlp.services; > > +import static net.sourceforge.jnlp.runtime.Translator.R; > + > import java.io.BufferedReader; > import java.io.BufferedWriter; > import java.io.File; > @@ -183,12 +185,4 @@ > return (display == null) ? "" : display; > } > > - private static String R(String key) { > - return JNLPRuntime.getMessage(key); > - } > - > - private static String R(String key, Object param) { > - return JNLPRuntime.getMessage(key, new Object[] { param }); > - } > - > } > diff -r e9910d92b046 netx/net/sourceforge/jnlp/tools/JarSigner.java > --- a/netx/net/sourceforge/jnlp/tools/JarSigner.java Mon Oct 25 12:14:33 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/tools/JarSigner.java Mon Oct 25 14:15:45 2010 -0400 > @@ -25,6 +25,8 @@ > > package net.sourceforge.jnlp.tools; > > +import static net.sourceforge.jnlp.runtime.Translator.R; > + > import java.io.*; > import java.util.*; > import java.util.zip.*; > @@ -40,7 +42,6 @@ > > import net.sourceforge.jnlp.*; > import net.sourceforge.jnlp.cache.*; > -import net.sourceforge.jnlp.runtime.*; > import net.sourceforge.jnlp.security.*; > > /** > @@ -52,10 +53,6 @@ > > public class JarSigner implements CertVerifier { > > - private static String R(String key) { > - return JNLPRuntime.getMessage(key); > - } > - > private static final Collator collator = Collator.getInstance(); > static { > // this is for case insensitive string comparisions From omajid at icedtea.classpath.org Mon Oct 25 11:38:21 2010 From: omajid at icedtea.classpath.org (omajid at icedtea.classpath.org) Date: Mon, 25 Oct 2010 18:38:21 +0000 Subject: /hg/icedtea-web: remove duplicate R methods; create a single cla... Message-ID: changeset e0bb780d2f04 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=e0bb780d2f04 author: Omair Majid date: Mon Oct 25 14:37:57 2010 -0400 remove duplicate R methods; create a single class to handle translation 2010-10-25 Omair Majid * net/sourceforge/jnlp/ExtensionDesc.java: Import Translator.R and use that. * net/sourceforge/jnlp/JNLPFile.java: Import Translator.R. (R): Remove. * net/sourceforge/jnlp/JREDesc.java: Import Translator.R. (checkHeapSize): Use R instead of JNLPRuntime.getMessage. * net/sourceforge/jnlp/Launcher.java: Import Translator.R. (R): Remove. * net/sourceforge/jnlp/Parser.java: Import Translator.R (R(String)): Remove. (R(String,Object)): Remove. (R(String,Object,Object)): Remove. (R(String,Object,Object,Object)): Remove. * net/sourceforge/jnlp/cache/CacheEntry.java: Import Translator.R (CacheEntry): Use R instead of JNLPRuntime.getMessage. * net/sourceforge/jnlp/cache/CacheUtil.java: Import Translator.R (R(String)): Remove. (R(String,Object)): Remove. * net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java: Import Translator.R and use that instead of JNLPRuntime.getMessage. * net/sourceforge/jnlp/runtime/Boot.java: Import Translator.R. (R(String)): Remove. (R(String, Object)): Remove. (run): Use R instead of JNLPRuntime.getMessage. * net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Import Translator.R. (R): Remove. * net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: Import Translator.R. Use it instead of JNLPRuntime.getMeesage. (R): Remove. * net/sourceforge/jnlp/security/AccessWarningPane.java: Import Translator.R. * net/sourceforge/jnlp/security/CertWarningPane.java: Likewise. * net/sourceforge/jnlp/security/HttpsCertVerifier.java: Import Translator.R. (R(String)): Remove. (R(String,String,String)): Remove. * net/sourceforge/jnlp/security/MoreInfoPane.java: Import Translator.R. * net/sourceforge/jnlp/security/SecurityDialogPanel.java (R(String)): Remove. (R(String,Object)): Remove. * net/sourceforge/jnlp/services/ServiceUtil.java (R): Remove. * net/sourceforge/jnlp/services/SingleInstanceLock.java: Import Translator.R (R(String)): Remove. (R(String,Object)): Remove. * net/sourceforge/jnlp/tools/JarSigner.java: Import Translator.R. (R): Remove. * net/sourceforge/jnlp/runtime/Translator.java: New file (R(String,Object...)): New method. diffstat: 22 files changed, 129 insertions(+), 83 deletions(-) ChangeLog | 53 ++++++++++ netx/net/sourceforge/jnlp/ExtensionDesc.java | 5 netx/net/sourceforge/jnlp/JNLPFile.java | 5 netx/net/sourceforge/jnlp/JREDesc.java | 8 - netx/net/sourceforge/jnlp/Launcher.java | 6 - netx/net/sourceforge/jnlp/Parser.java | 10 - netx/net/sourceforge/jnlp/cache/CacheEntry.java | 4 netx/net/sourceforge/jnlp/cache/CacheUtil.java | 10 - netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java | 6 - netx/net/sourceforge/jnlp/runtime/Boot.java | 8 - netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | 5 netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java | 2 netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java | 6 - netx/net/sourceforge/jnlp/runtime/Translator.java | 31 +++++ netx/net/sourceforge/jnlp/security/AccessWarningPane.java | 2 netx/net/sourceforge/jnlp/security/CertWarningPane.java | 2 netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java | 11 -- netx/net/sourceforge/jnlp/security/MoreInfoPane.java | 2 netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java | 15 -- netx/net/sourceforge/jnlp/services/ServiceUtil.java | 4 netx/net/sourceforge/jnlp/services/SingleInstanceLock.java | 10 - netx/net/sourceforge/jnlp/tools/JarSigner.java | 7 - diffs (truncated from 589 to 500 lines): diff -r e9910d92b046 -r e0bb780d2f04 ChangeLog --- a/ChangeLog Mon Oct 25 12:14:33 2010 -0400 +++ b/ChangeLog Mon Oct 25 14:37:57 2010 -0400 @@ -1,3 +1,56 @@ 2010-10-25 Andrew Su +2010-10-25 Omair Majid + + * net/sourceforge/jnlp/ExtensionDesc.java: Import Translator.R and use + that. + * net/sourceforge/jnlp/JNLPFile.java: Import Translator.R. + (R): Remove. + * net/sourceforge/jnlp/JREDesc.java: Import Translator.R. + (checkHeapSize): Use R instead of JNLPRuntime.getMessage. + * net/sourceforge/jnlp/Launcher.java: Import Translator.R. + (R): Remove. + * net/sourceforge/jnlp/Parser.java: Import Translator.R + (R(String)): Remove. + (R(String,Object)): Remove. + (R(String,Object,Object)): Remove. + (R(String,Object,Object,Object)): Remove. + * net/sourceforge/jnlp/cache/CacheEntry.java: Import Translator.R + (CacheEntry): Use R instead of JNLPRuntime.getMessage. + * net/sourceforge/jnlp/cache/CacheUtil.java: Import Translator.R + (R(String)): Remove. + (R(String,Object)): Remove. + * net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java: Import + Translator.R and use that instead of JNLPRuntime.getMessage. + * net/sourceforge/jnlp/runtime/Boot.java: Import Translator.R. + (R(String)): Remove. + (R(String, Object)): Remove. + (run): Use R instead of JNLPRuntime.getMessage. + * net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Import Translator.R. + (R): Remove. + * net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: Import + Translator.R. Use it instead of JNLPRuntime.getMeesage. + (R): Remove. + * net/sourceforge/jnlp/security/AccessWarningPane.java: Import + Translator.R. + * net/sourceforge/jnlp/security/CertWarningPane.java: Likewise. + * net/sourceforge/jnlp/security/HttpsCertVerifier.java: Import + Translator.R. + (R(String)): Remove. + (R(String,String,String)): Remove. + * net/sourceforge/jnlp/security/MoreInfoPane.java: Import Translator.R. + * net/sourceforge/jnlp/security/SecurityDialogPanel.java + (R(String)): Remove. + (R(String,Object)): Remove. + * net/sourceforge/jnlp/services/ServiceUtil.java + (R): Remove. + * net/sourceforge/jnlp/services/SingleInstanceLock.java: Import + Translator.R + (R(String)): Remove. + (R(String,Object)): Remove. + * net/sourceforge/jnlp/tools/JarSigner.java: Import Translator.R. + (R): Remove. + * net/sourceforge/jnlp/runtime/Translator.java: New file + (R(String,Object...)): New method. + 2010-10-25 Andrew Su * Makefile.am: diff -r e9910d92b046 -r e0bb780d2f04 netx/net/sourceforge/jnlp/ExtensionDesc.java --- a/netx/net/sourceforge/jnlp/ExtensionDesc.java Mon Oct 25 12:14:33 2010 -0400 +++ b/netx/net/sourceforge/jnlp/ExtensionDesc.java Mon Oct 25 14:37:57 2010 -0400 @@ -17,12 +17,13 @@ package net.sourceforge.jnlp; +import static net.sourceforge.jnlp.runtime.Translator.R; + import java.io.*; import java.net.*; import java.util.*; import net.sourceforge.jnlp.runtime.JNLPRuntime; - /** * The extension element. @@ -128,7 +129,7 @@ public class ExtensionDesc { // check for it being an extension descriptor if (!file.isComponent() && !file.isInstaller()) - throw new ParseException(JNLPRuntime.getMessage("JInvalidExtensionDescriptor", new Object[] {name, location} )); + throw new ParseException(R("JInvalidExtensionDescriptor", name, location)); } } diff -r e9910d92b046 -r e0bb780d2f04 netx/net/sourceforge/jnlp/JNLPFile.java --- a/netx/net/sourceforge/jnlp/JNLPFile.java Mon Oct 25 12:14:33 2010 -0400 +++ b/netx/net/sourceforge/jnlp/JNLPFile.java Mon Oct 25 14:37:57 2010 -0400 @@ -17,6 +17,8 @@ package net.sourceforge.jnlp; +import static net.sourceforge.jnlp.runtime.Translator.R; + import java.io.IOException; import java.io.InputStream; import java.io.Reader; @@ -31,6 +33,7 @@ import net.sourceforge.jnlp.cache.Resour import net.sourceforge.jnlp.cache.ResourceTracker; import net.sourceforge.jnlp.cache.UpdatePolicy; import net.sourceforge.jnlp.runtime.JNLPRuntime; + /** * Provides methods to access the information in a Java Network @@ -59,8 +62,6 @@ public class JNLPFile { // // todo: currently does not filter resources by jvm version. // - - private static String R(String key) { return JNLPRuntime.getMessage(key); } /** the location this JNLP file was created from */ protected URL sourceLocation = null; diff -r e9910d92b046 -r e0bb780d2f04 netx/net/sourceforge/jnlp/JREDesc.java --- a/netx/net/sourceforge/jnlp/JREDesc.java Mon Oct 25 12:14:33 2010 -0400 +++ b/netx/net/sourceforge/jnlp/JREDesc.java Mon Oct 25 14:37:57 2010 -0400 @@ -17,11 +17,11 @@ package net.sourceforge.jnlp; +import static net.sourceforge.jnlp.runtime.Translator.R; + import java.io.*; import java.net.*; import java.util.*; - -import net.sourceforge.jnlp.runtime.JNLPRuntime; /** * The J2SE/Java element. @@ -143,7 +143,7 @@ public class JREDesc { if ((lastChar < '0' || lastChar > '9')) { lastCharacterIsDigit = false; if (lastChar != 'k' && lastChar!= 'm' ) { - throw new ParseException(JNLPRuntime.getMessage("PBadHeapSize",new Object[] {heapSize})); + throw new ParseException(R("PBadHeapSize", heapSize)); } } @@ -157,7 +157,7 @@ public class JREDesc { // check that the number is a number! Integer.valueOf(size); } catch (NumberFormatException numberFormat) { - throw new ParseException(JNLPRuntime.getMessage("PBadHeapSize", new Object[] {heapSize}), numberFormat); + throw new ParseException(R("PBadHeapSize", heapSize), numberFormat); } } diff -r e9910d92b046 -r e0bb780d2f04 netx/net/sourceforge/jnlp/Launcher.java --- a/netx/net/sourceforge/jnlp/Launcher.java Mon Oct 25 12:14:33 2010 -0400 +++ b/netx/net/sourceforge/jnlp/Launcher.java Mon Oct 25 14:37:57 2010 -0400 @@ -16,6 +16,8 @@ package net.sourceforge.jnlp; + +import static net.sourceforge.jnlp.runtime.Translator.R; import java.applet.Applet; import java.awt.Container; @@ -51,6 +53,7 @@ import javax.swing.SwingUtilities; import sun.awt.SunToolkit; + /** * Launches JNLPFiles either in the foreground or background.

    * @@ -66,9 +69,6 @@ public class Launcher { public class Launcher { // defines class Launcher.BgRunner, Launcher.TgThread - - /** shortcut for resources */ - private static String R(String key) { return JNLPRuntime.getMessage(key); } /** shared thread group */ /*package*/ static final ThreadGroup mainGroup = new ThreadGroup(R("LAllThreadGroup")); diff -r e9910d92b046 -r e0bb780d2f04 netx/net/sourceforge/jnlp/Parser.java --- a/netx/net/sourceforge/jnlp/Parser.java Mon Oct 25 12:14:33 2010 -0400 +++ b/netx/net/sourceforge/jnlp/Parser.java Mon Oct 25 14:37:57 2010 -0400 @@ -18,6 +18,8 @@ package net.sourceforge.jnlp; +import static net.sourceforge.jnlp.runtime.Translator.R; + import java.io.*; import java.net.*; import java.util.*; @@ -27,9 +29,7 @@ import java.util.*; //import gd.xml.tiny.*; import net.sourceforge.jnlp.UpdateDesc.Check; import net.sourceforge.jnlp.UpdateDesc.Policy; -import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.nanoxml.*; - /** * Contains methods to parse an XML document into a JNLPFile. @@ -39,12 +39,6 @@ import net.sourceforge.nanoxml.*; * @version $Revision: 1.13 $ */ class Parser { - - private static String R(String key) { return JNLPRuntime.getMessage(key); } - private static String R(String key, Object p1) { return R(key, p1, null); } - private static String R(String key, Object p1, Object p2) { return R(key, p1, p2, null); } - private static String R(String key, Object p1, Object p2, Object p3) { return JNLPRuntime.getMessage(key, new Object[] { p1, p2, p3 }); } - // defines netx.jnlp.Node class if using Tiny XML or Nano XML diff -r e9910d92b046 -r e0bb780d2f04 netx/net/sourceforge/jnlp/cache/CacheEntry.java --- a/netx/net/sourceforge/jnlp/cache/CacheEntry.java Mon Oct 25 12:14:33 2010 -0400 +++ b/netx/net/sourceforge/jnlp/cache/CacheEntry.java Mon Oct 25 14:37:57 2010 -0400 @@ -16,6 +16,8 @@ package net.sourceforge.jnlp.cache; + +import static net.sourceforge.jnlp.runtime.Translator.R; import java.io.*; import java.net.*; @@ -60,7 +62,7 @@ public class CacheEntry { File infoFile = CacheUtil.getCacheFile(location, version); infoFile = new File(infoFile.getPath()+".info"); // replace with something that can't be clobbered - properties = new PropertiesFile(infoFile, JNLPRuntime.getMessage("CAutoGen")); + properties = new PropertiesFile(infoFile, R("CAutoGen")); } /** diff -r e9910d92b046 -r e0bb780d2f04 netx/net/sourceforge/jnlp/cache/CacheUtil.java --- a/netx/net/sourceforge/jnlp/cache/CacheUtil.java Mon Oct 25 12:14:33 2010 -0400 +++ b/netx/net/sourceforge/jnlp/cache/CacheUtil.java Mon Oct 25 14:37:57 2010 -0400 @@ -16,6 +16,8 @@ package net.sourceforge.jnlp.cache; + +import static net.sourceforge.jnlp.runtime.Translator.R; import java.io.*; import java.net.*; @@ -37,14 +39,6 @@ import net.sourceforge.jnlp.util.FileUti * @version $Revision: 1.17 $ */ public class CacheUtil { - - private static String R(String key) { - return JNLPRuntime.getMessage(key); - } - - private static String R(String key, Object param) { - return JNLPRuntime.getMessage(key, new Object[] {param}); - } /** * Compares a URL using string compare of its protocol, host, diff -r e9910d92b046 -r e0bb780d2f04 netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java --- a/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java Mon Oct 25 12:14:33 2010 -0400 +++ b/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java Mon Oct 25 14:37:57 2010 -0400 @@ -16,6 +16,8 @@ package net.sourceforge.jnlp.cache; + +import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.*; import java.awt.event.*; @@ -49,8 +51,8 @@ public class DefaultDownloadIndicator im // todo: this should be synchronized at some point but conflicts // aren't very likely. - private static String downloading = JNLPRuntime.getMessage("CDownloading"); - private static String complete = JNLPRuntime.getMessage("CComplete"); + private static String downloading = R("CDownloading"); + private static String complete = R("CComplete"); /** time to wait after completing but before window closes */ private static final int CLOSE_DELAY = 750; diff -r e9910d92b046 -r e0bb780d2f04 netx/net/sourceforge/jnlp/runtime/Boot.java --- a/netx/net/sourceforge/jnlp/runtime/Boot.java Mon Oct 25 12:14:33 2010 -0400 +++ b/netx/net/sourceforge/jnlp/runtime/Boot.java Mon Oct 25 14:37:57 2010 -0400 @@ -16,6 +16,8 @@ package net.sourceforge.jnlp.runtime; + +import static net.sourceforge.jnlp.runtime.Translator.R; import java.io.File; import java.io.IOException; @@ -62,9 +64,6 @@ public final class Boot implements Privi // todo: decide whether a spawned netx (external launch) // should inherit the same options as this instance (store argv?) - - private static String R(String key) { return JNLPRuntime.getMessage(key); } - private static String R(String key, Object param) { return JNLPRuntime.getMessage(key, new Object[] {param}); } private static final String version = "0.5"; @@ -225,8 +224,7 @@ public final class Boot implements Privi if (JNLPRuntime.isDebug()) ex.printStackTrace(); - fatalError(JNLPRuntime.getMessage("RUnexpected", - new Object[] {ex.toString(), ex.getStackTrace()[0]} )); + fatalError(R("RUnexpected", ex.toString(), ex.getStackTrace()[0])); } return null; diff -r e9910d92b046 -r e0bb780d2f04 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Mon Oct 25 12:14:33 2010 -0400 +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Mon Oct 25 14:37:57 2010 -0400 @@ -16,6 +16,8 @@ package net.sourceforge.jnlp.runtime; + +import static net.sourceforge.jnlp.runtime.Translator.R; import java.io.File; import java.io.FileOutputStream; @@ -77,9 +79,6 @@ public class JNLPClassLoader extends URL // todo: initializePermissions should get the permissions from // extension classes too so that main file classes can load // resources in an extension. - - /** shortcut for resources */ - private static String R(String key) { return JNLPRuntime.getMessage(key); } /** map from JNLPFile url to shared classloader */ private static Map urlToLoader = diff -r e9910d92b046 -r e0bb780d2f04 netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Mon Oct 25 12:14:33 2010 -0400 +++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Mon Oct 25 14:37:57 2010 -0400 @@ -522,7 +522,7 @@ public class JNLPRuntime { * * @param args the formatting arguments to the resource string */ - public static String getMessage(String key, Object args[]) { + public static String getMessage(String key, Object... args) { return MessageFormat.format(getMessage(key), args); } diff -r e9910d92b046 -r e0bb780d2f04 netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java Mon Oct 25 12:14:33 2010 -0400 +++ b/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java Mon Oct 25 14:37:57 2010 -0400 @@ -16,6 +16,8 @@ package net.sourceforge.jnlp.runtime; + +import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.Frame; import java.awt.Window; @@ -88,14 +90,12 @@ class JNLPSecurityManager extends AWTSec // another way for different apps to have different properties // in java.lang.Sytem with the same names. - private static String R(String key) { return JNLPRuntime.getMessage(key); } - /** only class that can exit the JVM, if set */ private Object exitClass = null; /** this exception prevents exiting the JVM */ private SecurityException closeAppEx = // making here prevents huge stack traces - new SecurityException(JNLPRuntime.getMessage("RShutdown")); + new SecurityException(R("RShutdown")); /** weak list of windows created */ private WeakList weakWindows = new WeakList(); diff -r e9910d92b046 -r e0bb780d2f04 netx/net/sourceforge/jnlp/runtime/Translator.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netx/net/sourceforge/jnlp/runtime/Translator.java Mon Oct 25 14:37:57 2010 -0400 @@ -0,0 +1,31 @@ +// Copyright (C) 2010 Red Hat, Inc. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +package net.sourceforge.jnlp.runtime; + +/** + * Utility class to provide simple methods to help localize messages + */ +public class Translator { + + /** + * @return the localized string for the message + */ + public static String R(String message, Object... params) { + return JNLPRuntime.getMessage(message, params); + } + +} diff -r e9910d92b046 -r e0bb780d2f04 netx/net/sourceforge/jnlp/security/AccessWarningPane.java --- a/netx/net/sourceforge/jnlp/security/AccessWarningPane.java Mon Oct 25 12:14:33 2010 -0400 +++ b/netx/net/sourceforge/jnlp/security/AccessWarningPane.java Mon Oct 25 14:37:57 2010 -0400 @@ -36,6 +36,8 @@ exception statement from your version. */ package net.sourceforge.jnlp.security; + +import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.BorderLayout; import java.awt.Color; diff -r e9910d92b046 -r e0bb780d2f04 netx/net/sourceforge/jnlp/security/CertWarningPane.java --- a/netx/net/sourceforge/jnlp/security/CertWarningPane.java Mon Oct 25 12:14:33 2010 -0400 +++ b/netx/net/sourceforge/jnlp/security/CertWarningPane.java Mon Oct 25 14:37:57 2010 -0400 @@ -36,6 +36,8 @@ exception statement from your version. */ package net.sourceforge.jnlp.security; + +import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.BorderLayout; import java.awt.Color; diff -r e9910d92b046 -r e0bb780d2f04 netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java --- a/netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java Mon Oct 25 12:14:33 2010 -0400 +++ b/netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java Mon Oct 25 14:37:57 2010 -0400 @@ -37,6 +37,8 @@ exception statement from your version. package net.sourceforge.jnlp.security; +import static net.sourceforge.jnlp.runtime.Translator.R; + import java.io.IOException; import java.security.cert.CertPath; import java.security.cert.Certificate; @@ -50,7 +52,6 @@ import java.util.Collection; import java.util.Collection; import java.util.List; -import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.tools.KeyTool; import sun.security.util.DerValue; import sun.security.util.HostnameChecker; @@ -198,14 +199,6 @@ public class HttpsCertVerifier implement details.add(detail); } - private static String R(String key) { - return JNLPRuntime.getMessage(key); - } - - private static String R(String key, String arg1, String arg2) { - return JNLPRuntime.getMessage(key, new Object[] { arg1, arg2 }); - } - public Certificate getPublisher() { if (chain.length > 0) return (Certificate)chain[0]; diff -r e9910d92b046 -r e0bb780d2f04 netx/net/sourceforge/jnlp/security/MoreInfoPane.java --- a/netx/net/sourceforge/jnlp/security/MoreInfoPane.java Mon Oct 25 12:14:33 2010 -0400 +++ b/netx/net/sourceforge/jnlp/security/MoreInfoPane.java Mon Oct 25 14:37:57 2010 -0400 @@ -36,6 +36,8 @@ exception statement from your version. */ package net.sourceforge.jnlp.security; + +import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.BorderLayout; import java.awt.Dimension; diff -r e9910d92b046 -r e0bb780d2f04 netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java --- a/netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java Mon Oct 25 12:14:33 2010 -0400 +++ b/netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java Mon Oct 25 14:37:57 2010 -0400 @@ -44,9 +44,6 @@ import javax.swing.JComponent; import javax.swing.JComponent; import javax.swing.JPanel; - -import net.sourceforge.jnlp.runtime.JNLPRuntime; - /** * Provides a JPanel for use in JNLP warning dialogs. */ From omajid at redhat.com Mon Oct 25 11:42:21 2010 From: omajid at redhat.com (Omair Majid) Date: Mon, 25 Oct 2010 14:42:21 -0400 Subject: [icedtea-web] RFC: unify localization code In-Reply-To: <20101025182445.GD31205@redhat.com> References: <4CC5B635.5030902@redhat.com> <20101025172244.GA31205@redhat.com> <4CC5CA73.6080204@redhat.com> <4CC5CAE4.8030300@redhat.com> <20101025182445.GD31205@redhat.com> Message-ID: <4CC5CF8D.2060100@redhat.com> On 10/25/2010 02:24 PM, Deepak Bhole wrote: > * Omair Majid [2010-10-25 14:22]: >> On 10/25/2010 02:20 PM, Omair Majid wrote: >>> On 10/25/2010 01:22 PM, Deepak Bhole wrote: >>>> * Omair Majid [2010-10-25 12:54]: >>>>> Hi, >>>>> >>>>> Netx contains a number of duplicate methods named "R" defined in >>>>> various files that act as a wrapper for JNLPRuntime.getMessage(). >>>>> The attached patch creates a new class Translate and moves all the >>>>> "R" methods to it. This set of overloaded "R" methods is then >>>>> statically imported anywhere that needs localized strings. >>>>> >>>> >>>> While it is being refactored, why not use varargs for R()? >>>> >>> >>> Fixed. >> >> Grr.. Accceidentally sent without finishing email :( >> >> Here is the attachment. >> > > Looks good. Okay for commit to HEAD. > > Deepak > Thanks. Pushed to HEAD. Cheers, Omair From pcpa at mandriva.com.br Mon Oct 25 12:31:46 2010 From: pcpa at mandriva.com.br (Paulo =?iso-8859-1?Q?C=E9sar_Pereira_de_Andrade?=) Date: Mon, 25 Oct 2010 17:31:46 -0200 Subject: About recent Security Advisories Message-ID: <1ab27589b677c9b998f32f365fbb41a5.squirrel@webmail.conectiva.com.br> Hi, Does http://lwn.net/Articles/410013/ affect recent openjdk and/or b18 in some way? Thanks Paulo From mark at klomp.org Mon Oct 25 12:43:08 2010 From: mark at klomp.org (Mark Wielaard) Date: Mon, 25 Oct 2010 21:43:08 +0200 Subject: About recent Security Advisories In-Reply-To: <1ab27589b677c9b998f32f365fbb41a5.squirrel@webmail.conectiva.com.br> References: <1ab27589b677c9b998f32f365fbb41a5.squirrel@webmail.conectiva.com.br> Message-ID: <1288035788.2330.24.camel@hermans.wildebeest.org> On Mon, 2010-10-25 at 17:31 -0200, Paulo C?sar Pereira de Andrade wrote: > Hi, > > Does http://lwn.net/Articles/410013/ affect recent openjdk and/or b18 > in some way? The IcedTea6 (1.7.5, 1.8.2, 1.9.1) packages contain these fixes: http://lwn.net/Articles/409833/ From pcpa at mandriva.com.br Mon Oct 25 12:58:40 2010 From: pcpa at mandriva.com.br (Paulo =?iso-8859-1?Q?C=E9sar_Pereira_de_Andrade?=) Date: Mon, 25 Oct 2010 17:58:40 -0200 Subject: About recent Security Advisories In-Reply-To: <1288035788.2330.24.camel@hermans.wildebeest.org> References: <1ab27589b677c9b998f32f365fbb41a5.squirrel@webmail.conectiva.com.br> <1288035788.2330.24.camel@hermans.wildebeest.org> Message-ID: Mark Wielaard wrote: > On Mon, 2010-10-25 at 17:31 -0200, Paulo C??sar Pereira de Andrade wrote: >> Hi, Hi Mark, >> Does http://lwn.net/Articles/410013/ affect recent openjdk and/or b18 >> in some way? > > The IcedTea6 (1.7.5, 1.8.2, 1.9.1) packages contain these fixes: > http://lwn.net/Articles/409833/ Many thanks for the information. I will update the Mandriva cooker openjdk package. Paulo From omajid at icedtea.classpath.org Mon Oct 25 14:19:11 2010 From: omajid at icedtea.classpath.org (omajid at icedtea.classpath.org) Date: Mon, 25 Oct 2010 21:19:11 +0000 Subject: /hg/icedtea-web: add support for parsing and accessing deploymen... Message-ID: changeset b1b876d99849 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=b1b876d99849 author: Omair Majid date: Mon Oct 25 17:16:13 2010 -0400 add support for parsing and accessing deployment properties 2010-10-25 Omair Majid * netx/net/sourceforge/jnlp/ShortcutDesc.java: Add SHORTCUT_NEVER, SHORTCUT_ALWAYS, SHORTCUT_ASK_USER, SHORTCUT_ASK_USER_IF_HINTED, SHORTCUT_ALWAYS_IF_HINTED, SHORTCUT_DEFAULT. * netx/net/sourceforge/jnlp/resources/Messages.properties: Add RConfigurationError. * netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java: New file. (ConfigValue): New class. Holds a configuration value. (DeploymentConfiguration): New method. (load): New method. (getProperty): Likewise. (getAllPropertyNames): Likewise. (setProperty): Likewise. (loadDefaultProperties): Likewise. (findSystemConfigFile): Likewise. (loadSystemConfiguration): Likewise. (loadProperties): Likewise. (save): Likewise. (parsePropertiesFile): Likewise. (mergeMaps): Likewise. (dumpConfiguration): Likewise. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: (initialize): Load configuration. (getConfiguration): Return the configuration. diffstat: 5 files changed, 660 insertions(+) ChangeLog | 28 netx/net/sourceforge/jnlp/ShortcutDesc.java | 12 netx/net/sourceforge/jnlp/resources/Messages.properties | 1 netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java | 596 ++++++++++ netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java | 23 diffs (truncated from 729 to 500 lines): diff -r e0bb780d2f04 -r b1b876d99849 ChangeLog --- a/ChangeLog Mon Oct 25 14:37:57 2010 -0400 +++ b/ChangeLog Mon Oct 25 17:16:13 2010 -0400 @@ -1,3 +1,31 @@ 2010-10-25 Omair Majid + + * netx/net/sourceforge/jnlp/ShortcutDesc.java: + Add SHORTCUT_NEVER, SHORTCUT_ALWAYS, SHORTCUT_ASK_USER, + SHORTCUT_ASK_USER_IF_HINTED, SHORTCUT_ALWAYS_IF_HINTED, + SHORTCUT_DEFAULT. + * netx/net/sourceforge/jnlp/resources/Messages.properties: + Add RConfigurationError. + * netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java: + New file. + (ConfigValue): New class. Holds a configuration value. + (DeploymentConfiguration): New method. + (load): New method. + (getProperty): Likewise. + (getAllPropertyNames): Likewise. + (setProperty): Likewise. + (loadDefaultProperties): Likewise. + (findSystemConfigFile): Likewise. + (loadSystemConfiguration): Likewise. + (loadProperties): Likewise. + (save): Likewise. + (parsePropertiesFile): Likewise. + (mergeMaps): Likewise. + (dumpConfiguration): Likewise. + * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: + (initialize): Load configuration. + (getConfiguration): Return the configuration. + 2010-10-25 Omair Majid * net/sourceforge/jnlp/ExtensionDesc.java: Import Translator.R and use diff -r e0bb780d2f04 -r b1b876d99849 netx/net/sourceforge/jnlp/ShortcutDesc.java --- a/netx/net/sourceforge/jnlp/ShortcutDesc.java Mon Oct 25 14:37:57 2010 -0400 +++ b/netx/net/sourceforge/jnlp/ShortcutDesc.java Mon Oct 25 17:16:13 2010 -0400 @@ -17,6 +17,18 @@ package net.sourceforge.jnlp; package net.sourceforge.jnlp; public final class ShortcutDesc { + + /** Never create a shortcut */ + public static final String SHORTCUT_NEVER = "NEVER"; + /** Always create a shortcut */ + public static final String SHORTCUT_ALWAYS = "ALWAYS"; + /** Always ask user whether to create a shortcut */ + public static final String SHORTCUT_ASK_USER = "ASK_USER"; + /** Ask user whether to create a shortcut but only if jnlp file asks for it */ + public static final String SHORTCUT_ASK_USER_IF_HINTED = "ASK_IF_HINTED"; + /** Create a desktop shortcut without prompting if the jnlp asks for it */ + public static final String SHORTCUT_ALWAYS_IF_HINTED = "ALWAYS_IF_HINTED"; + public static final String SHORTCUT_DEFAULT = SHORTCUT_ASK_USER_IF_HINTED; /** the application wants to be placed on the desktop */ private boolean onDesktop = false; diff -r e0bb780d2f04 -r b1b876d99849 netx/net/sourceforge/jnlp/resources/Messages.properties --- a/netx/net/sourceforge/jnlp/resources/Messages.properties Mon Oct 25 14:37:57 2010 -0400 +++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Mon Oct 25 17:16:13 2010 -0400 @@ -119,6 +119,7 @@ RNoLockDir=Unable to create locks direct RNoLockDir=Unable to create locks directory ({0}) RNestedJarExtration=Unable to extract nested jar. RUnexpected=Unexpected {0} at {1} +RConfigurationError=Fatal error while reading the configuration # Boot options, message should be shorter than this ----------------> BOUsage=javaws [-run-options] diff -r e0bb780d2f04 -r b1b876d99849 netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java Mon Oct 25 17:16:13 2010 -0400 @@ -0,0 +1,596 @@ +// Copyright (C) 2010 Red Hat, Inc. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +package net.sourceforge.jnlp.runtime; + +import java.io.BufferedOutputStream; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintStream; +import java.io.Reader; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import java.util.Set; + +import javax.naming.ConfigurationException; + +import net.sourceforge.jnlp.ShortcutDesc; + +/** + * Manages the various properties and configuration related to deployment. + * + * See: + * http://download.oracle.com/javase/1.5.0/docs/guide/deployment/deployment-guide/properties.html + */ +public final class DeploymentConfiguration { + + /** + * Represents a value for a configuration. Provides methods to get the value + * as well as marking the value as locked. + */ + private final class ConfigValue { + + private String value; + private boolean locked; + + ConfigValue(String value) { + this(value, false); + } + + ConfigValue(String value, boolean locked) { + this.value = value; + this.locked = locked; + } + + ConfigValue(ConfigValue other) { + this(other.value, other.locked); + } + + String get() { + return value; + } + + /** + * Note that setting the value is not enforced - it is the caller's + * responsibility to check if a value is locked or not before setting a + * new value + * + * @param value the new value + */ + void set(String value) { + this.value = value; + } + + /** + * @return true if the value has been marked as locked + */ + boolean isLocked() { + return locked; + } + + /** + * Mark a value as locked + * @param locked + */ + void setLocked(boolean locked) { + this.locked = locked; + } + } + + public static final String DEPLOYMENT_DIR = ".netx"; + public static final String DEPLOYMENT_CONFIG = "deployment.config"; + public static final String DEPLOYMENT_PROPERTIES = "deployment.properties"; + + public static final String DEPLOYMENT_COMMENT = "Netx deployment configuration"; + + public static final int JNLP_ASSOCIATION_NEVER = 0; + public static final int JNLP_ASSOCIATION_NEW_ONLY = 1; + public static final int JNLP_ASSOCIATION_ASK_USER = 2; + public static final int JNLP_ASSOCIATION_REPLACE_ASK = 3; + + /* + * FIXME these should be moved into JavaConsole, but there is a strange + * dependency in the build system. First all of netx is built. Then the + * plugin is built. So we cannot refer to plugin code in here :( + */ + public static final String CONSOLE_HIDE = "HIDE"; + public static final String CONSOLE_SHOW = "SHOW"; + public static final String CONSOLE_DISABLE = "DISABLE"; + + /* FIXME these should be moved into the proxy class */ + public static final int PROXY_TYPE_UNKNOWN = -1; + public static final int PROXY_TYPE_NONE = 0; + public static final int PROXY_TYPE_MANUAL = 1; + public static final int PROXY_TYPE_AUTO = 2; + public static final int PROXY_TYPE_BROWSER = 3; + + public enum ConfigType { + System, User + } + + /** is it mandatory to load the system properties? */ + private boolean systemPropertiesMandatory = false; + + /** The system's deployment.config file */ + private File systemPropertiesFile = null; + /** The user's deployment.config file */ + private File userPropertiesFile = null; + + /** the current deployment properties */ + private Map currentConfiguration; + + /** the deployment properties that cannot be changed */ + private Map unchangeableConfiguration; + + public DeploymentConfiguration() { + currentConfiguration = new HashMap(); + unchangeableConfiguration = new HashMap(); + } + + /** + * Initialize this deployment configuration by reading configuration files. + * Generally, it will try to continue and ignore errors it finds (such as file not found). + * + * @throws DeploymentException if it encounters a fatal error. + */ + public void load() throws ConfigurationException { + Map initialProperties = loadDefaultProperties(); + + Map systemProperties = null; + + /* + * First, try to read the system's deployment.config file to find if + * there is a system-level deployment.poperties file + */ + + File systemConfigFile = findSystemConfigFile(); + if (systemConfigFile != null) { + if (loadSystemConfiguration(systemConfigFile)) { + if (JNLPRuntime.isDebug()) { + System.out.println("System level " + DEPLOYMENT_CONFIG + " is mandatory: " + systemPropertiesMandatory); + } + /* Second, read the System level deployment.properties file */ + systemProperties = loadProperties(ConfigType.System, systemPropertiesFile, + systemPropertiesMandatory); + } + if (systemProperties != null) { + mergeMaps(initialProperties, systemProperties); + } + } + + /* need a copy of the original when we have to save */ + unchangeableConfiguration = new HashMap(); + Set keys = initialProperties.keySet(); + for (String key : keys) { + unchangeableConfiguration.put(key, new ConfigValue(initialProperties.get(key))); + } + + /* + * Third, read the user's deployment.properties file + */ + userPropertiesFile = new File(System.getProperty("user.home") + File.separator + ".netx" + + File.separator + DEPLOYMENT_PROPERTIES); + Map userProperties = loadProperties(ConfigType.User, userPropertiesFile, + false); + if (userProperties != null) { + mergeMaps(initialProperties, userProperties); + } + + currentConfiguration = initialProperties; + } + + /** + * Get the value for the given key + * + * @param key the property key + * @return the value for the key, or null if it can not be found + */ + public String getProperty(String key) { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + if (userPropertiesFile != null) { + sm.checkRead(userPropertiesFile.toString()); + } + } + + return currentConfiguration.get(key).get(); + } + + /** + * @return a Set containing all the property names + */ + public Set getAllPropertyNames() { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + if (userPropertiesFile != null) { + sm.checkRead(userPropertiesFile.toString()); + } + } + + return currentConfiguration.keySet(); + } + + /** + * Sets the value of corresponding to the key. If the value has been marked + * as locked, it is not changed + * + * @param key the key + * @param value the value to be associated with the key + */ + public void setProperty(String key, String value) { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + if (userPropertiesFile != null) { + sm.checkWrite(userPropertiesFile.toString()); + } + } + + ConfigValue currentValue = currentConfiguration.get(key); + if (currentValue != null) { + if (!currentValue.isLocked()) { + currentValue.set(value); + } + } else { + currentValue = new ConfigValue(value); + currentConfiguration.put(key, currentValue); + } + } + + /** + * Loads the default properties for deployment + */ + private Map loadDefaultProperties() { + + final String SYSTEM_HOME = System.getProperty("java.home"); + final String SYSTEM_SECURITY = SYSTEM_HOME + File.separator + "lib" + File.separator + + "security"; + + final String USER_HOME = System.getProperty("user.home") + File.separator + DEPLOYMENT_DIR; + final String USER_SECURITY = USER_HOME + File.separator + "security"; + + /* + * This is more or less a straight copy from the deployment + * configuration page, with occasional replacements of "" or no-defaults + * with null + */ + + String[][] defaults = new String[][] { + /* infrastructure */ + { "deployment.user.cachedir", USER_HOME + File.separator + "cache" }, + { "deployment.system.cachedir", null }, + { "deployment.user.logdir", USER_HOME + File.separator + "log" }, + { "deployment.user.tmp", USER_HOME + File.separator + "tmp" }, + /* certificates and policy files */ + { "deployment.user.security.policy", "file://" + USER_SECURITY + File.separator + "java.policy" }, + { "deployment.user.security.trusted.cacerts", USER_SECURITY + File.separator + "trusted.cacerts" }, + { "deployment.user.security.trusted.jssecacerts", USER_SECURITY + File.separator + "trusted.jssecacerts" }, + { "deployment.user.security.trusted.certs", USER_SECURITY + File.separator + "trusted.certs" }, + { "deployment.user.security.trusted.jssecerts", USER_SECURITY + File.separator + "trusted.jssecerts"}, + { "deployment.user.security.trusted.clientauthcerts", USER_SECURITY + File.separator + "trusted.clientcerts" }, + { "deployment.system.security.policy", null }, + { "deployment.system.security.cacerts", SYSTEM_SECURITY + File.separator + "cacerts" }, + { "deployment.system.security.jssecacerts", SYSTEM_SECURITY + File.separator + "jssecacerts" }, + { "deployment.system.security.trusted.certs", SYSTEM_SECURITY + File.separator + "trusted.certs" }, + { "deployment.system.security.trusted.jssecerts", SYSTEM_SECURITY + File.separator + "trusted.jssecerts" }, + { "deployment.system.security.trusted.clientautcerts", SYSTEM_SECURITY + File.separator + "trusted.clientcerts" }, + /* security access and control */ + { "deployment.security.askgrantdialog.show", String.valueOf(true) }, + { "deployment.security.askgrantdialog.notinca", String.valueOf(true) }, + { "deployment.security.notinca.warning", String.valueOf(true) }, + { "deployment.security.expired.warning", String.valueOf(true) }, + { "deployment.security.jsse.hostmismatch.warning", String.valueOf(true) }, + { "deployment.security.trusted.policy", null }, + { "deployment.security.sandbox.awtwarningwindow", String.valueOf(true) }, + { "deployment.security.sandbox.jnlp.enhanced", String.valueOf(true) }, + { "deployment.security.authenticator", String.valueOf(true) }, + /* networking */ + { "deployment.proxy.type", String.valueOf(PROXY_TYPE_BROWSER) }, + { "deployment.proxy.same", String.valueOf(false) }, + { "deployment.proxy.auto.config.url", null }, + { "deployment.proxy.bypass.list", null }, + { "deployment.proxy.bypass.local", null }, + { "deployment.proxy.http.host", null }, + { "deployment.proxy.http.port", null }, + { "deployment.proxy.https.host", null }, + { "deployment.proxy.https.port", null }, + { "deployment.proxy.ftp.host", null }, + { "deployment.proxy.ftp.port", null }, + { "deployment.proxy.socks.host", null }, + { "deployment.proxy.socks.port", null }, + { "deployment.proxy.override.hosts", null }, + /* cache and optional package repository */ + { "deployment.cache.max.size", String.valueOf("-1") }, + { "deployment.cache.jarcompresson", String.valueOf(0) }, + { "deployment.javapi.cache.enabled", String.valueOf(false) }, + /* java console */ + { "deployment.console.startup.mode", CONSOLE_HIDE }, + /* tracing and logging */ + { "deployment.trace", String.valueOf(false) }, + { "deployment.log", String.valueOf(false) }, + /* JNLP association */ + { "deployment.javaws.associations", String.valueOf(JNLP_ASSOCIATION_ASK_USER) }, + /* desktop integration */ + { "deployment.javaws.shortcut", ShortcutDesc.SHORTCUT_ASK_USER_IF_HINTED}, + /* jre selection */ + { "deployment.javaws.installURL", null }, + /* jre management */ + { "deployment.javaws.autodownload", null }, + /* browser selection */ + { "deployment.browser.path", null }, + /* check for update timeout */ + { "deployment.javaws.update.timeout", String.valueOf(500) } + }; + + HashMap result = new HashMap(); + for (int i = 0; i < defaults.length; i++) { + String key = defaults[i][0]; + String actualValue = defaults[i][1]; + boolean locked = false; + ConfigValue value = new ConfigValue(actualValue, locked); + result.put(key, value); + } + + return result; + } + + /** + * @return the location of system-level deployment.config file, or null if none can be found + */ + private File findSystemConfigFile() { + File etcFile = new File(File.separator + "etc" + File.separator + ".java" + File.separator + + "deployment" + File.separator + DEPLOYMENT_CONFIG); + if (etcFile.isFile()) { + return etcFile; + } + + File jreFile = new File(System.getProperty("java.home") + File.separator + "lib" + + File.separator + DEPLOYMENT_CONFIG); + if (jreFile.isFile()) { + return jreFile; + } + + return null; + } + + /** + * Reads the system configuration file and sets the relevant + * system-properties related variables + */ + private boolean loadSystemConfiguration(File configFile) { + + if (JNLPRuntime.isDebug()) { + System.out.println("Loading system configuation from: " + configFile); + } + + Map systemConfiguration = new HashMap(); + try { + systemConfiguration = parsePropertiesFile(configFile); + } catch (IOException e) { + if (JNLPRuntime.isDebug()) { + System.out.println("No System level " + DEPLOYMENT_PROPERTIES + " found."); + } + return false; + } + + /* + * at this point, we have read the system deployment.config file + * completely + */ + + try { + String urlString = systemConfiguration.get("deployment.system.config").get(); + if (urlString == null) { + if (JNLPRuntime.isDebug()) { + System.out.println("No System level " + DEPLOYMENT_PROPERTIES + " found."); + } + return false; + } + URL url = new URL(urlString); + if (url.getProtocol().equals("file")) { + systemPropertiesFile = new File(url.getFile()); + if (JNLPRuntime.isDebug()) { + System.out.println("Using System level" + DEPLOYMENT_PROPERTIES + ": " + + systemPropertiesFile); + } + ConfigValue mandatory = systemConfiguration.get("deployment.system.config.mandatory"); + systemPropertiesMandatory = Boolean.valueOf(mandatory == null? null: mandatory.get()); + return true; + } else { + if (JNLPRuntime.isDebug()) { + System.out.println("Remote + " + DEPLOYMENT_PROPERTIES + " not supported"); + } + return false; + } + } catch (MalformedURLException e) { + if (JNLPRuntime.isDebug()) { + System.out.println("Invalid url for " + DEPLOYMENT_PROPERTIES); + } From ahughes at redhat.com Tue Oct 26 02:52:38 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Tue, 26 Oct 2010 10:52:38 +0100 Subject: About recent Security Advisories In-Reply-To: References: <1ab27589b677c9b998f32f365fbb41a5.squirrel@webmail.conectiva.com.br> <1288035788.2330.24.camel@hermans.wildebeest.org> Message-ID: <20101026095237.GA6347@rivendell.middle-earth.co.uk> On 17:58 Mon 25 Oct , Paulo C?sar Pereira de Andrade wrote: > Mark Wielaard wrote: > > On Mon, 2010-10-25 at 17:31 -0200, Paulo C??sar Pereira de Andrade wrote: > >> Hi, > > Hi Mark, > > >> Does http://lwn.net/Articles/410013/ affect recent openjdk and/or b18 > >> in some way? > > > > The IcedTea6 (1.7.5, 1.8.2, 1.9.1) packages contain these fixes: > > http://lwn.net/Articles/409833/ > > Many thanks for the information. I will update the Mandriva cooker > openjdk package. > > Paulo > There were announced on this list: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-October/010478.html I also post the release announcements to my blog at http://blog.fuseyism.com -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From dalibor.topic at oracle.com Tue Oct 26 03:00:05 2010 From: dalibor.topic at oracle.com (Dalibor Topic) Date: Tue, 26 Oct 2010 12:00:05 +0200 Subject: About recent Security Advisories In-Reply-To: <1ab27589b677c9b998f32f365fbb41a5.squirrel@webmail.conectiva.com.br> References: <1ab27589b677c9b998f32f365fbb41a5.squirrel@webmail.conectiva.com.br> Message-ID: <4CC6A6A5.7090806@oracle.com> On 10/25/10 9:31 PM, Paulo C?sar Pereira de Andrade wrote: > Hi, > > Does http://lwn.net/Articles/410013/ affect recent openjdk and/or b18 > in some way? Hi, the patches have been pushed into OpenJDK 6, and have made their way downstream as well, afaik. cheers, dalibor topic -- Oracle Dalibor Topic | Java F/OSS Ambassador Phone: +494023646738 | | | Mobile: +491772664192 Oracle Java Platform Group ORACLE Deutschland B.V. & Co. KG | Nagelsweg 55 | 20097 Hamburg ORACLE Deutschland B.V. & Co. KG Hauptverwaltung: Riesstr. 25, D-80992 M?nchen Registergericht: Amtsgericht M?nchen, HRA 95603 Komplement?rin: ORACLE Deutschland Verwaltung B.V. Rijnzathe 6, 3454PV De Meern, Niederlande Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697 Gesch?ftsf?hrer: J?rgen Kunz, Marcel van de Molen, Alexander van der Ven Green Oracle Oracle is committed to developing practices and products that help protect the environment From ahughes at redhat.com Tue Oct 26 03:56:12 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Tue, 26 Oct 2010 11:56:12 +0100 Subject: [RFC] icedtea-web: make clean errors when building in a separate directory In-Reply-To: <20101025151027.GB29650@redhat.com> References: <88726091.3081288018347234.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> <600997675.5561288019088314.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> <20101025151027.GB29650@redhat.com> Message-ID: <20101026105612.GE6347@rivendell.middle-earth.co.uk> On 11:10 Mon 25 Oct , Deepak Bhole wrote: > * Andrew Su [2010-10-25 11:05]: > > Hi, > > > > This patch fixes the order of cleaning the directory for the "launcher". > > It was removing launcher folder after trying to rmdir the icedteanp folder (this folder is not empty but folders are not considered "stuff" inside the folder). > > This patch just reorders it to remove the launcher folder before doing the rest of the clean. > > > > Makefile.am: > > (clean-IcedTeaPlugin): Remove launcher folder first > > (clean-plugin): removed called to remove launcher folder > > > > Cheers, > > Andrew > > Looks good! OK for HEAD. > > Cheers, > Deepak > I spotted an issue with this too when working on the code cleanup but didn't want to mix the two fixes. Instead of rm -rf, I think it should be: rm -f $(PLUGIN_DIR)/*.o rmdir $(PLUGIN_DIR) so it fails if anything else is in the plugin dir rather than deleting it. > > diff -r eb998ed0ab1a Makefile.am > > --- a/Makefile.am Fri Oct 22 10:44:12 2010 -0400 > > +++ b/Makefile.am Mon Oct 25 10:45:44 2010 -0400 > > @@ -188,6 +188,7 @@ > > $(CC) $(LAUNCHER_LINK) $(PLUGIN_LAUNCHER_OBJECTS) > > > > clean-IcedTeaPlugin: > > + rm -rf $(PLUGIN_DIR)/launcher > > rm -f $(PLUGIN_DIR)/*.o > > rm -f $(PLUGIN_DIR)/IcedTeaPlugin.so > > if [ $(abs_top_srcdir) != $(abs_top_builddir) ]; then \ > > @@ -203,7 +204,6 @@ > > touch stamps/plugin.stamp > > > > clean-plugin: $(ICEDTEAPLUGIN_CLEAN) > > - rm -rf $(PLUGIN_DIR)/launcher > > rm -f stamps/plugin.stamp > > > > liveconnect-source-files.txt: > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From liuqi at icedtea.classpath.org Tue Oct 26 04:36:46 2010 From: liuqi at icedtea.classpath.org (liuqi at icedtea.classpath.org) Date: Tue, 26 Oct 2010 11:36:46 +0000 Subject: /hg/openjdk6-mips: Set TwoOperandLIRForm to true. Message-ID: changeset 817893aa0b86 in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=817893aa0b86 author: YANG Yongqiang date: Tue Oct 26 18:23:20 2010 +0800 Set TwoOperandLIRForm to true. LIR used in mips is of TwoOperandLIRForm, so TwoOperandLIRForm should be set to true. diffstat: 1 file changed, 1 insertion(+), 1 deletion(-) hotspot/src/cpu/mips/vm/c1_globals_mips.hpp | 2 +- diffs (12 lines): diff -r d1c481f44844 -r 817893aa0b86 hotspot/src/cpu/mips/vm/c1_globals_mips.hpp --- a/hotspot/src/cpu/mips/vm/c1_globals_mips.hpp Mon Oct 25 15:43:04 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/c1_globals_mips.hpp Tue Oct 26 18:23:20 2010 +0800 @@ -69,7 +69,7 @@ define_pd_global(bool, LIRFillDelaySlots define_pd_global(bool, LIRFillDelaySlots, false); define_pd_global(bool, OptimizeSinglePrecision, true); define_pd_global(bool, CSEArrayLength, false); -define_pd_global(bool, TwoOperandLIRForm, false); +define_pd_global(bool, TwoOperandLIRForm, true); define_pd_global(intx, SafepointPollOffset, 256); From asu at redhat.com Tue Oct 26 06:08:31 2010 From: asu at redhat.com (Andrew Su) Date: Tue, 26 Oct 2010 09:08:31 -0400 (EDT) Subject: [RFC] icedtea-web: make clean errors when building in a separate directory In-Reply-To: <1458466577.65871288097929704.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <1622800150.67711288098511460.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> ----- "Dr Andrew John Hughes" wrote: > From: "Dr Andrew John Hughes" > To: "Deepak Bhole" > Cc: "Andrew Su" , distro-pkg-dev at openjdk.java.net > Sent: Tuesday, October 26, 2010 6:56:12 AM GMT -05:00 US/Canada Eastern > Subject: Re: [RFC] icedtea-web: make clean errors when building in a separate directory > > On 11:10 Mon 25 Oct , Deepak Bhole wrote: > > * Andrew Su [2010-10-25 11:05]: > > > Hi, > > > > > > This patch fixes the order of cleaning the directory for the > "launcher". > > > It was removing launcher folder after trying to rmdir the > icedteanp folder (this folder is not empty but folders are not > considered "stuff" inside the folder). > > > This patch just reorders it to remove the launcher folder before > doing the rest of the clean. > > > > > > Makefile.am: > > > (clean-IcedTeaPlugin): Remove launcher folder first > > > (clean-plugin): removed called to remove launcher folder > > > > > > Cheers, > > > Andrew > > > > Looks good! OK for HEAD. > > > > Cheers, > > Deepak > > > > I spotted an issue with this too when working on the code cleanup but > didn't want to mix the two fixes. > > Instead of rm -rf, I think it should be: > > rm -f $(PLUGIN_DIR)/*.o > rmdir $(PLUGIN_DIR) > > so it fails if anything else is in the plugin dir rather than deleting > it. > The plugin dir is removed by rmdir only if it's empty. This just removed the launcher folder which is inside the plugin dir, and it only contains compiled code. Cheers, --Andrew > > > diff -r eb998ed0ab1a Makefile.am > > > --- a/Makefile.am Fri Oct 22 10:44:12 2010 -0400 > > > +++ b/Makefile.am Mon Oct 25 10:45:44 2010 -0400 > > > @@ -188,6 +188,7 @@ > > > $(CC) $(LAUNCHER_LINK) $(PLUGIN_LAUNCHER_OBJECTS) > > > > > > clean-IcedTeaPlugin: > > > + rm -rf $(PLUGIN_DIR)/launcher > > > rm -f $(PLUGIN_DIR)/*.o > > > rm -f $(PLUGIN_DIR)/IcedTeaPlugin.so > > > if [ $(abs_top_srcdir) != $(abs_top_builddir) ]; then \ > > > @@ -203,7 +204,6 @@ > > > touch stamps/plugin.stamp > > > > > > clean-plugin: $(ICEDTEAPLUGIN_CLEAN) > > > - rm -rf $(PLUGIN_DIR)/launcher > > > rm -f stamps/plugin.stamp > > > > > > liveconnect-source-files.txt: > > > > -- > Andrew :) > > Free Java Software Engineer > Red Hat, Inc. (http://www.redhat.com) > > Support Free Java! > Contribute to GNU Classpath and the OpenJDK > http://www.gnu.org/software/classpath > http://openjdk.java.net > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From liuqi at icedtea.classpath.org Tue Oct 26 06:25:13 2010 From: liuqi at icedtea.classpath.org (liuqi at icedtea.classpath.org) Date: Tue, 26 Oct 2010 13:25:13 +0000 Subject: /hg/openjdk6-mips: Enable double-precision remainder related ope... Message-ID: changeset 88ad8d87be77 in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=88ad8d87be77 author: YANG Yongqiang date: Tue Oct 26 20:09:04 2010 +0800 Enable double-precision remainder related operation. diffstat: 1 file changed, 3 insertions(+), 3 deletions(-) hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp | 6 +++--- diffs (16 lines): diff -r 817893aa0b86 -r 88ad8d87be77 hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp --- a/hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp Tue Oct 26 18:23:20 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp Tue Oct 26 20:09:04 2010 +0800 @@ -3006,9 +3006,9 @@ void LIR_Assembler::arith_op(LIR_Code co case lir_div_strictfp: __ div_d(res, lreg, rreg); break; -// case lir_rem: -// __ rem_d(res, lreg, rreg); -// break; + case lir_rem: + __ rem_d(res, lreg, rreg); + break; default : ShouldNotReachHere(); } } From ahughes at redhat.com Tue Oct 26 07:11:43 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Tue, 26 Oct 2010 15:11:43 +0100 Subject: [RFC] icedtea-web: make clean errors when building in a separate directory In-Reply-To: <1622800150.67711288098511460.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> References: <1458466577.65871288097929704.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> <1622800150.67711288098511460.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <20101026141143.GI6347@rivendell.middle-earth.co.uk> On 09:08 Tue 26 Oct , Andrew Su wrote: > > ----- "Dr Andrew John Hughes" wrote: > > > From: "Dr Andrew John Hughes" > > To: "Deepak Bhole" > > Cc: "Andrew Su" , distro-pkg-dev at openjdk.java.net > > Sent: Tuesday, October 26, 2010 6:56:12 AM GMT -05:00 US/Canada Eastern > > Subject: Re: [RFC] icedtea-web: make clean errors when building in a separate directory > > > > On 11:10 Mon 25 Oct , Deepak Bhole wrote: > > > * Andrew Su [2010-10-25 11:05]: > > > > Hi, > > > > > > > > This patch fixes the order of cleaning the directory for the > > "launcher". > > > > It was removing launcher folder after trying to rmdir the > > icedteanp folder (this folder is not empty but folders are not > > considered "stuff" inside the folder). > > > > This patch just reorders it to remove the launcher folder before > > doing the rest of the clean. > > > > > > > > Makefile.am: > > > > (clean-IcedTeaPlugin): Remove launcher folder first > > > > (clean-plugin): removed called to remove launcher folder > > > > > > > > Cheers, > > > > Andrew > > > > > > Looks good! OK for HEAD. > > > > > > Cheers, > > > Deepak > > > > > > > I spotted an issue with this too when working on the code cleanup but > > didn't want to mix the two fixes. > > > > Instead of rm -rf, I think it should be: > > > > rm -f $(PLUGIN_DIR)/*.o > > rmdir $(PLUGIN_DIR) > > > > so it fails if anything else is in the plugin dir rather than deleting > > it. > > > The plugin dir is removed by rmdir only if it's empty. Sorry that should have been: rm -f $(PLUGIN_DIR)/launcher/*.o rmdir $(PLUGIN_DIR)/launcher in place of: rm -rf $(PLUGIN_DIR)/launcher (your addition) I _want_ rmdir to fail if the launcher directory contains anything other than compiled objects. > This just removed the launcher folder which is inside the plugin dir, and it only contains compiled code. > > Cheers, > --Andrew > > > > > > > diff -r eb998ed0ab1a Makefile.am > > > > --- a/Makefile.am Fri Oct 22 10:44:12 2010 -0400 > > > > +++ b/Makefile.am Mon Oct 25 10:45:44 2010 -0400 > > > > @@ -188,6 +188,7 @@ > > > > $(CC) $(LAUNCHER_LINK) $(PLUGIN_LAUNCHER_OBJECTS) > > > > > > > > clean-IcedTeaPlugin: > > > > + rm -rf $(PLUGIN_DIR)/launcher > > > > rm -f $(PLUGIN_DIR)/*.o > > > > rm -f $(PLUGIN_DIR)/IcedTeaPlugin.so > > > > if [ $(abs_top_srcdir) != $(abs_top_builddir) ]; then \ > > > > @@ -203,7 +204,6 @@ > > > > touch stamps/plugin.stamp > > > > > > > > clean-plugin: $(ICEDTEAPLUGIN_CLEAN) > > > > - rm -rf $(PLUGIN_DIR)/launcher > > > > rm -f stamps/plugin.stamp > > > > > > > > liveconnect-source-files.txt: > > > > > > > -- > > Andrew :) > > > > Free Java Software Engineer > > Red Hat, Inc. (http://www.redhat.com) > > > > Support Free Java! > > Contribute to GNU Classpath and the OpenJDK > > http://www.gnu.org/software/classpath > > http://openjdk.java.net > > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From omajid at redhat.com Tue Oct 26 07:43:12 2010 From: omajid at redhat.com (Omair Majid) Date: Tue, 26 Oct 2010 10:43:12 -0400 Subject: [icedtea-web] Why use a separate basedir for plugin? Message-ID: <4CC6E900.8050709@redhat.com> Hi, I noticed that the plugin uses a different basedir (see JNLPRuntime.setBaseDir) from javaws. Is there a reason why? Since committing the deployment configuration patch, I have been working on integrating it into icedtea-web (I believe that ~/.netxrc is deprecated as of now). The deployment settings however, do not distinguish between plugin and javaws - whether in terms of the cache they use or which certificates are considered trusted. Hence I would like to make them both use the same certificates and cache (and possibly other things). Are there any reasons against doing this? Thanks, Omair From asu at redhat.com Tue Oct 26 07:45:19 2010 From: asu at redhat.com (Andrew Su) Date: Tue, 26 Oct 2010 10:45:19 -0400 (EDT) Subject: [RFC] icedtea-web: make clean errors when building in a separate directory In-Reply-To: <1587434975.87531288104131563.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <1893917270.88201288104319673.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> ----- "Dr Andrew John Hughes" wrote: > From: "Dr Andrew John Hughes" > To: "Andrew Su" > Cc: distro-pkg-dev at openjdk.java.net, "Deepak Bhole" > Sent: Tuesday, October 26, 2010 10:11:43 AM GMT -05:00 US/Canada Eastern > Subject: Re: [RFC] icedtea-web: make clean errors when building in a separate directory > > On 09:08 Tue 26 Oct , Andrew Su wrote: > > > > ----- "Dr Andrew John Hughes" wrote: > > > > > From: "Dr Andrew John Hughes" > > > To: "Deepak Bhole" > > > Cc: "Andrew Su" , distro-pkg-dev at openjdk.java.net > > > Sent: Tuesday, October 26, 2010 6:56:12 AM GMT -05:00 US/Canada > Eastern > > > Subject: Re: [RFC] icedtea-web: make clean errors when building in > a separate directory > > > > > > On 11:10 Mon 25 Oct , Deepak Bhole wrote: > > > > * Andrew Su [2010-10-25 11:05]: > > > > > Hi, > > > > > > > > > > This patch fixes the order of cleaning the directory for the > > > "launcher". > > > > > It was removing launcher folder after trying to rmdir the > > > icedteanp folder (this folder is not empty but folders are not > > > considered "stuff" inside the folder). > > > > > This patch just reorders it to remove the launcher folder > before > > > doing the rest of the clean. > > > > > > > > > > Makefile.am: > > > > > (clean-IcedTeaPlugin): Remove launcher folder first > > > > > (clean-plugin): removed called to remove launcher folder > > > > > > > > > > Cheers, > > > > > Andrew > > > > > > > > Looks good! OK for HEAD. > > > > > > > > Cheers, > > > > Deepak > > > > > > > > > > I spotted an issue with this too when working on the code cleanup > but > > > didn't want to mix the two fixes. > > > > > > Instead of rm -rf, I think it should be: > > > > > > rm -f $(PLUGIN_DIR)/*.o > > > rmdir $(PLUGIN_DIR) > > > > > > so it fails if anything else is in the plugin dir rather than > deleting > > > it. > > > > > The plugin dir is removed by rmdir only if it's empty. > > Sorry that should have been: > > rm -f $(PLUGIN_DIR)/launcher/*.o > rmdir $(PLUGIN_DIR)/launcher > > in place of: > > rm -rf $(PLUGIN_DIR)/launcher (your addition) This line was how it was done before just moved it. Well, I've attached patch to update using rmdir. Ok with this? --Andrew > > I _want_ rmdir to fail if the launcher directory contains anything > other than compiled objects. > > > This just removed the launcher folder which is inside the plugin > dir, and it only contains compiled code. > > > > Cheers, > > --Andrew > > > > > > > > > > > diff -r eb998ed0ab1a Makefile.am > > > > > --- a/Makefile.am Fri Oct 22 10:44:12 2010 -0400 > > > > > +++ b/Makefile.am Mon Oct 25 10:45:44 2010 -0400 > > > > > @@ -188,6 +188,7 @@ > > > > > $(CC) $(LAUNCHER_LINK) $(PLUGIN_LAUNCHER_OBJECTS) > > > > > > > > > > clean-IcedTeaPlugin: > > > > > + rm -rf $(PLUGIN_DIR)/launcher > > > > > rm -f $(PLUGIN_DIR)/*.o > > > > > rm -f $(PLUGIN_DIR)/IcedTeaPlugin.so > > > > > if [ $(abs_top_srcdir) != $(abs_top_builddir) ]; then \ > > > > > @@ -203,7 +204,6 @@ > > > > > touch stamps/plugin.stamp > > > > > > > > > > clean-plugin: $(ICEDTEAPLUGIN_CLEAN) > > > > > - rm -rf $(PLUGIN_DIR)/launcher > > > > > rm -f stamps/plugin.stamp > > > > > > > > > > liveconnect-source-files.txt: > > > > > > > > > > -- > > > Andrew :) > > > > > > Free Java Software Engineer > > > Red Hat, Inc. (http://www.redhat.com) > > > > > > Support Free Java! > > > Contribute to GNU Classpath and the OpenJDK > > > http://www.gnu.org/software/classpath > > > http://openjdk.java.net > > > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > > > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 > > -- > Andrew :) > > Free Java Software Engineer > Red Hat, Inc. (http://www.redhat.com) > > Support Free Java! > Contribute to GNU Classpath and the OpenJDK > http://www.gnu.org/software/classpath > http://openjdk.java.net > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 -------------- next part -------------- A non-text attachment was scrubbed... Name: 20101026_change_to_rmdir.patch Type: text/x-patch Size: 498 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101026/8363efb0/20101026_change_to_rmdir.patch From ahughes at redhat.com Tue Oct 26 08:06:19 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Tue, 26 Oct 2010 16:06:19 +0100 Subject: [RFC] icedtea-web: make clean errors when building in a separate directory In-Reply-To: <1893917270.88201288104319673.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> References: <1587434975.87531288104131563.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> <1893917270.88201288104319673.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> Message-ID: <20101026150619.GO6347@rivendell.middle-earth.co.uk> On 10:45 Tue 26 Oct , Andrew Su wrote: > > ----- "Dr Andrew John Hughes" wrote: > > > From: "Dr Andrew John Hughes" > > To: "Andrew Su" > > Cc: distro-pkg-dev at openjdk.java.net, "Deepak Bhole" > > Sent: Tuesday, October 26, 2010 10:11:43 AM GMT -05:00 US/Canada Eastern > > Subject: Re: [RFC] icedtea-web: make clean errors when building in a separate directory > > > > On 09:08 Tue 26 Oct , Andrew Su wrote: > > > > > > ----- "Dr Andrew John Hughes" wrote: > > > > > > > From: "Dr Andrew John Hughes" > > > > To: "Deepak Bhole" > > > > Cc: "Andrew Su" , distro-pkg-dev at openjdk.java.net > > > > Sent: Tuesday, October 26, 2010 6:56:12 AM GMT -05:00 US/Canada > > Eastern > > > > Subject: Re: [RFC] icedtea-web: make clean errors when building in > > a separate directory > > > > > > > > On 11:10 Mon 25 Oct , Deepak Bhole wrote: > > > > > * Andrew Su [2010-10-25 11:05]: > > > > > > Hi, > > > > > > > > > > > > This patch fixes the order of cleaning the directory for the > > > > "launcher". > > > > > > It was removing launcher folder after trying to rmdir the > > > > icedteanp folder (this folder is not empty but folders are not > > > > considered "stuff" inside the folder). > > > > > > This patch just reorders it to remove the launcher folder > > before > > > > doing the rest of the clean. > > > > > > > > > > > > Makefile.am: > > > > > > (clean-IcedTeaPlugin): Remove launcher folder first > > > > > > (clean-plugin): removed called to remove launcher folder > > > > > > > > > > > > Cheers, > > > > > > Andrew > > > > > > > > > > Looks good! OK for HEAD. > > > > > > > > > > Cheers, > > > > > Deepak > > > > > > > > > > > > > I spotted an issue with this too when working on the code cleanup > > but > > > > didn't want to mix the two fixes. > > > > > > > > Instead of rm -rf, I think it should be: > > > > > > > > rm -f $(PLUGIN_DIR)/*.o > > > > rmdir $(PLUGIN_DIR) > > > > > > > > so it fails if anything else is in the plugin dir rather than > > deleting > > > > it. > > > > > > > The plugin dir is removed by rmdir only if it's empty. > > > > Sorry that should have been: > > > > rm -f $(PLUGIN_DIR)/launcher/*.o > > rmdir $(PLUGIN_DIR)/launcher > > > > in place of: > > > > rm -rf $(PLUGIN_DIR)/launcher (your addition) > This line was how it was done before just moved it. Well, I've attached patch to update using rmdir. Ok with this? > > --Andrew > > > > > I _want_ rmdir to fail if the launcher directory contains anything > > other than compiled objects. > > > > > This just removed the launcher folder which is inside the plugin > > dir, and it only contains compiled code. > > > > > > Cheers, > > > --Andrew > > > > > > > > > > > > > > > diff -r eb998ed0ab1a Makefile.am > > > > > > --- a/Makefile.am Fri Oct 22 10:44:12 2010 -0400 > > > > > > +++ b/Makefile.am Mon Oct 25 10:45:44 2010 -0400 > > > > > > @@ -188,6 +188,7 @@ > > > > > > $(CC) $(LAUNCHER_LINK) $(PLUGIN_LAUNCHER_OBJECTS) > > > > > > > > > > > > clean-IcedTeaPlugin: > > > > > > + rm -rf $(PLUGIN_DIR)/launcher > > > > > > rm -f $(PLUGIN_DIR)/*.o > > > > > > rm -f $(PLUGIN_DIR)/IcedTeaPlugin.so > > > > > > if [ $(abs_top_srcdir) != $(abs_top_builddir) ]; then \ > > > > > > @@ -203,7 +204,6 @@ > > > > > > touch stamps/plugin.stamp > > > > > > > > > > > > clean-plugin: $(ICEDTEAPLUGIN_CLEAN) > > > > > > - rm -rf $(PLUGIN_DIR)/launcher > > > > > > rm -f stamps/plugin.stamp > > > > > > > > > > > > liveconnect-source-files.txt: > > > > > > > > > > > > > -- > > > > Andrew :) > > > > > > > > Free Java Software Engineer > > > > Red Hat, Inc. (http://www.redhat.com) > > > > > > > > Support Free Java! > > > > Contribute to GNU Classpath and the OpenJDK > > > > http://www.gnu.org/software/classpath > > > > http://openjdk.java.net > > > > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > > > > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 > > > > -- > > Andrew :) > > > > Free Java Software Engineer > > Red Hat, Inc. (http://www.redhat.com) > > > > Support Free Java! > > Contribute to GNU Classpath and the OpenJDK > > http://www.gnu.org/software/classpath > > http://openjdk.java.net > > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 > diff -r b1b876d99849 Makefile.am > --- a/Makefile.am Mon Oct 25 17:16:13 2010 -0400 > +++ b/Makefile.am Tue Oct 26 10:43:40 2010 -0400 > @@ -188,7 +188,9 @@ > $(CC) $(LAUNCHER_LINK) $(PLUGIN_LAUNCHER_OBJECTS) > > clean-IcedTeaPlugin: > - rm -rf $(PLUGIN_DIR)/launcher > + rm -f $(PLUGIN_DIR)/launcher/*.o > + rm -f $(PLUGIN_DIR)/launcher/pluginappletviewer > + rmdir $(PLUGIN_DIR)/launcher > rm -f $(PLUGIN_DIR)/*.o > rm -f $(PLUGIN_DIR)/IcedTeaPlugin.so > if [ $(abs_top_srcdir) != $(abs_top_builddir) ]; then \ Yes, that looks better. Thanks. Please apply. -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From omajid at redhat.com Tue Oct 26 08:39:06 2010 From: omajid at redhat.com (Omair Majid) Date: Tue, 26 Oct 2010 11:39:06 -0400 Subject: [icedtea-web] RFC: unify localization code In-Reply-To: <4CC5CF8D.2060100@redhat.com> References: <4CC5B635.5030902@redhat.com> <20101025172244.GA31205@redhat.com> <4CC5CA73.6080204@redhat.com> <4CC5CAE4.8030300@redhat.com> <20101025182445.GD31205@redhat.com> <4CC5CF8D.2060100@redhat.com> Message-ID: <4CC6F61A.3000007@redhat.com> On 10/25/2010 02:42 PM, Omair Majid wrote: > On 10/25/2010 02:24 PM, Deepak Bhole wrote: >> * Omair Majid [2010-10-25 14:22]: >>> On 10/25/2010 02:20 PM, Omair Majid wrote: >>>> On 10/25/2010 01:22 PM, Deepak Bhole wrote: >>>>> * Omair Majid [2010-10-25 12:54]: >>>>>> Hi, >>>>>> >>>>>> Netx contains a number of duplicate methods named "R" defined in >>>>>> various files that act as a wrapper for JNLPRuntime.getMessage(). >>>>>> The attached patch creates a new class Translate and moves all the >>>>>> "R" methods to it. This set of overloaded "R" methods is then >>>>>> statically imported anywhere that needs localized strings. >>>>>> >>>>> >>>>> While it is being refactored, why not use varargs for R()? >>>>> >>>> >>>> Fixed. >>> >>> Grr.. Accceidentally sent without finishing email :( >>> >>> Here is the attachment. >>> >> >> Looks good. Okay for commit to HEAD. >> >> Deepak >> > > Thanks. Pushed to HEAD. > I think I broke simple string translation :( New patch is attached. ChangeLog: 2010-10-26 Omair Majid * netx/net/sourceforge/jnlp/runtime/Translator.java (R(String)): New method. Any comments? Thanks, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-web-fix-translator.patch Type: text/x-patch Size: 626 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101026/d0231b40/icedtea-web-fix-translator.patch From asu at icedtea.classpath.org Tue Oct 26 08:59:49 2010 From: asu at icedtea.classpath.org (asu at icedtea.classpath.org) Date: Tue, 26 Oct 2010 15:59:49 +0000 Subject: /hg/icedtea-web: Changed to use rmdir instead of rm -rf for laun... Message-ID: changeset dfd749c077c3 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=dfd749c077c3 author: Andrew Su date: Tue Oct 26 12:01:22 2010 -0400 Changed to use rmdir instead of rm -rf for launcher directory. diffstat: 2 files changed, 8 insertions(+), 1 deletion(-) ChangeLog | 5 +++++ Makefile.am | 4 +++- diffs (26 lines): diff -r b1b876d99849 -r dfd749c077c3 ChangeLog --- a/ChangeLog Mon Oct 25 17:16:13 2010 -0400 +++ b/ChangeLog Tue Oct 26 12:01:22 2010 -0400 @@ -1,3 +1,8 @@ 2010-10-25 Omair Majid + + * Makefile.am: Split rm -rf into rm -f and rmdir for launcher + directory. + 2010-10-25 Omair Majid * netx/net/sourceforge/jnlp/ShortcutDesc.java: diff -r b1b876d99849 -r dfd749c077c3 Makefile.am --- a/Makefile.am Mon Oct 25 17:16:13 2010 -0400 +++ b/Makefile.am Tue Oct 26 12:01:22 2010 -0400 @@ -188,7 +188,9 @@ PLUGIN_OBJECTS=IcedTeaNPPlugin.o IcedTea $(CC) $(LAUNCHER_LINK) $(PLUGIN_LAUNCHER_OBJECTS) clean-IcedTeaPlugin: - rm -rf $(PLUGIN_DIR)/launcher + rm -f $(PLUGIN_DIR)/launcher/*.o + rm -f $(PLUGIN_DIR)/launcher/pluginappletviewer + rmdir $(PLUGIN_DIR)/launcher rm -f $(PLUGIN_DIR)/*.o rm -f $(PLUGIN_DIR)/IcedTeaPlugin.so if [ $(abs_top_srcdir) != $(abs_top_builddir) ]; then \ From dbhole at redhat.com Tue Oct 26 10:14:01 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Tue, 26 Oct 2010 13:14:01 -0400 Subject: [icedtea-web] RFC: unify localization code In-Reply-To: <4CC6F61A.3000007@redhat.com> References: <4CC5B635.5030902@redhat.com> <20101025172244.GA31205@redhat.com> <4CC5CA73.6080204@redhat.com> <4CC5CAE4.8030300@redhat.com> <20101025182445.GD31205@redhat.com> <4CC5CF8D.2060100@redhat.com> <4CC6F61A.3000007@redhat.com> Message-ID: <20101026171400.GA13608@redhat.com> * Omair Majid [2010-10-26 11:39]: > On 10/25/2010 02:42 PM, Omair Majid wrote: > >On 10/25/2010 02:24 PM, Deepak Bhole wrote: > >>* Omair Majid [2010-10-25 14:22]: > >>>On 10/25/2010 02:20 PM, Omair Majid wrote: > >>>>On 10/25/2010 01:22 PM, Deepak Bhole wrote: > >>>>>* Omair Majid [2010-10-25 12:54]: > >>>>>>Hi, > >>>>>> > >>>>>>Netx contains a number of duplicate methods named "R" defined in > >>>>>>various files that act as a wrapper for JNLPRuntime.getMessage(). > >>>>>>The attached patch creates a new class Translate and moves all the > >>>>>>"R" methods to it. This set of overloaded "R" methods is then > >>>>>>statically imported anywhere that needs localized strings. > >>>>>> > >>>>> > >>>>>While it is being refactored, why not use varargs for R()? > >>>>> > >>>> > >>>>Fixed. > >>> > >>>Grr.. Accceidentally sent without finishing email :( > >>> > >>>Here is the attachment. > >>> > >> > >>Looks good. Okay for commit to HEAD. > >> > >>Deepak > >> > > > >Thanks. Pushed to HEAD. > > > > I think I broke simple string translation :( New patch is attached. > > ChangeLog: > 2010-10-26 Omair Majid > > * netx/net/sourceforge/jnlp/runtime/Translator.java > (R(String)): New method. > > Any comments? > Looks fine to me. Ok for HEAD. Deepak > Thanks, > Omair > diff -r b1b876d99849 netx/net/sourceforge/jnlp/runtime/Translator.java > --- a/netx/net/sourceforge/jnlp/runtime/Translator.java Mon Oct 25 17:16:13 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/Translator.java Tue Oct 26 11:23:53 2010 -0400 > @@ -28,4 +28,13 @@ > return JNLPRuntime.getMessage(message, params); > } > > + /** > + * Return a translated (localized) version of the message > + * @param message the message to translate > + * @return a string representing the localized message > + */ > + public static String R(String message) { > + return JNLPRuntime.getMessage(message); > + } > + > } From omajid at redhat.com Tue Oct 26 11:38:13 2010 From: omajid at redhat.com (Omair Majid) Date: Tue, 26 Oct 2010 14:38:13 -0400 Subject: [icedtea-web] RFC: fix null dtd for swing applications rendering html Message-ID: <4CC72015.4050401@redhat.com> Hi, There has been a regression in netx: applications that render html (using Swing components) now fail with a null pointer exception. This problem can be reproduced by running the program at [1]. The problem is caused by how HTMLEditorKit/HTMLDocument and ParserDelgator interact in the presence of multiple AppContexts. The instance of the ParserDelegate is shared between multiple HTMLEditorKit in different AppContexts. However, ParserDelegate maintains a per-AppContext dtd instance. The dtd is valid in the AppContext that created the ParserDelegate but null in all other AppContexts. Using this null dtd throws a NullPointerException. This is really a bug in OpenJDK6 rather than Netx. Fortunately, this bug has been fixed in OpenJDK7 - ParserDelegate maintains an instance of the dtd per runtime instead of per AppContext. The attached patch works around this bug. It manually creates a ParserDelegate for each AppContext to avoid this problem. ChangeLog 2010-10-26 Omair Majid * netx/net/sourceforge/jnlp/Launcher.java (doPerApplicationAppContextHacks): New method. (TgThread.run): Call doPerApplicationAppContextHacks. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime (initialize): Call doMainAppContextHacks. (doMainAppContextHacks): New method. Any comments? Thanks, Omair [1] http://www.ucware.com/apev/jaws/apev.jnlp -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-web-parser-per-appcontext.patch Type: text/x-patch Size: 3176 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101026/e9837d54/icedtea-web-parser-per-appcontext.patch From omajid at redhat.com Tue Oct 26 13:04:14 2010 From: omajid at redhat.com (Omair Majid) Date: Tue, 26 Oct 2010 16:04:14 -0400 Subject: [icedtea-web] RFC: launch application that have a non-public main class Message-ID: <4CC7343E.9060705@redhat.com> Hi, The attached patch bypasses checks imposed by the reflection API to ensure that netx is allowed to access the class it is trying to access. Generally, this makes complete sense. However, there are some applications (such as the Present/Future Value Calculator [1]) that declare their main method in a non public class. Netx currently fails with an IllegalAccessException when it encounters this. ChangeLog 2010-10-26 Omair Majid * netx/net/sourceforge/jnlp/Launcher.java (launchApplication): Mark main method as accessible before invoking it. Thanks, Omair [1] http://www.arbores.ca/PresentFuture.jnlp -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-web-jnlp-bypass-restirctions-to-main.patch Type: text/x-patch Size: 419 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101026/f0ba854b/icedtea-web-jnlp-bypass-restirctions-to-main.patch From dbhole at redhat.com Tue Oct 26 13:33:40 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Tue, 26 Oct 2010 16:33:40 -0400 Subject: [icedtea-web] RFC: fix null dtd for swing applications rendering html In-Reply-To: <4CC72015.4050401@redhat.com> References: <4CC72015.4050401@redhat.com> Message-ID: <20101026203227.GA3781@redhat.com> * Omair Majid [2010-10-26 15:46]: > Hi, > > There has been a regression in netx: applications that render html > (using Swing components) now fail with a null pointer exception. > This problem can be reproduced by running the program at [1]. > What caused this regression? I thought all the app context stuff was still disabled, with just the support added on the side? > The problem is caused by how HTMLEditorKit/HTMLDocument and > ParserDelgator interact in the presence of multiple AppContexts. The > instance of the ParserDelegate is shared between multiple > HTMLEditorKit in different AppContexts. However, ParserDelegate > maintains a per-AppContext dtd instance. The dtd is valid in the > AppContext that created the ParserDelegate but null in all other > AppContexts. Using this null dtd throws a NullPointerException. This > is really a bug in OpenJDK6 rather than Netx. Fortunately, this bug > has been fixed in OpenJDK7 - ParserDelegate maintains an instance of > the dtd per runtime instead of per AppContext. > > The attached patch works around this bug. It manually creates a > ParserDelegate for each AppContext to avoid this problem. > Assuming you have tested this, OK for head. Cheers, Deepak > ChangeLog > 2010-10-26 Omair Majid > > * netx/net/sourceforge/jnlp/Launcher.java > (doPerApplicationAppContextHacks): New method. > (TgThread.run): Call doPerApplicationAppContextHacks. > * netx/net/sourceforge/jnlp/runtime/JNLPRuntime > (initialize): Call doMainAppContextHacks. > (doMainAppContextHacks): New method. > > Any comments? > > Thanks, > Omair > > [1] http://www.ucware.com/apev/jaws/apev.jnlp > diff -r b1b876d99849 netx/net/sourceforge/jnlp/Launcher.java > --- a/netx/net/sourceforge/jnlp/Launcher.java Mon Oct 25 17:16:13 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/Launcher.java Tue Oct 26 13:55:32 2010 -0400 > @@ -50,6 +50,7 @@ > import net.sourceforge.jnlp.util.Reflect; > > import javax.swing.SwingUtilities; > +import javax.swing.text.html.parser.ParserDelegator; > > import sun.awt.SunToolkit; > > @@ -778,6 +779,22 @@ > } > } > > + /** > + * Do hacks on per-application level to allow different AppContexts to work > + * > + * @see JNLPRuntime#doMainAppContextHacks > + */ > + private static void doPerApplicationAppContextHacks() { > + > + /* > + * With OpenJDK6 (but not with 7) a per-AppContext dtd is maintained. > + * This dtd is created by the ParserDelgate. However, the code in > + * HTMLEditorKit (used to render HTML in labels and textpanes) creates > + * the ParserDelegate only if there are no existing ParserDelegates. The > + * result is that all other AppContexts see a null dtd. > + */ > + new ParserDelegator(); > + } > > /** > * This runnable is used to call the appropriate launch method > @@ -815,6 +832,8 @@ > if (context && !isPlugin) > SunToolkit.createNewAppContext(); > > + doPerApplicationAppContextHacks(); > + > if (isPlugin) { > // Do not display download indicators if we're using gcjwebplugin. > JNLPRuntime.setDefaultDownloadIndicator(null); > diff -r b1b876d99849 netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Mon Oct 25 17:16:13 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Tue Oct 26 13:55:32 2010 -0400 > @@ -27,6 +27,7 @@ > import javax.jnlp.*; > import javax.naming.ConfigurationException; > import javax.swing.UIManager; > +import javax.swing.text.html.parser.ParserDelegator; > > import net.sourceforge.jnlp.*; > import net.sourceforge.jnlp.cache.*; > @@ -232,6 +200,8 @@ > // ignore it > } > > + doMainAppContextHacks(); > + > if (securityEnabled) { > Policy.setPolicy(policy); // do first b/c our SM blocks setPolicy > System.setSecurityManager(security); > @@ -261,6 +231,23 @@ > } > > /** > + * Performs a few hacks that are needed for the main AppContext > + * > + * @see Launcher#doPerApplicationAppContextHacks > + */ > + private static void doMainAppContextHacks() { > + > + /* > + * With OpenJDK6 (but not with 7) a per-AppContext dtd is maintained. > + * This dtd is created by the ParserDelgate. However, the code in > + * HTMLEditorKit (used to render HTML in labels and textpanes) creates > + * the ParserDelegate only if there are no existing ParserDelegates. The > + * result is that all other AppContexts see a null dtd. > + */ > + new ParserDelegator(); > + } > + > + /** > * Gets the Configuration associated with this runtime > * @return a {@link DeploymentConfiguration} object that can be queried to > * find relevant configuration settings From omajid at redhat.com Tue Oct 26 13:35:38 2010 From: omajid at redhat.com (Omair Majid) Date: Tue, 26 Oct 2010 16:35:38 -0400 Subject: [icedtea-web] RFC: add more JNLP spec numbers Message-ID: <4CC73B9A.5000302@redhat.com> Hi, The attached patch adds more "supported" specification numbers to netx. Secureftp2 [1] contains a JNLP file with a specification version 1.4 (I think they might have confused the Java version with the JNLP version...). In anticipation of the worst, I have also added 1.3 as a supported version. Personally I am starting to doubt the point of checking and failing if the jnlp file specifies an unsupported version - I think netx should try and run whatever it can instead of failing based on a (often wrong) version. ChangeLog 2010-20-26 Omair Majid * netx/net/sourceforge/jnlp/Parser.java: Add 1.3 and 1.4 to supportedVersions. Thanks, Omair [1] http://www.glub.com/products/secureftp/jws/secureftp2.jnlp -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-web-add-supported-versions.patch Type: text/x-patch Size: 571 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101026/2532e2a5/icedtea-web-add-supported-versions.patch From omajid at redhat.com Tue Oct 26 13:57:15 2010 From: omajid at redhat.com (Omair Majid) Date: Tue, 26 Oct 2010 16:57:15 -0400 Subject: [icedtea-web] RFC: fix null dtd for swing applications rendering html In-Reply-To: <20101026203227.GA3781@redhat.com> References: <4CC72015.4050401@redhat.com> <20101026203227.GA3781@redhat.com> Message-ID: <4CC740AB.3050700@redhat.com> Hi Deepak, Thanks for taking a look at this! On 10/26/2010 04:33 PM, Deepak Bhole wrote: > * Omair Majid [2010-10-26 15:46]: >> There has been a regression in netx: applications that render html >> (using Swing components) now fail with a null pointer exception. >> This problem can be reproduced by running the program at [1]. >> > > What caused this regression? I thought all the app context stuff was > still disabled, with just the support added on the side? > The regression itself was caused by having security dialogs in one AppContext and the actual application in another AppContext. The AppContext stuff is enabled and working (in fact, some of the AppContext code was part of the original import of Netx into IcedTea and has been active ever since - most of my recent patches are about enabling it in the plugin case too and using AppContext correctly to gain its benefits). It is what allows multiple applets to have their own look and feels and allows security dialogs to always use the system look and feel without setting the look and feel of applets (or jnlp applications) too. I thought I had made it pretty explicit in my patches and changelogs :( What is still disabled is allowing applets/applications to access their individual EventQueues. This is because of a security patch that has been recently been committed to OpenJDK7. This patch provides some additional API and says (and I am paraphrasing): "here is some API that allows the proprietary plugin to check if AWT events are generated by the system". I dont know how to make use of it, so I havent added code to allow applets to access their EventQueues. At least one application - a swing demo, no less [1] - fails without this. >> The problem is caused by how HTMLEditorKit/HTMLDocument and >> ParserDelgator interact in the presence of multiple AppContexts. The >> instance of the ParserDelegate is shared between multiple >> HTMLEditorKit in different AppContexts. However, ParserDelegate >> maintains a per-AppContext dtd instance. The dtd is valid in the >> AppContext that created the ParserDelegate but null in all other >> AppContexts. Using this null dtd throws a NullPointerException. This >> is really a bug in OpenJDK6 rather than Netx. Fortunately, this bug >> has been fixed in OpenJDK7 - ParserDelegate maintains an instance of >> the dtd per runtime instead of per AppContext. >> >> The attached patch works around this bug. It manually creates a >> ParserDelegate for each AppContext to avoid this problem. >> > > Assuming you have tested this, OK for head. > Thanks Omair [1] http://download.oracle.com/javase/tutorial/ui/overview/demo.html From dbhole at redhat.com Tue Oct 26 14:09:52 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Tue, 26 Oct 2010 17:09:52 -0400 Subject: [icedtea-web] RFC: fix null dtd for swing applications rendering html In-Reply-To: <4CC740AB.3050700@redhat.com> References: <4CC72015.4050401@redhat.com> <20101026203227.GA3781@redhat.com> <4CC740AB.3050700@redhat.com> Message-ID: <20101026210952.GB3781@redhat.com> * Omair Majid [2010-10-26 16:57]: > Hi Deepak, > > Thanks for taking a look at this! > > On 10/26/2010 04:33 PM, Deepak Bhole wrote: > >* Omair Majid [2010-10-26 15:46]: > >>There has been a regression in netx: applications that render html > >>(using Swing components) now fail with a null pointer exception. > >>This problem can be reproduced by running the program at [1]. > >> > > > >What caused this regression? I thought all the app context stuff was > >still disabled, with just the support added on the side? > > > > The regression itself was caused by having security dialogs in one > AppContext and the actual application in another AppContext. > > The AppContext stuff is enabled and working (in fact, some of the > AppContext code was part of the original import of Netx into IcedTea > and has been active ever since - most of my recent patches are about > enabling it in the plugin case too and using AppContext correctly to > gain its benefits). It is what allows multiple applets to have their > own look and feels and allows security dialogs to always use the > system look and feel without setting the look and feel of applets > (or jnlp applications) too. I thought I had made it pretty explicit > in my patches and changelogs :( > > What is still disabled is allowing applets/applications to access > their individual EventQueues. This is because of a security patch > that has been recently been committed to OpenJDK7. This patch > provides some additional API and says (and I am paraphrasing): "here > is some API that allows the proprietary plugin to check if AWT > events are generated by the system". I dont know how to make use of > it, so I havent added code to allow applets to access their > EventQueues. At least one application - a swing demo, no less [1] - > fails without this. > Ah sorry, my bad. I thought all of it was disabled -- I remember you mentioning this now -- that only EventQueue access is disabled. Thanks for the clarification! Cheers, Deepak > >>The problem is caused by how HTMLEditorKit/HTMLDocument and > >>ParserDelgator interact in the presence of multiple AppContexts. The > >>instance of the ParserDelegate is shared between multiple > >>HTMLEditorKit in different AppContexts. However, ParserDelegate > >>maintains a per-AppContext dtd instance. The dtd is valid in the > >>AppContext that created the ParserDelegate but null in all other > >>AppContexts. Using this null dtd throws a NullPointerException. This > >>is really a bug in OpenJDK6 rather than Netx. Fortunately, this bug > >>has been fixed in OpenJDK7 - ParserDelegate maintains an instance of > >>the dtd per runtime instead of per AppContext. > >> > >>The attached patch works around this bug. It manually creates a > >>ParserDelegate for each AppContext to avoid this problem. > >> > > > >Assuming you have tested this, OK for head. > > > > Thanks > Omair > > [1] http://download.oracle.com/javase/tutorial/ui/overview/demo.html From dbhole at redhat.com Tue Oct 26 14:37:57 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Tue, 26 Oct 2010 17:37:57 -0400 Subject: [RFC] netx: add support for parsing and saving deployment.config files In-Reply-To: <4CC58954.5040206@redhat.com> References: <4CBC6C17.6090602@redhat.com> <20101021210504.GE26975@redhat.com> <4CC0AFFB.9060601@redhat.com> <20101021213940.GG26975@redhat.com> <4CC58954.5040206@redhat.com> Message-ID: <20101026213757.GC3781@redhat.com> * Omair Majid [2010-10-25 09:42]: > On 10/21/2010 05:39 PM, Deepak Bhole wrote: > >* Omair Majid [2010-10-21 17:26]: > >>On 10/21/2010 05:05 PM, Deepak Bhole wrote: > >>>* Omair Majid [2010-10-18 11:48]: > >>>>Hi, > >>>> > >>>>As described on [1], The Java Plug-in and Java Web Start support > >>>>using various deployment.properties and deployment.config files to > >>>>set behaviour of these tools. The patch adds support for parsing and > >>>>saving these files to netx. This patch does not actually use any of > >>>>these settings; it just adds support so other parts of netx can > >>>>start using them. > >>>> > >>>>This was filed as a bug by someone against the original netx project [2]. > >>>> > >>>>Any comments or concerns? > >>>> > >>>>Thanks, > >>>>Omair > >>>> > >>>>[1] http://download.oracle.com/javase/1.5.0/docs/guide/deployment/deployment-guide/properties.html > >>>>[2] http://sourceforge.net/tracker/?func=detail&aid=2832947&group_id=72541&atid=534854 > >>> > >>> > >>> > >>>>+ > >>>>+ /** > >>>>+ * Loads properties properties file, if one exists > >>>>+ * > >>> > >>>Minor typo above. > >> > >>Fixed. > >> > >>> > >>>>+ * @param type the ConfigType to load > >>>>+ * @param file the File to load Properties from > >>> > >>> > >>> > >>>>+ /* exit if there is a fatal exception loading the configuration */ > >>>>+ if (isApplication) { > >>>>+ System.out.println(getMessage("RConfigurationError")); > >>>>+ System.exit(-1); > >>> > >>> > >>>Is there a reason you chose negative exit code? NetX uses +1 everywhere > >>>else. > >>> > >> > >>Ah, I didnt see that netx uses 1. I have fixed it now. > >> > >>Thanks for reviewing the patch. Area there other issues I should fix? > >> > > > >Nope, rest looks fine. Ok for commit to HEAD. > > > > Thanks for the review Deepak. Here is a a slightly updated version > that I plan to commit. I made a few minor tweaks to make this class > easier to use. > > 1. The class is now final and public so it can be used by other > packages not part of net.sourceforge.jnlp.runtime > 2. I renamed the methods so they make more sense. "save" and "load" > are now used for saving and loading the configuration respectively. > 3. Security checks have been added for getProperty(), > getPropertyNames() and setProperty(). > save() should have an access check as well, as someone could call it and then parse the exception error message to figure out user.home. A check for file read access to the userPropertiesFile should be adequate. load() doesn't need to have it as there is no chain that ends up outputting file names, but it would still be a good idea to add a check there in case someone adds an output somewhere without realizing it. After above changes, ok for HEAD. Cheers, Deepak > Ok to commit? > > Thanks, > Omair > diff -r eb998ed0ab1a netx/net/sourceforge/jnlp/ShortcutDesc.java > --- a/netx/net/sourceforge/jnlp/ShortcutDesc.java Fri Oct 22 10:44:12 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/ShortcutDesc.java Mon Oct 25 08:35:41 2010 -0400 > @@ -18,6 +18,18 @@ > > public final class ShortcutDesc { > > + /** Never create a shortcut */ > + public static final String SHORTCUT_NEVER = "NEVER"; > + /** Always create a shortcut */ > + public static final String SHORTCUT_ALWAYS = "ALWAYS"; > + /** Always ask user whether to create a shortcut */ > + public static final String SHORTCUT_ASK_ALWAYS = "ASK_USER"; > + /** Ask user but only if jnlp file wants a shortcut */ > + public static final String SHORTCUT_ASK_IF_HINTED = "ASK_IF_HINTED"; > + /** Create a desktop shortcut if the jnlp asks for it */ > + public static final String SHORTCUT_ALWAYS_IF_HINTED = "ALWAYS_IF_HINTED"; > + public static final String SHORTCUT_DEFAULT = SHORTCUT_ASK_IF_HINTED; > + > /** the application wants to be placed on the desktop */ > private boolean onDesktop = false; > > diff -r eb998ed0ab1a netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java Mon Oct 25 08:35:41 2010 -0400 > @@ -0,0 +1,594 @@ > +// Copyright (C) 2010 Red Hat, Inc. > +// > +// This library is free software; you can redistribute it and/or > +// modify it under the terms of the GNU Lesser General Public > +// License as published by the Free Software Foundation; either > +// version 2.1 of the License, or (at your option) any later version. > +// > +// This library is distributed in the hope that it will be useful, > +// but WITHOUT ANY WARRANTY; without even the implied warranty of > +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > +// Lesser General Public License for more details. > +// > +// You should have received a copy of the GNU Lesser General Public > +// License along with this library; if not, write to the Free Software > +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. > + > + > +package net.sourceforge.jnlp.runtime; > + > +import java.io.BufferedOutputStream; > +import java.io.BufferedReader; > +import java.io.File; > +import java.io.FileOutputStream; > +import java.io.FileReader; > +import java.io.IOException; > +import java.io.OutputStream; > +import java.io.PrintStream; > +import java.io.Reader; > +import java.net.MalformedURLException; > +import java.net.URL; > +import java.util.HashMap; > +import java.util.Map; > +import java.util.Properties; > +import java.util.Set; > + > +import javax.naming.ConfigurationException; > + > +import net.sourceforge.jnlp.ShortcutDesc; > + > +/** > + * Manages the various properties and configuration related to deployment. > + * > + * See: > + * http://download.oracle.com/javase/1.5.0/docs/guide/deployment/deployment-guide/properties.html > + */ > +public final class DeploymentConfiguration { > + > + /** > + * Represents a value for a configuration. Provides methods to get the value > + * as well as marking the value as locked. > + */ > + private final class ConfigValue { > + > + private String value; > + private boolean locked; > + > + ConfigValue(String value) { > + this(value, false); > + } > + > + ConfigValue(String value, boolean locked) { > + this.value = value; > + this.locked = locked; > + } > + > + ConfigValue(ConfigValue other) { > + this(other.value, other.locked); > + } > + > + String get() { > + return value; > + } > + > + /** > + * Note that setting the value is not enforced - it is the caller's > + * responsibility to check if a value is locked or not before setting a > + * new value > + * > + * @param value the new value > + */ > + void set(String value) { > + this.value = value; > + } > + > + /** > + * @return true if the value has been marked as locked > + */ > + boolean isLocked() { > + return locked; > + } > + > + /** > + * Mark a value as locked > + * @param locked > + */ > + void setLocked(boolean locked) { > + this.locked = locked; > + } > + } > + > + public static final String DEPLOYMENT_DIR = ".netx"; > + public static final String DEPLOYMENT_CONFIG = "deployment.config"; > + public static final String DEPLOYMENT_PROPERTIES = "deployment.properties"; > + > + public static final String DEPLOYMENT_COMMENT = "Netx deployment configuration"; > + > + public static final int JNLP_ASSOCIATION_NEVER = 0; > + public static final int JNLP_ASSOCIATION_NEW_ONLY = 1; > + public static final int JNLP_ASSOCIATION_ASK_USER = 2; > + public static final int JNLP_ASSOCIATION_REPLACE_ASK = 3; > + > + /* > + * FIXME these should be moved into JavaConsole, but there is a strange > + * dependency in the build system. First all of netx is built. Then the > + * plugin is built. So we cannot refer to plugin code in here :( > + */ > + public static final String CONSOLE_HIDE = "HIDE"; > + public static final String CONSOLE_SHOW = "SHOW"; > + public static final String CONSOLE_DISABLE = "DISABLE"; > + public static final String CONSOLE_DEFAULT = CONSOLE_DISABLE; > + > + /* FIXME these should be moved into the proxy class */ > + public static final int PROXY_TYPE_UNKNOWN = -1; > + public static final int PROXY_TYPE_NONE = 0; > + public static final int PROXY_TYPE_MANUAL = 1; > + public static final int PROXY_TYPE_AUTO = 2; > + public static final int PROXY_TYPE_BROWSER = 3; > + > + public enum ConfigType { > + System, User > + } > + > + /** is it mandatory to load the system properties? */ > + private boolean systemPropertiesMandatory = false; > + > + /** The system's deployment.config file */ > + private File systemPropertiesFile = null; > + /** The user's deployment.config file */ > + private File userPropertiesFile = null; > + > + /** the current deployment properties */ > + private Map currentConfiguration; > + > + /** the deployment properties that cannot be changed */ > + private Map unchangeableConfiguration; > + > + public DeploymentConfiguration() { > + unchangeableConfiguration = new HashMap(); > + currentConfiguration = new HashMap(); > + } > + > + /** > + * Initialize this deployment configuration by reading configuration files. > + * Generally, it will try to continue and ignore errors it finds (such as file not found). > + * > + * @throws DeploymentException if it encounters a fatal error. > + */ > + public void load() throws ConfigurationException { > + Map initialProperties = loadDefaultProperties(); > + > + Map systemProperties = null; > + > + /* > + * First, try to read the system's deployment.config file to find if > + * there is a system-level deployment.poperties file > + */ > + > + File systemConfigFile = findSystemConfigFile(); > + if (systemConfigFile != null) { > + if (loadSystemConfiguration(systemConfigFile)) { > + if (JNLPRuntime.isDebug()) { > + System.out.println("System level " + DEPLOYMENT_CONFIG + " is mandatory: " + systemPropertiesMandatory); > + } > + /* Second, read the System level deployment.properties file */ > + systemProperties = loadProperties(ConfigType.System, systemPropertiesFile, > + systemPropertiesMandatory); > + } > + if (systemProperties != null) { > + mergeMaps(initialProperties, systemProperties); > + } > + } > + > + /* need a copy of the original when we have to save */ > + unchangeableConfiguration = new HashMap(); > + Set keys = initialProperties.keySet(); > + for (String key : keys) { > + unchangeableConfiguration.put(key, new ConfigValue(initialProperties.get(key))); > + } > + > + /* > + * Third, read the user's deployment.properties file > + */ > + userPropertiesFile = new File(System.getProperty("user.home") + File.separator + ".netx" > + + File.separator + DEPLOYMENT_PROPERTIES); > + Map userProperties = loadProperties(ConfigType.User, userPropertiesFile, > + false); > + if (userProperties != null) { > + mergeMaps(initialProperties, userProperties); > + } > + > + currentConfiguration = initialProperties; > + } > + > + /** > + * Get the value for the given key > + * > + * @param key the property key > + * @return the value for the key, or null if it can not be found > + */ > + public String getProperty(String key) { > + SecurityManager sm = System.getSecurityManager(); > + if (sm != null) { > + if (userPropertiesFile != null) { > + sm.checkRead(userPropertiesFile.toString()); > + } > + } > + return currentConfiguration.get(key).get(); > + } > + > + /** > + * @return a Set containing all the property names > + */ > + Set getAllPropertyNames() { > + SecurityManager sm = System.getSecurityManager(); > + if (sm != null) { > + if (userPropertiesFile != null) { > + sm.checkRead(userPropertiesFile.toString()); > + } > + } > + return currentConfiguration.keySet(); > + } > + > + /** > + * Sets the value of corresponding to the key. If the value has been marked > + * as locked, it is not changed > + * > + * @param key the key > + * @param value the value to be associated with the key > + */ > + public void setProperty(String key, String value) { > + SecurityManager sm = System.getSecurityManager(); > + if (sm != null) { > + if (userPropertiesFile != null) { > + sm.checkRead(userPropertiesFile.toString()); > + } > + } > + > + ConfigValue currentValue = currentConfiguration.get(key); > + if (currentValue != null) { > + if (!currentValue.isLocked()) { > + currentValue.set(value); > + } > + } else { > + currentValue = new ConfigValue(value); > + currentConfiguration.put(key, currentValue); > + } > + } > + > + /** > + * Loads the default properties for deployment > + */ > + private Map loadDefaultProperties() { > + > + final String SYSTEM_HOME = System.getProperty("java.home"); > + final String SYSTEM_SECURITY = SYSTEM_HOME + File.separator + "lib" + File.separator > + + "security"; > + > + final String USER_HOME = System.getProperty("user.home") + File.separator + DEPLOYMENT_DIR; > + final String USER_SECURITY = USER_HOME + File.separator + "security"; > + > + /* > + * This is more or less a straight copy from the deployment > + * configuration page, with occasional replacements of "" or no-defaults > + * with null > + */ > + > + String[][] defaults = new String[][] { > + /* infrastructure */ > + { "deployment.user.cachedir", USER_HOME + File.separator + "cache" }, > + { "deployment.system.cachedir", null }, > + { "deployment.user.logdir", USER_HOME + File.separator + "log" }, > + { "deployment.user.tmp", USER_HOME + File.separator + "tmp" }, > + /* certificates and policy files */ > + { "deployment.user.security.policy", "file://" + USER_SECURITY + File.separator + "java.policy" }, > + { "deployment.user.security.trusted.cacerts", USER_SECURITY + File.separator + "trusted.cacerts" }, > + { "deployment.user.security.trusted.jssecacerts", USER_SECURITY + File.separator + "trusted.jssecacerts" }, > + { "deployment.user.security.trusted.certs", USER_SECURITY + File.separator + "trusted.certs" }, > + { "deployment.user.security.trusted.jssecerts", USER_SECURITY + File.separator + "trusted.jssecerts"}, > + { "deployment.user.security.trusted.clientauthcerts", USER_SECURITY + File.separator + "trusted.clientcerts" }, > + { "deployment.system.security.policy", null }, > + { "deployment.system.security.cacerts", SYSTEM_SECURITY + File.separator + "cacerts" }, > + { "deployment.system.security.jssecacerts", SYSTEM_SECURITY + File.separator + "jssecacerts" }, > + { "deployment.system.security.trusted.certs", SYSTEM_SECURITY + File.separator + "trusted.certs" }, > + { "deployment.system.security.trusted.jssecerts", SYSTEM_SECURITY + File.separator + "trusted.jssecerts" }, > + { "deployment.system.security.trusted.clientautcerts", SYSTEM_SECURITY + File.separator + "trusted.clientcerts" }, > + /* security access and control */ > + { "deployment.security.askgrantdialog.show", String.valueOf(true) }, > + { "deployment.security.askgrantdialog.notinca", String.valueOf(true) }, > + { "deployment.security.notinca.warning", String.valueOf(true) }, > + { "deployment.security.expired.warning", String.valueOf(true) }, > + { "deployment.security.jsse.hostmismatch.warning", String.valueOf(true) }, > + { "deployment.security.trusted.policy", null }, > + { "deployment.security.sandbox.awtwarningwindow", String.valueOf(true) }, > + { "deployment.security.sandbox.jnlp.enhanced", String.valueOf(true) }, > + { "deployment.security.authenticator", String.valueOf(true) }, > + /* networking */ > + { "deployment.proxy.type", String.valueOf(PROXY_TYPE_BROWSER) }, > + { "deployment.proxy.same", String.valueOf(false) }, > + { "deployment.proxy.auto.config.url", null }, > + { "deployment.proxy.bypass.list", null }, > + { "deployment.proxy.bypass.local", null }, > + { "deployment.proxy.http.host", null }, > + { "deployment.proxy.http.port", null }, > + { "deployment.proxy.https.host", null }, > + { "deployment.proxy.https.port", null }, > + { "deployment.proxy.ftp.host", null }, > + { "deployment.proxy.ftp.port", null }, > + { "deployment.proxy.socks.host", null }, > + { "deployment.proxy.socks.port", null }, > + { "deployment.proxy.override.hosts", null }, > + /* cache and optional package repository */ > + { "deployment.cache.max.size", String.valueOf("-1") }, > + { "deployment.cache.jarcompresson", String.valueOf(0) }, > + { "deployment.javapi.cache.enabled", String.valueOf(false) }, > + /* java console */ > + { "deployment.console.startup.mode", CONSOLE_HIDE }, > + /* tracing and logging */ > + { "deployment.trace", String.valueOf(false) }, > + { "deployment.log", String.valueOf(false) }, > + /* JNLP association */ > + { "deployment.javaws.associations", String.valueOf(JNLP_ASSOCIATION_ASK_USER) }, > + /* desktop integration */ > + { "deployment.javaws.shortcut", ShortcutDesc.SHORTCUT_ASK_IF_HINTED }, > + /* jre selection */ > + { "deployment.javaws.installURL", "" }, > + /* jre management */ > + { "deployment.javaws.autodownload", "" }, > + /* browser selection */ > + { "deployment.browser.path", "" }, > + /* check for update timeout */ > + { "deployment.javaws.update.timeout", String.valueOf(500) } > + }; > + > + HashMap result = new HashMap(); > + for (int i = 0; i < defaults.length; i++) { > + String key = defaults[i][0]; > + String actualValue = defaults[i][1]; > + boolean locked = false; > + ConfigValue value = new ConfigValue(actualValue, locked); > + result.put(key, value); > + } > + > + return result; > + } > + > + /** > + * @return the location of system-level deployment.config file, or null if none can be found > + */ > + private File findSystemConfigFile() { > + File etcFile = new File(File.separator + "etc" + File.separator + ".java" + File.separator > + + "deployment" + File.separator + DEPLOYMENT_CONFIG); > + if (etcFile.isFile()) { > + return etcFile; > + } > + > + File jreFile = new File(System.getProperty("java.home") + File.separator + "lib" > + + File.separator + DEPLOYMENT_CONFIG); > + if (jreFile.isFile()) { > + return jreFile; > + } > + > + return null; > + } > + > + /** > + * Reads the system configuration file and sets the relevant > + * system-properties related variables > + */ > + private boolean loadSystemConfiguration(File configFile) { > + > + if (JNLPRuntime.isDebug()) { > + System.out.println("Loading system configuation from: " + configFile); > + } > + > + Map systemConfiguration = new HashMap(); > + try { > + systemConfiguration = parsePropertiesFile(configFile); > + } catch (IOException e) { > + if (JNLPRuntime.isDebug()) { > + System.out.println("No System level " + DEPLOYMENT_PROPERTIES + " found."); > + } > + return false; > + } > + > + /* > + * at this point, we have read the system deployment.config file > + * completely > + */ > + > + try { > + String urlString = systemConfiguration.get("deployment.system.config").get(); > + if (urlString == null) { > + if (JNLPRuntime.isDebug()) { > + System.out.println("No System level " + DEPLOYMENT_PROPERTIES + " found."); > + } > + return false; > + } > + URL url = new URL(urlString); > + if (url.getProtocol().equals("file")) { > + systemPropertiesFile = new File(url.getFile()); > + if (JNLPRuntime.isDebug()) { > + System.out.println("Using System level" + DEPLOYMENT_PROPERTIES + ": " > + + systemPropertiesFile); > + } > + ConfigValue mandatory = systemConfiguration.get("deployment.system.config.mandatory"); > + systemPropertiesMandatory = Boolean.valueOf(mandatory == null? null: mandatory.get()); > + return true; > + } else { > + if (JNLPRuntime.isDebug()) { > + System.out.println("Remote + " + DEPLOYMENT_PROPERTIES + " not supported"); > + } > + return false; > + } > + } catch (MalformedURLException e) { > + if (JNLPRuntime.isDebug()) { > + System.out.println("Invalid url for " + DEPLOYMENT_PROPERTIES); > + } > + return false; > + } > + } > + > + /** > + * Loads the properties file, if one exists > + * > + * @param type the ConfigType to load > + * @param file the File to load Properties from > + * @param mandatory indicates if reading this file is mandatory > + * > + * @throws ConfigurationException if the file is mandatory but cannot be read > + */ > + private Map loadProperties(ConfigType type, File file, boolean mandatory) > + throws ConfigurationException { > + if (file == null || !file.isFile()) { > + if (JNLPRuntime.isDebug()) { > + System.out.println("No " + type.toString() + " level " + DEPLOYMENT_PROPERTIES + " found."); > + } > + if (!mandatory) { > + return null; > + } else { > + throw new ConfigurationException(); > + } > + } > + > + if (JNLPRuntime.isDebug()) { > + System.out.println("Loading " + type.toString() + " level properties from: " + file); > + } > + try { > + return parsePropertiesFile(file); > + } catch (IOException e) { > + return null; > + } > + } > + > + > + /** > + * Saves all properties that are not part of default or system properties > + * > + * @throws IOException > + */ > + public void save() throws IOException { > + if (JNLPRuntime.isDebug()) { > + System.out.println("Saving properties into " + userPropertiesFile.toString()); > + } > + Properties toSave = new Properties(); > + > + for (String key : currentConfiguration.keySet()) { > + String oldValue = unchangeableConfiguration.get(key) == null ? null > + : unchangeableConfiguration.get(key).get(); > + String newValue = currentConfiguration.get(key) == null ? null : currentConfiguration > + .get(key).get(); > + if (oldValue == null && newValue == null) { > + continue; > + } else if (oldValue == null && newValue != null) { > + toSave.setProperty(key, newValue); > + } else if (oldValue != null && newValue == null) { > + toSave.setProperty(key, newValue); > + } else { // oldValue != null && newValue != null > + if (!oldValue.equals(newValue)) { > + toSave.setProperty(key, newValue); > + } > + } > + } > + > + File backupPropertiesFile = new File(userPropertiesFile.toString() + ".old"); > + if (userPropertiesFile.isFile()) { > + if (!userPropertiesFile.renameTo(backupPropertiesFile)) { > + throw new IOException("Error saving backup copy of " + userPropertiesFile); > + } > + } > + > + userPropertiesFile.getParentFile().mkdirs(); > + OutputStream out = new BufferedOutputStream(new FileOutputStream(userPropertiesFile)); > + try { > + toSave.store(out, DEPLOYMENT_COMMENT); > + } finally { > + out.close(); > + } > + } > + > + /** > + * Reads a properties file and returns a map representing the properties > + * > + * @param propertiesFile the file to read Properties from > + * @param destination the map to which all the properties should be added > + * @throws IOException if an IO problem occurs > + */ > + private Map parsePropertiesFile(File propertiesFile) throws IOException { > + Map result = new HashMap(); > + > + Properties properties = new Properties(); > + > + Reader reader = new BufferedReader(new FileReader(propertiesFile)); > + try { > + properties.load(reader); > + } finally { > + reader.close(); > + } > + > + Set keys = properties.stringPropertyNames(); > + for (String key : keys) { > + if (key.endsWith(".locked")) { > + String realKey = key.substring(0, key.length() - ".locked".length()); > + ConfigValue configValue = result.get(realKey); > + if (configValue == null) { > + configValue = new ConfigValue(null, true); > + result.put(realKey, configValue); > + } else { > + configValue.setLocked(true); > + } > + } else { > + /* when parsing a properties we set value without checking if it is locked or not */ > + String newValue = properties.getProperty(key); > + ConfigValue configValue = result.get(key); > + if (configValue == null) { > + configValue = new ConfigValue(newValue); > + result.put(key, configValue); > + } else { > + configValue.set(newValue); > + } > + } > + } > + return result; > + } > + > + /** > + * Merges two maps while respecting whether the values have been locked or > + * not. All values from srcMap are put into finalMap, replacing values in > + * finalMap if necessary, unless the value is present and marked as locked > + * in finalMap > + * > + * @param finalMap the destination for putting values > + * @param srcMap the source for reading key value pairs > + */ > + private void mergeMaps(Map finalMap, Map srcMap) { > + for (String key: srcMap.keySet()) { > + ConfigValue configValue = finalMap.get(key); > + if (configValue == null) { > + configValue = srcMap.get(key); > + finalMap.put(key, configValue); > + } else { > + if (!configValue.isLocked()) { > + configValue.set(srcMap.get(key).get()); > + } > + } > + } > + } > + > + /** > + * Dumps the configuration to the PrintStream > + * > + * @param config a map of key,value pairs representing the configuration to > + * dump > + * @param out the PrintStream to write data to > + */ > + private static void dumpConfiguration(Map config, PrintStream out) { > + System.out.println("KEY: VALUE [Locked]"); > + > + for (String key : config.keySet()) { > + ConfigValue value = config.get(key); > + out.println("'" + key + "': '" + value.get() + "'" > + + (value.isLocked() ? " [LOCKED]" : "")); > + } > + } > +} From dbhole at redhat.com Tue Oct 26 14:39:13 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Tue, 26 Oct 2010 17:39:13 -0400 Subject: [icedtea-web] RFC: add more JNLP spec numbers In-Reply-To: <4CC73B9A.5000302@redhat.com> References: <4CC73B9A.5000302@redhat.com> Message-ID: <20101026213912.GD3781@redhat.com> * Omair Majid [2010-10-26 17:32]: > Hi, > > The attached patch adds more "supported" specification numbers to > netx. Secureftp2 [1] contains a JNLP file with a specification > version 1.4 (I think they might have confused the Java version with > the JNLP version...). In anticipation of the worst, I have also > added 1.3 as a supported version. > > Personally I am starting to doubt the point of checking and failing > if the jnlp file specifies an unsupported version - I think netx > should try and run whatever it can instead of failing based on a > (often wrong) version. > I assume there was a 1.2 as well? Might as well add that too! :) Ok for HEAD after the above. Cheers, Deepak > ChangeLog > 2010-20-26 Omair Majid > > * netx/net/sourceforge/jnlp/Parser.java: Add 1.3 and 1.4 to > supportedVersions. > > > Thanks, > Omair > > [1] http://www.glub.com/products/secureftp/jws/secureftp2.jnlp > diff -r b1b876d99849 netx/net/sourceforge/jnlp/Parser.java > --- a/netx/net/sourceforge/jnlp/Parser.java Mon Oct 25 17:16:13 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/Parser.java Tue Oct 26 16:30:53 2010 -0400 > @@ -68,7 +68,7 @@ > > > /** the supported JNLP file versions */ > - private static Version supportedVersions = new Version("1.0 1.5 1.6 6.0"); > + private static Version supportedVersions = new Version("1.0 1.3 1.4 1.5 1.6 6.0"); > > // fix: some descriptors need to use the jnlp file at a later > // date and having file ref lets us pass it to their From dbhole at redhat.com Tue Oct 26 14:45:24 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Tue, 26 Oct 2010 17:45:24 -0400 Subject: [icedtea-web] RFC: launch application that have a non-public main class In-Reply-To: <4CC7343E.9060705@redhat.com> References: <4CC7343E.9060705@redhat.com> Message-ID: <20101026214524.GE3781@redhat.com> * Omair Majid [2010-10-26 17:22]: > Hi, > > The attached patch bypasses checks imposed by the reflection API to > ensure that netx is allowed to access the class it is trying to > access. Generally, this makes complete sense. However, there are > some applications (such as the Present/Future Value Calculator [1]) > that declare their main method in a non public class. Netx currently > fails with an IllegalAccessException when it encounters this. > Ugh. This shouldn't even be allowed :/ Anyway, we should follow the ri. Ok for HEAD. Deepak > ChangeLog > 2010-10-26 Omair Majid > > * netx/net/sourceforge/jnlp/Launcher.java > (launchApplication): Mark main method as accessible before invoking > it. > > Thanks, > Omair > > [1] http://www.arbores.ca/PresentFuture.jnlp > diff -r b1b876d99849 netx/net/sourceforge/jnlp/Launcher.java > --- a/netx/net/sourceforge/jnlp/Launcher.java Mon Oct 25 17:16:13 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/Launcher.java Tue Oct 26 15:46:09 2010 -0400 > @@ -474,6 +475,7 @@ > splashScreen.dispose(); > } > > + main.setAccessible(true); > main.invoke(null, new Object[] { args } ); > > return app; From dbhole at icedtea.classpath.org Tue Oct 26 14:50:41 2010 From: dbhole at icedtea.classpath.org (dbhole at icedtea.classpath.org) Date: Tue, 26 Oct 2010 21:50:41 +0000 Subject: /hg/icedtea-web: Stabilize plugin initialization Message-ID: changeset d4a914a000e3 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=d4a914a000e3 author: Deepak Bhole date: Tue Oct 26 17:49:57 2010 -0700 Stabilize plugin initialization - Fixed frame pop-up issue when tab is closed early - Fixed 100% CPU load when too many applets load in parallel - Fixed message queue processing to prioritize destroy first diffstat: 3 files changed, 264 insertions(+), 98 deletions(-) ChangeLog | 25 plugin/icedteanp/java/sun/applet/PluginAppletViewer.java | 300 +++++++---- plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java | 37 + diffs (truncated from 635 to 500 lines): diff -r dfd749c077c3 -r d4a914a000e3 ChangeLog --- a/ChangeLog Tue Oct 26 12:01:22 2010 -0400 +++ b/ChangeLog Tue Oct 26 17:49:57 2010 -0700 @@ -1,3 +1,28 @@ 2010-10-26 Andrew Su +2010-10-26 Deepak Bhole + + * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: + Replace all status.put calls with calls to updateStatus(). + (createPanel): Create a frame with a 0 handle. Use the new + waitForAppletInit function to wait until applet is ready. + (reFrame): Re-order code so that the panel is never parentless. + (handleMessage): Re-wrote message processing to handle destroy calls + correctly, checking for them more often to prevent a frame from popping up + if the tab/page is closed before loading finishes. Decode special + characters in the message. + (updateStatus): New function. Updates the status for the given instance if + applicable. + (destroyApplet): New function. Destroys a given applet and frees related + resources. + (waitForAppletInit): New function. Blocks until applet is initialized. + (parse): Remove part that decoded the params. Decoding is now done earlier + in handleMessage(). + * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java: + (getPriorityStrIfPriority): Mark destroy messages as priority. + (bringPriorityMessagesToFront): Scans the queue for priority messages and + brings them to the front. + (run): If the queue is not empty and there are no workers left, run + bringPriorityMessagesToFront() and retry. + 2010-10-26 Andrew Su * Makefile.am: Split rm -rf into rm -f and rmdir for launcher diff -r dfd749c077c3 -r d4a914a000e3 plugin/icedteanp/java/sun/applet/PluginAppletViewer.java --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Tue Oct 26 12:01:22 2010 -0400 +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Tue Oct 26 17:49:57 2010 -0700 @@ -136,12 +136,10 @@ import com.sun.jndi.toolkit.url.UrlUtil; } } }); + + // create the frame. + PluginAppletViewer.reFrame(null, identifier, System.out, 0, panel); - - - // create the frame. - PluginAppletViewer.reFrame(null, identifier, System.out, handle, panel); - panel.init(); // Start the applet @@ -179,15 +177,7 @@ import com.sun.jndi.toolkit.url.UrlUtil; // Wait for the panel to initialize // (happens in a separate thread) - while (panel.getApplet() == null && - ((NetxPanel) panel).isAlive()) { - try { - Thread.sleep(50); - PluginDebug.debug("Waiting for applet to initialize..."); - } catch (InterruptedException ie) { - // just wait - } - } + PluginAppletViewer.waitForAppletInit((NetxPanel) panel); a = panel.getApplet(); @@ -317,7 +307,17 @@ import com.sun.jndi.toolkit.url.UrlUtil; */ private static String defaultSaveFile = "Applet.ser"; - private static enum PAV_INIT_STATUS {PRE_INIT, IN_INIT, INIT_COMPLETE, INACTIVE}; + + /** + * Enumerates the current status of an applet + * + * PRE_INIT -> Parsing and initialization phase + * INIT_COMPLETE -> Initialization complete, reframe pending + * REFRAME_COMPLETE -> Reframe complete, applet is initialized and usable by the user + * INACTIVE -> Browser has directed that the applet be destroyed (this state is non-overridable except by DESTROYED) + * DESTROYED -> Applet has been destroyed + */ + private static enum PAV_INIT_STATUS {PRE_INIT, INIT_COMPLETE, REFRAME_COMPLETE, INACTIVE, DESTROYED}; /** * The panel in which the applet is being displayed. @@ -350,7 +350,6 @@ import com.sun.jndi.toolkit.url.UrlUtil; private static HashMap status = new HashMap(); - private long handle = 0; private WindowListener windowEventListener = null; @@ -380,16 +379,20 @@ import com.sun.jndi.toolkit.url.UrlUtil; return; PluginAppletViewer newFrame = new PluginAppletViewer(handle, identifier, statusMsgStream, panel); - + if (oldFrame != null) { applets.remove(oldFrame.identifier); oldFrame.removeWindowListener(oldFrame.windowEventListener); panel.removeAppletListener(oldFrame.appletEventListener); + + // Add first, remove later + newFrame.add("Center", panel); oldFrame.remove(panel); oldFrame.dispose(); + } else { + newFrame.add("Center", panel); } - newFrame.add("Center", panel); newFrame.pack(); newFrame.appletEventListener = new AppletEventListener(newFrame, newFrame); @@ -397,11 +400,6 @@ import com.sun.jndi.toolkit.url.UrlUtil; applets.put(identifier, newFrame); - // dispose oldframe if necessary - if (oldFrame != null) { - oldFrame.dispose(); - } - PluginDebug.debug(panel + " reframed"); } @@ -449,7 +447,7 @@ import com.sun.jndi.toolkit.url.UrlUtil; this.frame = frame; this.appletViewer = appletViewer; } - + public void appletStateChanged(AppletEvent evt) { AppletPanel src = (AppletPanel)evt.getSource(); @@ -483,9 +481,9 @@ import com.sun.jndi.toolkit.url.UrlUtil; AppletPanel.changeFrameAppContext(frame, SunToolkit.targetToAppContext(a)); else AppletPanel.changeFrameAppContext(frame, AppContext.getAppContext()); - - status.put(appletViewer.identifier, PAV_INIT_STATUS.INIT_COMPLETE); - + + updateStatus(appletViewer.identifier, PAV_INIT_STATUS.INIT_COMPLETE); + break; } } @@ -510,7 +508,13 @@ import com.sun.jndi.toolkit.url.UrlUtil; try { if (message.startsWith("handle")) { - + + // If there is a key for this status, it means it + // was either initialized before, or destroy has been + // processed. Stop moving further. + if (updateStatus(identifier, PAV_INIT_STATUS.PRE_INIT) != null) + return; + // Extract the information from the message String[] msgParts = new String[4]; for (int i=0; i < 3; i++) { @@ -519,32 +523,38 @@ import com.sun.jndi.toolkit.url.UrlUtil; msgParts[i] = message.substring(spaceLocation + 1, nextSpaceLocation); message = message.substring(nextSpaceLocation + 1); } - + long handle = Long.parseLong(msgParts[0]); String width = msgParts[1]; String height = msgParts[2]; - + int spaceLocation = message.indexOf(' ', "tag".length()+1); String documentBase = UrlUtil.decode(message.substring("tag".length() + 1, spaceLocation)); - String tag = message.substring(spaceLocation+1); + String tag = message.substring(spaceLocation+1); + + // Decode the tag + tag = tag.replace(">", ">"); + tag = tag.replace("<", "<"); + tag = tag.replace("&", "&"); + tag = tag.replace(" ", "\n"); + tag = tag.replace(" ", "\r"); + tag = tag.replace(""", "\""); PluginDebug.debug ("Handle = " + handle + "\n" + "Width = " + width + "\n" + "Height = " + height + "\n" + "DocumentBase = " + documentBase + "\n" + "Tag = " + tag); - - status.put(identifier, PAV_INIT_STATUS.PRE_INIT); + PluginAppletViewer.parse (identifier, handle, width, height, new StringReader(tag), new URL(documentBase)); - int maxWait = APPLET_TIMEOUT; // wait for applet to fully load int wait = 0; - while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && + while ( !applets.containsKey(identifier) && // Map is populated only by reFrame (wait < maxWait)) { try { @@ -555,9 +565,44 @@ import com.sun.jndi.toolkit.url.UrlUtil; } } - if (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE)) + // If wait exceeded maxWait, we timed out. Throw an exception + if (wait >= maxWait) throw new Exception("Applet initialization timeout"); + PluginAppletViewer oldFrame = applets.get(identifier); + + // We should not try to destroy an applet during + // initialization. It may cause an inconsistent state, + // which would bad if it's a trusted applet that + // read/writes to files + waitForAppletInit((NetxPanel) applets.get(identifier).panel); + + // Should we proceed with reframing? + if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { + destroyApplet(identifier); + return; + } + + // Proceed with re-framing + reFrame(oldFrame, identifier, System.out, handle, oldFrame.panel); + + // There is a slight chance that destroy can happen + // between the above and below line + if (updateStatus(identifier, PAV_INIT_STATUS.REFRAME_COMPLETE).equals(PAV_INIT_STATUS.INACTIVE)) { + destroyApplet(identifier); + } + + } else if (message.startsWith("destroy")) { + + // Set it inactive, and try to do cleanup is applicable + PAV_INIT_STATUS previousStatus = updateStatus(identifier, PAV_INIT_STATUS.INACTIVE); + PluginDebug.debug("Destroy status set for " + identifier); + + if (previousStatus != null && + previousStatus.equals(PAV_INIT_STATUS.REFRAME_COMPLETE)) { + destroyApplet(identifier); + } + } else { PluginDebug.debug ("Handling message: " + message + " instance " + identifier + " " + Thread.currentThread()); @@ -568,7 +613,7 @@ import com.sun.jndi.toolkit.url.UrlUtil; status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT) ) ); - + // don't bother processing further for inactive applets if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) return; @@ -580,31 +625,131 @@ import com.sun.jndi.toolkit.url.UrlUtil; e.printStackTrace(); // If an exception happened during pre-init, we need to update status - if (status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT)) - status.put(identifier, PAV_INIT_STATUS.INACTIVE); + updateStatus(identifier, PAV_INIT_STATUS.INACTIVE); throw new RuntimeException("Failed to handle message: " + message + " for instance " + identifier, e); } } - + + /** + * Sets the status unless an overriding status is set (e.g. if + * status is DESTROYED, it may not be overridden). + * + * @param identifier The identifier for which the status is to be set + * @param status The status to switch to + * @return The previous status + */ + private static synchronized PAV_INIT_STATUS updateStatus(int identifier, PAV_INIT_STATUS newStatus) { + + PAV_INIT_STATUS prev = status.get(identifier); + + // If the status is set + if (status.containsKey(identifier)) { + + // Nothing may override destroyed status + if (status.get(identifier).equals(PAV_INIT_STATUS.DESTROYED)) { + return prev; + } + + // If status is inactive, only DESTROYED may override it + if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { + if (!newStatus.equals(PAV_INIT_STATUS.DESTROYED)) { + return prev; + } + } + } + + // Else set to given status + status.put(identifier, newStatus); + + return prev; + } + + /** + * Destroys the given applet instance. + * + * This function may be called multiple times without problems. + * It does a synchronized check on the status and will only + * attempt to destroy the applet if not previously destroyed. + * + * @param identifier The instance which is to be destroyed + */ + + private static synchronized void destroyApplet(int identifier) { + + PluginDebug.debug("DestroyApplet called for " + identifier); + + PAV_INIT_STATUS prev = updateStatus(identifier, PAV_INIT_STATUS.DESTROYED); + + // If already destroyed, return + if (prev.equals(PAV_INIT_STATUS.DESTROYED)) { + PluginDebug.debug(identifier + " already destroyed. Returning."); + return; + } + + // If already disposed, return + if (applets.get(identifier).panel.applet == null) { + // Try to still dispose the panel itself -- no harm done with double dispose + applets.get(identifier).dispose(); + + PluginDebug.debug(identifier + " inactive. Returning."); + return; + } + + PluginDebug.debug("Attempting to destroy " + identifier); + + final int fIdentifier = identifier; + SwingUtilities.invokeLater(new Runnable() { + public void run() { + applets.get(fIdentifier).appletClose(); + } + }); + + PluginDebug.debug(identifier + " destroyed"); + } + + /** + * Function to block until applet initialization is complete + * + * @param identifier The instance to wait for + */ + public static void waitForAppletInit(NetxPanel panel) { + + int waitTime = 0; + + // Wait till initialization finishes + while (panel.getApplet() == null && + panel.isAlive() && + waitTime < APPLET_TIMEOUT) { + try { + if (waitTime%500 == 0) + PluginDebug.debug("Waiting for applet panel " + panel + " to initialize..."); + + Thread.sleep(waitTime += 50); + } catch (InterruptedException ie) { + // just wait + } + } + + PluginDebug.debug("Applet panel " + panel + " initialized"); + } + public void handleMessage(int reference, String message) { if (message.startsWith("width")) { // Wait for panel to come alive int maxWait = APPLET_TIMEOUT; // wait for panel to come alive - int wait = 0; + int wait = 0; while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && wait < maxWait) { - - try { - Thread.sleep(50); - wait += 50; - } catch (InterruptedException ie) { - // just wait - } - } - + try { + Thread.sleep(50); + wait += 50; + } catch (InterruptedException ie) { + // just wait + } + } // 0 => width, 1=> width_value, 2 => height, 3=> height_value String[] dimMsg = message.split(" "); @@ -636,7 +781,7 @@ import com.sun.jndi.toolkit.url.UrlUtil; panel.setSize(width, height); panel.validate(); - + panel.applet.resize(width, height); panel.applet.validate(); } @@ -649,9 +794,6 @@ import com.sun.jndi.toolkit.url.UrlUtil; e.printStackTrace(); } - } else if (message.startsWith("destroy")) { - dispose(); - status.put(identifier, PAV_INIT_STATUS.INACTIVE); } else if (message.startsWith("GetJavaObject")) { // FIXME: how do we determine what security context this @@ -672,15 +814,7 @@ import com.sun.jndi.toolkit.url.UrlUtil; // Wait for the panel to initialize // (happens in a separate thread) - while (panel.getApplet() == null && - ((NetxPanel) panel).isAlive()) { - try { - Thread.sleep(50); - PluginDebug.debug("Waiting for applet to initialize..."); - } catch (InterruptedException ie) { - // just wait - } - } + waitForAppletInit((NetxPanel) panel); PluginDebug.debug(panel + " -- " + panel.getApplet() + " -- " + ((NetxPanel) panel).isAlive()); @@ -1548,10 +1682,11 @@ import com.sun.jndi.toolkit.url.UrlUtil; if (countApplets() == 0) { appletSystemExit(); } + + updateStatus(identifier, PAV_INIT_STATUS.DESTROYED); } }).start(); - status.put(identifier, PAV_INIT_STATUS.INACTIVE); } /** @@ -1677,18 +1812,6 @@ import com.sun.jndi.toolkit.url.UrlUtil; val = buf.toString(); } - att = att.replace(">", ">"); - att = att.replace("<", "<"); - att = att.replace("&", "&"); - att = att.replace(" ", "\n"); - att = att.replace(" ", "\r"); - - val = val.replace(">", ">"); - val = val.replace("<", "<"); - val = val.replace("&", "&"); - val = val.replace(" ", "\n"); - val = val.replace(" ", "\r"); - PluginDebug.debug("PUT " + att + " = '" + val + "'"); atts.put(att.toLowerCase(java.util.Locale.ENGLISH), val); @@ -1708,7 +1831,6 @@ import com.sun.jndi.toolkit.url.UrlUtil; // private static final == inline private static final boolean isInt(Object o) { boolean isInt = false; - try { Integer.parseInt((String) o); isInt = true; @@ -1763,7 +1885,6 @@ import com.sun.jndi.toolkit.url.UrlUtil; } catch (IOException ioe) { return ioe; } - return null; } }; @@ -1785,6 +1906,7 @@ import com.sun.jndi.toolkit.url.UrlUtil; boolean isObjectTag = false; boolean isEmbedTag = false; From dbhole at redhat.com Tue Oct 26 14:51:13 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Tue, 26 Oct 2010 17:51:13 -0400 Subject: [icedtea-web] RFC: Patch to stabilize applet initialization In-Reply-To: <20101022194624.GF7664@redhat.com> References: <20101021213816.GF26975@redhat.com> <20101021215240.GD25601@rivendell.middle-earth.co.uk> <20101022152744.GA7664@redhat.com> <20101022194624.GF7664@redhat.com> Message-ID: <20101026215112.GF3781@redhat.com> * Deepak Bhole [2010-10-22 15:46]: > * Deepak Bhole [2010-10-22 11:28]: > > * Dr Andrew John Hughes [2010-10-21 17:52]: > > > On 17:38 Thu 21 Oct , Deepak Bhole wrote: > > > > Hi, > > > > > > > > The attached patch envelopes fixes for two of Andrew's pending patches > > > > (fixing 100% CPU load and the frame pop-up issue). In addition to those, > > > > it fixes a lot of other initialization issues, particularly when > > > > initializing multiple applets and/or closing other tabs with applets > > > > which are being initialized. > > > > > > > > With this patch, I tested over 200 parallel applet inits, randomly > > > > closing tabs, and everything works correctly. > > > > > > > > One known issue is that if timed correctly, a frame can appear outside > > > > for a fraction of a second. It always goes away instantly though, and I > > > > will be posting a patch to fix that problem in the near future. > > > > > > > > Cheers, > > > > Deepak > > > > > > Do you have a ChangeLog for this? It would be good to know why each change > > > is being made. > > > > > Sorry, forgot the ChangeLog: > > 2010-10-22 Deepak Bhole > > * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: > Replace all status.put calls with calls to updateStatus(). > (createPanel): Create a frame with a 0 handle. Use the new > waitForAppletInit function to wait until applet is ready. > (reFrame): Re-order code so that the panel is never parentless. > (handleMessage): Re-wrote message processing to handle destroy calls > correctly, checking for them more often to prevent a frame from popping up > if the tab/page is closed before loading finishes. Decode special > characters in the message. > (updateStatus): New function. Updates the status for the given instance if > applicable. > (destroyApplet): New function. Destroys a given applet and frees related > resources. > (waitForAppletInit): New function. Blocks until applet is initialized. > (parse): Remove part that decoded the params. Decoding is now done earlier > in handleMessage(). > * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java: > (getPriorityStrIfPriority): Mark destroy messages as priority. > (bringPriorityMessagesToFront): Scans the queue for priority messages and > brings them to the front. > (run): If the queue is not empty and there are no workers left, run > bringPriorityMessagesToFront() and retry. > I assume this was OK for head now.. :) Please let me know if there are any problems and I will back it out. Cheers, Deepak > > > > In particular, why: > > > > > > > + > > > > + // Add first, remove later > > > > + newFrame.add("Center", panel); > > > > oldFrame.remove(panel); > > > > oldFrame.dispose(); > > > > + } else { > > > > + newFrame.add("Center", panel); > > > > } > > > > > > > > - newFrame.add("Center", panel); > > > > > > is this necessary? > > > > > > > As crazy as that looks, yes. here is the full piece of the code: > > > > PluginAppletViewer newFrame = new PluginAppletViewer(handle, identifier, statusMsgStream, panel); > > > > if (oldFrame != null) { > > applets.remove(oldFrame.identifier); > > oldFrame.removeWindowListener(oldFrame.windowEventListener); > > panel.removeAppletListener(oldFrame.appletEventListener); > > > > // Add first, remove later > > newFrame.add("Center", panel); > > oldFrame.remove(panel); > > oldFrame.dispose(); > > } else { > > newFrame.add("Center", panel); > > } > > > > oldFrame is an embedded frame in which an applet instance resides, newFrame is > > another embedded frame with a different handle that it needs to be moved to. In > > addition to being implanted in oldFrame, oldFrame is also registered as a > > listener for a few things. We first need to unregister those listeners. We then > > need to add it to the newFrame right away, as there are problems if the panel > > does not have a parent. Hence the add being done in the if loop. > > > > There is a second case where there may be no previous parent frame at all > > (initial embedding) -- in this case, we need to do the add() in the else > > otherwise it will get added twice. > > > > The change I alluded to in the original email (to fix the pop-out frame > > completely) will get rid of the above if/else condition btw, so it is only > > temporary. > > > > Cheers, > > Deepak > > > > > Also there seems to be some odd whitespace changes and excessive (8 space) indenting. > > > > > > > diff -r 85db7b3a1c93 plugin/icedteanp/java/sun/applet/PluginAppletViewer.java > > > > --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Thu Oct 21 21:12:21 2010 +0100 > > > > +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Thu Oct 21 17:22:56 2010 -0700 > > > > @@ -136,12 +136,10 @@ > > > > } > > > > } > > > > }); > > > > + > > > > + // create the frame. > > > > + PluginAppletViewer.reFrame(null, identifier, System.out, 0, panel); > > > > > > > > - > > > > - > > > > - // create the frame. > > > > - PluginAppletViewer.reFrame(null, identifier, System.out, handle, panel); > > > > - > > > > panel.init(); > > > > > > > > // Start the applet > > > > @@ -179,15 +177,7 @@ > > > > > > > > // Wait for the panel to initialize > > > > // (happens in a separate thread) > > > > - while (panel.getApplet() == null && > > > > - ((NetxPanel) panel).isAlive()) { > > > > - try { > > > > - Thread.sleep(50); > > > > - PluginDebug.debug("Waiting for applet to initialize..."); > > > > - } catch (InterruptedException ie) { > > > > - // just wait > > > > - } > > > > - } > > > > + PluginAppletViewer.waitForAppletInit((NetxPanel) panel); > > > > > > > > a = panel.getApplet(); > > > > > > > > @@ -317,7 +307,17 @@ > > > > */ > > > > private static String defaultSaveFile = "Applet.ser"; > > > > > > > > - private static enum PAV_INIT_STATUS {PRE_INIT, IN_INIT, INIT_COMPLETE, INACTIVE}; > > > > + > > > > + /** > > > > + * Enumerates the current status of an applet > > > > + * > > > > + * PRE_INIT -> Parsing and initialization phase > > > > + * INIT_COMPLETE -> Initialization complete, reframe pending > > > > + * REFRAME_COMPLETE -> Reframe complete, applet is initialized and usable by the user > > > > + * INACTIVE -> Browser has directed that the applet be destroyed (this state is non-overridable except by DESTROYED) > > > > + * DESTROYED -> Applet has been destroyed > > > > + */ > > > > + private static enum PAV_INIT_STATUS {PRE_INIT, INIT_COMPLETE, REFRAME_COMPLETE, INACTIVE, DESTROYED}; > > > > > > > > /** > > > > * The panel in which the applet is being displayed. > > > > @@ -350,7 +350,6 @@ > > > > > > > > private static HashMap status = > > > > new HashMap(); > > > > - > > > > > > > > private long handle = 0; > > > > private WindowListener windowEventListener = null; > > > > @@ -380,16 +379,20 @@ > > > > return; > > > > > > > > PluginAppletViewer newFrame = new PluginAppletViewer(handle, identifier, statusMsgStream, panel); > > > > - > > > > + > > > > if (oldFrame != null) { > > > > applets.remove(oldFrame.identifier); > > > > oldFrame.removeWindowListener(oldFrame.windowEventListener); > > > > panel.removeAppletListener(oldFrame.appletEventListener); > > > > + > > > > + // Add first, remove later > > > > + newFrame.add("Center", panel); > > > > oldFrame.remove(panel); > > > > oldFrame.dispose(); > > > > + } else { > > > > + newFrame.add("Center", panel); > > > > } > > > > > > > > - newFrame.add("Center", panel); > > > > newFrame.pack(); > > > > > > > > newFrame.appletEventListener = new AppletEventListener(newFrame, newFrame); > > > > @@ -397,11 +400,6 @@ > > > > > > > > applets.put(identifier, newFrame); > > > > > > > > - // dispose oldframe if necessary > > > > - if (oldFrame != null) { > > > > - oldFrame.dispose(); > > > > - } > > > > - > > > > PluginDebug.debug(panel + " reframed"); > > > > } > > > > > > > > @@ -449,7 +447,7 @@ > > > > this.frame = frame; > > > > this.appletViewer = appletViewer; > > > > } > > > > - > > > > + > > > > public void appletStateChanged(AppletEvent evt) > > > > { > > > > AppletPanel src = (AppletPanel)evt.getSource(); > > > > @@ -483,9 +481,9 @@ > > > > AppletPanel.changeFrameAppContext(frame, SunToolkit.targetToAppContext(a)); > > > > else > > > > AppletPanel.changeFrameAppContext(frame, AppContext.getAppContext()); > > > > - > > > > - status.put(appletViewer.identifier, PAV_INIT_STATUS.INIT_COMPLETE); > > > > - > > > > + > > > > + updateStatus(appletViewer.identifier, PAV_INIT_STATUS.INIT_COMPLETE); > > > > + > > > > break; > > > > } > > > > } > > > > @@ -510,7 +508,13 @@ > > > > > > > > try { > > > > if (message.startsWith("handle")) { > > > > - > > > > + > > > > + // If there is a key for this status, it means it > > > > + // was either initialized before, or destroy has been > > > > + // processed. Stop moving further. > > > > + if (updateStatus(identifier, PAV_INIT_STATUS.PRE_INIT) != null) > > > > + return; > > > > + > > > > // Extract the information from the message > > > > String[] msgParts = new String[4]; > > > > for (int i=0; i < 3; i++) { > > > > @@ -519,32 +523,38 @@ > > > > msgParts[i] = message.substring(spaceLocation + 1, nextSpaceLocation); > > > > message = message.substring(nextSpaceLocation + 1); > > > > } > > > > - > > > > + > > > > long handle = Long.parseLong(msgParts[0]); > > > > String width = msgParts[1]; > > > > String height = msgParts[2]; > > > > - > > > > + > > > > int spaceLocation = message.indexOf(' ', "tag".length()+1); > > > > String documentBase = > > > > UrlUtil.decode(message.substring("tag".length() + 1, spaceLocation)); > > > > - String tag = message.substring(spaceLocation+1); > > > > + String tag = message.substring(spaceLocation+1); > > > > + > > > > + // Decode the tag > > > > + tag = tag.replace(">", ">"); > > > > + tag = tag.replace("<", "<"); > > > > + tag = tag.replace("&", "&"); > > > > + tag = tag.replace(" ", "\n"); > > > > + tag = tag.replace(" ", "\r"); > > > > + tag = tag.replace(""", "\""); > > > > > > > > PluginDebug.debug ("Handle = " + handle + "\n" + > > > > "Width = " + width + "\n" + > > > > "Height = " + height + "\n" + > > > > "DocumentBase = " + documentBase + "\n" + > > > > "Tag = " + tag); > > > > - > > > > - status.put(identifier, PAV_INIT_STATUS.PRE_INIT); > > > > + > > > > PluginAppletViewer.parse > > > > (identifier, handle, width, height, > > > > new StringReader(tag), > > > > new URL(documentBase)); > > > > - > > > > > > > > int maxWait = APPLET_TIMEOUT; // wait for applet to fully load > > > > int wait = 0; > > > > - while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && > > > > + while ( !applets.containsKey(identifier) && // Map is populated only by reFrame > > > > (wait < maxWait)) { > > > > > > > > try { > > > > @@ -555,9 +565,44 @@ > > > > } > > > > } > > > > > > > > - if (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE)) > > > > + // If wait exceeded maxWait, we timed out. Throw an exception > > > > + if (wait >= maxWait) > > > > throw new Exception("Applet initialization timeout"); > > > > > > > > + PluginAppletViewer oldFrame = applets.get(identifier); > > > > + > > > > + // We should not try to destroy an applet during > > > > + // initialization. It may cause an inconsistent state, > > > > + // which would bad if it's a trusted applet that > > > > + // read/writes to files > > > > + waitForAppletInit((NetxPanel) applets.get(identifier).panel); > > > > + > > > > + // Should we proceed with reframing? > > > > + if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { > > > > + destroyApplet(identifier); > > > > + return; > > > > + } > > > > + > > > > + // Proceed with re-framing > > > > + reFrame(oldFrame, identifier, System.out, handle, oldFrame.panel); > > > > + > > > > + // There is a slight chance that destroy can happen > > > > + // between the above and below line > > > > + if (updateStatus(identifier, PAV_INIT_STATUS.REFRAME_COMPLETE).equals(PAV_INIT_STATUS.INACTIVE)) { > > > > + destroyApplet(identifier); > > > > + } > > > > + > > > > + } else if (message.startsWith("destroy")) { > > > > + > > > > + // Set it inactive, and try to do cleanup is applicable > > > > + PAV_INIT_STATUS previousStatus = updateStatus(identifier, PAV_INIT_STATUS.INACTIVE); > > > > + PluginDebug.debug("Destroy status set for " + identifier); > > > > + > > > > + if (previousStatus != null && > > > > + previousStatus.equals(PAV_INIT_STATUS.REFRAME_COMPLETE)) { > > > > + destroyApplet(identifier); > > > > + } > > > > + > > > > } else { > > > > PluginDebug.debug ("Handling message: " + message + " instance " + identifier + " " + Thread.currentThread()); > > > > > > > > @@ -568,7 +613,7 @@ > > > > status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT) > > > > ) > > > > ); > > > > - > > > > + > > > > // don't bother processing further for inactive applets > > > > if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) > > > > return; > > > > @@ -580,31 +625,131 @@ > > > > e.printStackTrace(); > > > > > > > > // If an exception happened during pre-init, we need to update status > > > > - if (status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT)) > > > > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > > > > + updateStatus(identifier, PAV_INIT_STATUS.INACTIVE); > > > > > > > > throw new RuntimeException("Failed to handle message: " + > > > > message + " for instance " + identifier, e); > > > > } > > > > } > > > > - > > > > + > > > > + /** > > > > + * Sets the status unless an overriding status is set (e.g. if > > > > + * status is DESTROYED, it may not be overridden). > > > > + * > > > > + * @param identifier The identifier for which the status is to be set > > > > + * @param status The status to switch to > > > > + * @return The previous status > > > > + */ > > > > + private static synchronized PAV_INIT_STATUS updateStatus(int identifier, PAV_INIT_STATUS newStatus) { > > > > + > > > > + PAV_INIT_STATUS prev = status.get(identifier); > > > > + > > > > + // If the status is set > > > > + if (status.containsKey(identifier)) { > > > > + > > > > + // Nothing may override destroyed status > > > > + if (status.get(identifier).equals(PAV_INIT_STATUS.DESTROYED)) { > > > > + return prev; > > > > + } > > > > + > > > > + // If status is inactive, only DESTROYED may override it > > > > + if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { > > > > + if (!newStatus.equals(PAV_INIT_STATUS.DESTROYED)) { > > > > + return prev; > > > > + } > > > > + } > > > > + } > > > > + > > > > + // Else set to given status > > > > + status.put(identifier, newStatus); > > > > + > > > > + return prev; > > > > + } > > > > + > > > > + /** > > > > + * Destroys the given applet instance. > > > > + * > > > > + * This function may be called multiple times without problems. > > > > + * It does a synchronized check on the status and will only > > > > + * attempt to destroy the applet if not previously destroyed. > > > > + * > > > > + * @param identifier The instance which is to be destroyed > > > > + */ > > > > + > > > > + private static synchronized void destroyApplet(int identifier) { > > > > + > > > > + PluginDebug.debug("DestroyApplet called for " + identifier); > > > > + > > > > + PAV_INIT_STATUS prev = updateStatus(identifier, PAV_INIT_STATUS.DESTROYED); > > > > + > > > > + // If already destroyed, return > > > > + if (prev.equals(PAV_INIT_STATUS.DESTROYED)) { > > > > + PluginDebug.debug(identifier + " already destroyed. Returning."); > > > > + return; > > > > + } > > > > + > > > > + // If already disposed, return > > > > + if (applets.get(identifier).panel.applet == null) { > > > > + // Try to still dispose the panel itself -- no harm done with double dispose > > > > + applets.get(identifier).dispose(); > > > > + > > > > + PluginDebug.debug(identifier + " inactive. Returning."); > > > > + return; > > > > + } > > > > + > > > > + PluginDebug.debug("Attempting to destroy " + identifier); > > > > + > > > > + final int fIdentifier = identifier; > > > > + SwingUtilities.invokeLater(new Runnable() { > > > > + public void run() { > > > > + applets.get(fIdentifier).appletClose(); > > > > + } > > > > + }); > > > > + > > > > + PluginDebug.debug(identifier + " destroyed"); > > > > + } > > > > + > > > > + /** > > > > + * Function to block until applet initialization is complete > > > > + * > > > > + * @param identifier The instance to wait for > > > > + */ > > > > + public static void waitForAppletInit(NetxPanel panel) { > > > > + > > > > + int waitTime = 0; > > > > + > > > > + // Wait till initialization finishes > > > > + while (panel.getApplet() == null && > > > > + panel.isAlive() && > > > > + waitTime < APPLET_TIMEOUT) { > > > > + try { > > > > + if (waitTime%500 == 0) > > > > + PluginDebug.debug("Waiting for applet panel " + panel + " to initialize..."); > > > > + > > > > + Thread.sleep(waitTime += 50); > > > > + } catch (InterruptedException ie) { > > > > + // just wait > > > > + } > > > > + } > > > > + > > > > + PluginDebug.debug("Applet panel " + panel + " initialized"); > > > > + } > > > > + > > > > public void handleMessage(int reference, String message) > > > > { > > > > if (message.startsWith("width")) { > > > > > > > > // Wait for panel to come alive > > > > int maxWait = APPLET_TIMEOUT; // wait for panel to come alive > > > > - int wait = 0; > > > > + int wait = 0; > > > > while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && wait < maxWait) { > > > > - > > > > - try { > > > > - Thread.sleep(50); > > > > - wait += 50; > > > > - } catch (InterruptedException ie) { > > > > - // just wait > > > > - } > > > > - } > > > > - > > > > + try { > > > > + Thread.sleep(50); > > > > + wait += 50; > > > > + } catch (InterruptedException ie) { > > > > + // just wait > > > > + } > > > > + } > > > > > > > > // 0 => width, 1=> width_value, 2 => height, 3=> height_value > > > > String[] dimMsg = message.split(" "); > > > > @@ -636,7 +781,7 @@ > > > > > > > > panel.setSize(width, height); > > > > panel.validate(); > > > > - > > > > + > > > > panel.applet.resize(width, height); > > > > panel.applet.validate(); > > > > } > > > > @@ -649,9 +794,6 @@ > > > > e.printStackTrace(); > > > > } > > > > > > > > - } else if (message.startsWith("destroy")) { > > > > - dispose(); > > > > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > > > > } else if (message.startsWith("GetJavaObject")) { > > > > > > > > // FIXME: how do we determine what security context this > > > > @@ -672,15 +814,7 @@ > > > > > > > > // Wait for the panel to initialize > > > > // (happens in a separate thread) > > > > - while (panel.getApplet() == null && > > > > - ((NetxPanel) panel).isAlive()) { > > > > - try { > > > > - Thread.sleep(50); > > > > - PluginDebug.debug("Waiting for applet to initialize..."); > > > > - } catch (InterruptedException ie) { > > > > - // just wait > > > > - } > > > > - } > > > > + waitForAppletInit((NetxPanel) panel); > > > > > > > > PluginDebug.debug(panel + " -- " + panel.getApplet() + " -- " + ((NetxPanel) panel).isAlive()); > > > > > > > > @@ -1548,10 +1682,11 @@ > > > > if (countApplets() == 0) { > > > > appletSystemExit(); > > > > } > > > > + > > > > + updateStatus(identifier, PAV_INIT_STATUS.DESTROYED); > > > > } > > > > }).start(); > > > > > > > > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > > > > } > > > > > > > > /** > > > > @@ -1677,18 +1812,6 @@ > > > > val = buf.toString(); > > > > } > > > > > > > > - att = att.replace(">", ">"); > > > > - att = att.replace("<", "<"); > > > > - att = att.replace("&", "&"); > > > > - att = att.replace(" ", "\n"); > > > > - att = att.replace(" ", "\r"); > > > > - > > > > - val = val.replace(">", ">"); > > > > - val = val.replace("<", "<"); > > > > - val = val.replace("&", "&"); > > > > - val = val.replace(" ", "\n"); > > > > - val = val.replace(" ", "\r"); > > > > - > > > > PluginDebug.debug("PUT " + att + " = '" + val + "'"); > > > > atts.put(att.toLowerCase(java.util.Locale.ENGLISH), val); > > > > > > > > @@ -1708,7 +1831,6 @@ > > > > // private static final == inline > > > > private static final boolean isInt(Object o) { > > > > boolean isInt = false; > > > > - > > > > try { > > > > Integer.parseInt((String) o); > > > > isInt = true; > > > > @@ -1763,7 +1885,6 @@ > > > > } catch (IOException ioe) { > > > > return ioe; > > > > } > > > > - > > > > return null; > > > > } > > > > }; > > > > @@ -1785,6 +1906,7 @@ > > > > boolean isObjectTag = false; > > > > boolean isEmbedTag = false; > > > > boolean objectTagAlreadyParsed = false; > > > > + > > > > // The current character > > > > // FIXME: This is an evil hack to force pass-by-reference.. the > > > > // parsing code needs to be rewritten from scratch to prevent such > > > > @@ -1879,19 +2001,6 @@ > > > > if (val == null) { > > > > statusMsgStream.println(requiresNameWarning); > > > > } else if (atts != null) { > > > > - att = att.replace(">", ">"); > > > > - att = att.replace("<", "<"); > > > > - att = att.replace("&", "&"); > > > > - att = att.replace(" ", "\n"); > > > > - att = att.replace(" ", "\r"); > > > > - att = att.replace(""", "\""); > > > > - > > > > - val = val.replace(">", ">"); > > > > - val = val.replace("<", "<"); > > > > - val = val.replace("&", "&"); > > > > - val = val.replace(" ", "\n"); > > > > - val = val.replace(" ", "\r"); > > > > - val = val.replace(""", "\""); > > > > PluginDebug.debug("PUT " + att + " = " + val); > > > > atts.put(att.toLowerCase(), val); > > > > } else { > > > > @@ -1920,8 +2029,8 @@ > > > > > > > > if (atts.get("width") == null || !isInt(atts.get("width"))) { > > > > atts.put("width", width); > > > > - } > > > > - > > > > + } > > > > + > > > > if (atts.get("height") == null || !isInt(atts.get("height"))) { > > > > atts.put("height", height); > > > > } > > > > @@ -1974,7 +2083,7 @@ > > > > if (atts.get("width") == null || !isInt(atts.get("width"))) { > > > > atts.put("width", width); > > > > } > > > > - > > > > + > > > > if (atts.get("height") == null || !isInt(atts.get("height"))) { > > > > atts.put("height", height); > > > > } > > > > @@ -2023,10 +2132,11 @@ > > > > if (atts.get("width") == null || !isInt(atts.get("width"))) { > > > > atts.put("width", width); > > > > } > > > > - > > > > + > > > > if (atts.get("height") == null || !isInt(atts.get("height"))) { > > > > atts.put("height", height); > > > > } > > > > + > > > > } > > > > } > > > > } > > > > diff -r 85db7b3a1c93 plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java > > > > --- a/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java Thu Oct 21 21:12:21 2010 +0100 > > > > +++ b/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java Thu Oct 21 17:22:56 2010 -0700 > > > > @@ -126,6 +126,10 @@ > > > > } > > > > > > > > private String getPriorityStrIfPriority(String message) { > > > > + > > > > + // Destroy messages are permanently high priority > > > > + if (message.endsWith("destroy")) > > > > + return "destroy"; > > > > > > > > synchronized (priorityWaitQueue) { > > > > Iterator it = priorityWaitQueue.iterator(); > > > > @@ -150,7 +154,6 @@ > > > > } > > > > } > > > > > > > > - > > > > public void notifyWorkerIsFree(PluginMessageHandlerWorker worker) { > > > > synchronized (initWorkers) { > > > > Iterator i = initWorkers.keySet().iterator(); > > > > @@ -176,6 +179,32 @@ > > > > } > > > > > > > > protected class ConsumerThread extends Thread { > > > > + > > > > + /** > > > > + * Scans the readQueue for priority messages and brings them to the front > > > > + */ > > > > + private void bringPriorityMessagesToFront() { > > > > + synchronized (readQueue) { > > > > + > > > > + // iterate through the list > > > > + for (int i=0; i < readQueue.size(); i++) { > > > > + > > > > + // remove element at i to inspect it > > > > + String message = readQueue.remove(i); > > > > + > > > > + // if element at i is a priority msg, bring it forward > > > > + if (getPriorityStrIfPriority(message) != null) { > > > > + readQueue.addFirst(message); > > > > + } else { // else keep it where it was > > > > + readQueue.add(i, message); > > > > + } > > > > + > > > > + // by the end the queue size is the same, so the > > > > + // position indicator (i) is still valid > > > > + } > > > > + } > > > > + } > > > > + > > > > public void run() { > > > > > > > > while (true) { > > > > @@ -190,7 +219,6 @@ > > > > > > > > String[] msgParts = message.split(" "); > > > > > > > > - > > > > String priorityStr = getPriorityStrIfPriority(message); > > > > boolean isPriorityResponse = (priorityStr != null); > > > > > > > > @@ -199,9 +227,12 @@ > > > > > > > > if (worker == null) { > > > > synchronized(readQueue) { > > > > - readQueue.addLast(message); > > > > + readQueue.addFirst(message); > > > > } > > > > > > > > + // re-scan to see if any priority message came in > > > > + bringPriorityMessagesToFront(); > > > > + > > > > continue; // re-loop to try next msg > > > > } > > > > > > > > > > > > > -- > > > Andrew :) > > > > > > Free Java Software Engineer > > > Red Hat, Inc. (http://www.redhat.com) > > > > > > Support Free Java! > > > Contribute to GNU Classpath and the OpenJDK > > > http://www.gnu.org/software/classpath > > > http://openjdk.java.net > > > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > > > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From dbhole at icedtea.classpath.org Tue Oct 26 15:08:50 2010 From: dbhole at icedtea.classpath.org (dbhole at icedtea.classpath.org) Date: Tue, 26 Oct 2010 22:08:50 +0000 Subject: /hg/icedtea-web: Trim whitespace from jar names in PluginBridge ... Message-ID: changeset 98887d964b0e in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=98887d964b0e author: Deepak Bhole date: Tue Oct 26 18:08:09 2010 -0700 Trim whitespace from jar names in PluginBridge constructor. diffstat: 2 files changed, 11 insertions(+) ChangeLog | 5 +++++ netx/net/sourceforge/jnlp/PluginBridge.java | 6 ++++++ diffs (28 lines): diff -r d4a914a000e3 -r 98887d964b0e ChangeLog --- a/ChangeLog Tue Oct 26 17:49:57 2010 -0700 +++ b/ChangeLog Tue Oct 26 18:08:09 2010 -0700 @@ -1,3 +1,8 @@ 2010-10-26 Deepak Bhole + + * netx/net/sourceforge/jnlp/PluginBridge.java: Trim whitespace from jar + names in the constructor. + 2010-10-26 Deepak Bhole * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: diff -r d4a914a000e3 -r 98887d964b0e netx/net/sourceforge/jnlp/PluginBridge.java --- a/netx/net/sourceforge/jnlp/PluginBridge.java Tue Oct 26 17:49:57 2010 -0700 +++ b/netx/net/sourceforge/jnlp/PluginBridge.java Tue Oct 26 18:08:09 2010 -0700 @@ -103,6 +103,12 @@ public class PluginBridge extends JNLPFi if (jar != null && jar.length() > 0) { this.jars = jar.split(","); + + // trim white spaces + for (int i =0; i < this.jars.length; i++) { + this.jars[i] = this.jars[i].trim(); + } + if (JNLPRuntime.isDebug()) { System.err.println("Jar string: " + jar); System.err.println("jars length: " + jars.length); From omajid at icedtea.classpath.org Tue Oct 26 15:16:44 2010 From: omajid at icedtea.classpath.org (omajid at icedtea.classpath.org) Date: Tue, 26 Oct 2010 22:16:44 +0000 Subject: /hg/icedtea-web: 4 new changesets Message-ID: changeset 9a6efc86f5c1 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=9a6efc86f5c1 author: Omair Majid date: Tue Oct 26 17:52:03 2010 -0400 overload a new R method for translation of simple strings 2010-10-26 Omair Majid * netx/net/sourceforge/jnlp/runtime/Translator.java (R(String)): New method. changeset 9aa450ca3d99 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=9aa450ca3d99 author: Omair Majid date: Tue Oct 26 17:56:41 2010 -0400 add more JNLP spec numbers as supported versions 2010-10-26 Omair Majid * netx/net/sourceforge/jnlp/Parser.java: Add 1.1, 1.2, 1.3 and 1.4 to supportedVersions. changeset a3941697dcdd in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=a3941697dcdd author: Omair Majid date: Tue Oct 26 18:00:35 2010 -0400 launch applications that have a non-public main class 2010-10-26 Omair Majid * netx/net/sourceforge/jnlp/Launcher.java (launchApplication): Mark main method as accessible before invoking it. changeset 33f17695e034 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=33f17695e034 author: Omair Majid date: Tue Oct 26 18:14:11 2010 -0400 Fix possible null dtd in Swing applications 2010-10-26 Omair Majid * netx/net/sourceforge/jnlp/Launcher.java (doPerApplicationAppContextHacks): New method. Create a new ParserDelegate to intialize the per AppContext dtd used by Swing HTML controls. (TgThread.run): Call doPerApplicationAppContextHacks. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java (initialize): Call doMainAppContextHacks. (doMainAppContextHacks): New method. Create a new ParserDelegate to initialize the per AppContext dtd used by Swing HTML controls. diffstat: 5 files changed, 77 insertions(+), 1 deletion(-) ChangeLog | 27 ++++++++++++++++++++ netx/net/sourceforge/jnlp/Launcher.java | 20 ++++++++++++++ netx/net/sourceforge/jnlp/Parser.java | 2 - netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java | 20 ++++++++++++++ netx/net/sourceforge/jnlp/runtime/Translator.java | 9 ++++++ diffs (158 lines): diff -r 98887d964b0e -r 33f17695e034 ChangeLog --- a/ChangeLog Tue Oct 26 18:08:09 2010 -0700 +++ b/ChangeLog Tue Oct 26 18:14:11 2010 -0400 @@ -1,3 +1,30 @@ 2010-10-26 Deepak Bhole + + * netx/net/sourceforge/jnlp/Launcher.java + (doPerApplicationAppContextHacks): New method. Create a new ParserDelegate + to intialize the per AppContext dtd used by Swing HTML controls. + (TgThread.run): Call doPerApplicationAppContextHacks. + * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java + (initialize): Call doMainAppContextHacks. + (doMainAppContextHacks): New method. Create a new ParserDelegate to + initialize the per AppContext dtd used by Swing HTML controls. + +2010-10-26 Omair Majid + + * netx/net/sourceforge/jnlp/Launcher.java + (launchApplication): Mark main method as accessible before + invoking it. + +2010-10-26 Omair Majid + + * netx/net/sourceforge/jnlp/Parser.java: Add 1.1, 1.2, 1.3 and + 1.4 to supportedVersions. + +2010-10-26 Omair Majid + + * netx/net/sourceforge/jnlp/runtime/Translator.java + (R(String)): New method. + 2010-10-26 Deepak Bhole * netx/net/sourceforge/jnlp/PluginBridge.java: Trim whitespace from jar diff -r 98887d964b0e -r 33f17695e034 netx/net/sourceforge/jnlp/Launcher.java --- a/netx/net/sourceforge/jnlp/Launcher.java Tue Oct 26 18:08:09 2010 -0700 +++ b/netx/net/sourceforge/jnlp/Launcher.java Tue Oct 26 18:14:11 2010 -0400 @@ -50,6 +50,7 @@ import net.sourceforge.jnlp.util.Reflect import net.sourceforge.jnlp.util.Reflect; import javax.swing.SwingUtilities; +import javax.swing.text.html.parser.ParserDelegator; import sun.awt.SunToolkit; @@ -474,6 +475,7 @@ public class Launcher { splashScreen.dispose(); } + main.setAccessible(true); main.invoke(null, new Object[] { args } ); return app; @@ -778,6 +780,22 @@ public class Launcher { } } + /** + * Do hacks on per-application level to allow different AppContexts to work + * + * @see JNLPRuntime#doMainAppContextHacks + */ + private static void doPerApplicationAppContextHacks() { + + /* + * With OpenJDK6 (but not with 7) a per-AppContext dtd is maintained. + * This dtd is created by the ParserDelgate. However, the code in + * HTMLEditorKit (used to render HTML in labels and textpanes) creates + * the ParserDelegate only if there are no existing ParserDelegates. The + * result is that all other AppContexts see a null dtd. + */ + new ParserDelegator(); + } /** * This runnable is used to call the appropriate launch method @@ -815,6 +833,8 @@ public class Launcher { if (context && !isPlugin) SunToolkit.createNewAppContext(); + doPerApplicationAppContextHacks(); + if (isPlugin) { // Do not display download indicators if we're using gcjwebplugin. JNLPRuntime.setDefaultDownloadIndicator(null); diff -r 98887d964b0e -r 33f17695e034 netx/net/sourceforge/jnlp/Parser.java --- a/netx/net/sourceforge/jnlp/Parser.java Tue Oct 26 18:08:09 2010 -0700 +++ b/netx/net/sourceforge/jnlp/Parser.java Tue Oct 26 18:14:11 2010 -0400 @@ -68,7 +68,7 @@ class Parser { /** the supported JNLP file versions */ - private static Version supportedVersions = new Version("1.0 1.5 1.6 6.0"); + private static Version supportedVersions = new Version("1.0 1.1 1.2 1.3 1.4 1.5 1.6 6.0"); // fix: some descriptors need to use the jnlp file at a later // date and having file ref lets us pass it to their diff -r 98887d964b0e -r 33f17695e034 netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Tue Oct 26 18:08:09 2010 -0700 +++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Tue Oct 26 18:14:11 2010 -0400 @@ -27,6 +27,7 @@ import javax.jnlp.*; import javax.jnlp.*; import javax.naming.ConfigurationException; import javax.swing.UIManager; +import javax.swing.text.html.parser.ParserDelegator; import net.sourceforge.jnlp.*; import net.sourceforge.jnlp.cache.*; @@ -232,6 +233,8 @@ public class JNLPRuntime { // ignore it } + doMainAppContextHacks(); + if (securityEnabled) { Policy.setPolicy(policy); // do first b/c our SM blocks setPolicy System.setSecurityManager(security); @@ -258,6 +261,23 @@ public class JNLPRuntime { securityThread.setDaemon(true); securityThread.start(); return runner; + } + + /** + * Performs a few hacks that are needed for the main AppContext + * + * @see Launcher#doPerApplicationAppContextHacks + */ + private static void doMainAppContextHacks() { + + /* + * With OpenJDK6 (but not with 7) a per-AppContext dtd is maintained. + * This dtd is created by the ParserDelgate. However, the code in + * HTMLEditorKit (used to render HTML in labels and textpanes) creates + * the ParserDelegate only if there are no existing ParserDelegates. The + * result is that all other AppContexts see a null dtd. + */ + new ParserDelegator(); } /** diff -r 98887d964b0e -r 33f17695e034 netx/net/sourceforge/jnlp/runtime/Translator.java --- a/netx/net/sourceforge/jnlp/runtime/Translator.java Tue Oct 26 18:08:09 2010 -0700 +++ b/netx/net/sourceforge/jnlp/runtime/Translator.java Tue Oct 26 18:14:11 2010 -0400 @@ -28,4 +28,13 @@ public class Translator { return JNLPRuntime.getMessage(message, params); } + /** + * Return a translated (localized) version of the message + * @param message the message to translate + * @return a string representing the localized message + */ + public static String R(String message) { + return JNLPRuntime.getMessage(message); + } + } From omajid at redhat.com Tue Oct 26 15:17:23 2010 From: omajid at redhat.com (Omair Majid) Date: Tue, 26 Oct 2010 18:17:23 -0400 Subject: [icedtea-web] RFC: fix null dtd for swing applications rendering html In-Reply-To: <20101026203227.GA3781@redhat.com> References: <4CC72015.4050401@redhat.com> <20101026203227.GA3781@redhat.com> Message-ID: <4CC75373.5070102@redhat.com> On 10/26/2010 04:33 PM, Deepak Bhole wrote: > * Omair Majid [2010-10-26 15:46]: >> Hi, >> >> There has been a regression in netx: applications that render html >> (using Swing components) now fail with a null pointer exception. >> This problem can be reproduced by running the program at [1]. >> > > What caused this regression? I thought all the app context stuff was > still disabled, with just the support added on the side? > >> The problem is caused by how HTMLEditorKit/HTMLDocument and >> ParserDelgator interact in the presence of multiple AppContexts. The >> instance of the ParserDelegate is shared between multiple >> HTMLEditorKit in different AppContexts. However, ParserDelegate >> maintains a per-AppContext dtd instance. The dtd is valid in the >> AppContext that created the ParserDelegate but null in all other >> AppContexts. Using this null dtd throws a NullPointerException. This >> is really a bug in OpenJDK6 rather than Netx. Fortunately, this bug >> has been fixed in OpenJDK7 - ParserDelegate maintains an instance of >> the dtd per runtime instead of per AppContext. >> >> The attached patch works around this bug. It manually creates a >> ParserDelegate for each AppContext to avoid this problem. >> > > Assuming you have tested this, OK for head. > Thanks. Pushed to HEAD. Cheers, Omair From omajid at redhat.com Tue Oct 26 15:17:46 2010 From: omajid at redhat.com (Omair Majid) Date: Tue, 26 Oct 2010 18:17:46 -0400 Subject: [icedtea-web] RFC: unify localization code In-Reply-To: <20101026171400.GA13608@redhat.com> References: <4CC5B635.5030902@redhat.com> <20101025172244.GA31205@redhat.com> <4CC5CA73.6080204@redhat.com> <4CC5CAE4.8030300@redhat.com> <20101025182445.GD31205@redhat.com> <4CC5CF8D.2060100@redhat.com> <4CC6F61A.3000007@redhat.com> <20101026171400.GA13608@redhat.com> Message-ID: <4CC7538A.2030002@redhat.com> On 10/26/2010 01:14 PM, Deepak Bhole wrote: > * Omair Majid [2010-10-26 11:39]: >> On 10/25/2010 02:42 PM, Omair Majid wrote: >>> On 10/25/2010 02:24 PM, Deepak Bhole wrote: >>>> * Omair Majid [2010-10-25 14:22]: >>>>> On 10/25/2010 02:20 PM, Omair Majid wrote: >>>>>> On 10/25/2010 01:22 PM, Deepak Bhole wrote: >>>>>>> * Omair Majid [2010-10-25 12:54]: >>>>>>>> Hi, >>>>>>>> >>>>>>>> Netx contains a number of duplicate methods named "R" defined in >>>>>>>> various files that act as a wrapper for JNLPRuntime.getMessage(). >>>>>>>> The attached patch creates a new class Translate and moves all the >>>>>>>> "R" methods to it. This set of overloaded "R" methods is then >>>>>>>> statically imported anywhere that needs localized strings. >>>>>>>> >>>>>>> >>>>>>> While it is being refactored, why not use varargs for R()? >>>>>>> >>>>>> >>>>>> Fixed. >>>>> >>>>> Grr.. Accceidentally sent without finishing email :( >>>>> >>>>> Here is the attachment. >>>>> >>>> >>>> Looks good. Okay for commit to HEAD. >>>> >>>> Deepak >>>> >>> >>> Thanks. Pushed to HEAD. >>> >> >> I think I broke simple string translation :( New patch is attached. >> >> ChangeLog: >> 2010-10-26 Omair Majid >> >> * netx/net/sourceforge/jnlp/runtime/Translator.java >> (R(String)): New method. >> >> Any comments? >> > > Looks fine to me. Ok for HEAD. > Thanks. Pushed to HEAD. Cheers, Omair From dbhole at redhat.com Tue Oct 26 15:18:01 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Tue, 26 Oct 2010 18:18:01 -0400 Subject: [icedtea-web] Why use a separate basedir for plugin? In-Reply-To: <4CC6E900.8050709@redhat.com> References: <4CC6E900.8050709@redhat.com> Message-ID: <20101026221801.GG3781@redhat.com> * Omair Majid [2010-10-26 11:03]: > Hi, > > I noticed that the plugin uses a different basedir (see > JNLPRuntime.setBaseDir) from javaws. Is there a reason why? > > Since committing the deployment configuration patch, I have been > working on integrating it into icedtea-web (I believe that ~/.netxrc > is deprecated as of now). The deployment settings however, do not > distinguish between plugin and javaws - whether in terms of the > cache they use or which certificates are considered trusted. Hence I > would like to make them both use the same certificates and cache > (and possibly other things). Are there any reasons against doing > this? > Well, for one, they are 2 different things. We use the netx component for embedding, but the plugin is still separate in terms of functionality. How about putting everything in ~/.icedtea? Speaking of deployement configuration, perhaps we should use .java/deployement for that? If a user has previous deployment settings from the Oracle JDK, they shouldn't have to re-do it just for IcedTea/NetX. Cheers, Deepak > Thanks, > Omair From omajid at redhat.com Tue Oct 26 15:18:27 2010 From: omajid at redhat.com (Omair Majid) Date: Tue, 26 Oct 2010 18:18:27 -0400 Subject: [icedtea-web] RFC: add more JNLP spec numbers In-Reply-To: <20101026213912.GD3781@redhat.com> References: <4CC73B9A.5000302@redhat.com> <20101026213912.GD3781@redhat.com> Message-ID: <4CC753B3.6070309@redhat.com> On 10/26/2010 05:39 PM, Deepak Bhole wrote: > * Omair Majid [2010-10-26 17:32]: >> Hi, >> >> The attached patch adds more "supported" specification numbers to >> netx. Secureftp2 [1] contains a JNLP file with a specification >> version 1.4 (I think they might have confused the Java version with >> the JNLP version...). In anticipation of the worst, I have also >> added 1.3 as a supported version. >> >> Personally I am starting to doubt the point of checking and failing >> if the jnlp file specifies an unsupported version - I think netx >> should try and run whatever it can instead of failing based on a >> (often wrong) version. >> > > I assume there was a 1.2 as well? Might as well add that too! :) > > Ok for HEAD after the above. > Heh. I also threw in 1.1 for good measure. Thanks for the review. Cheers, Omair From ahughes at redhat.com Tue Oct 26 15:23:23 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Tue, 26 Oct 2010 23:23:23 +0100 Subject: [icedtea-web] RFC: launch application that have a non-public main class In-Reply-To: <4CC7343E.9060705@redhat.com> References: <4CC7343E.9060705@redhat.com> Message-ID: <20101026222323.GA31988@rivendell.middle-earth.co.uk> On 16:04 Tue 26 Oct , Omair Majid wrote: > Hi, > > The attached patch bypasses checks imposed by the reflection API to > ensure that netx is allowed to access the class it is trying to access. > Generally, this makes complete sense. However, there are some > applications (such as the Present/Future Value Calculator [1]) that > declare their main method in a non public class. Netx currently fails > with an IllegalAccessException when it encounters this. > > ChangeLog > 2010-10-26 Omair Majid > > * netx/net/sourceforge/jnlp/Launcher.java > (launchApplication): Mark main method as accessible before invoking > it. > > Thanks, > Omair > > [1] http://www.arbores.ca/PresentFuture.jnlp Looks good to me. > diff -r b1b876d99849 netx/net/sourceforge/jnlp/Launcher.java > --- a/netx/net/sourceforge/jnlp/Launcher.java Mon Oct 25 17:16:13 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/Launcher.java Tue Oct 26 15:46:09 2010 -0400 > @@ -474,6 +475,7 @@ > splashScreen.dispose(); > } > > + main.setAccessible(true); > main.invoke(null, new Object[] { args } ); > > return app; -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From ahughes at redhat.com Tue Oct 26 15:25:57 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Tue, 26 Oct 2010 23:25:57 +0100 Subject: [icedtea-web] RFC: add more JNLP spec numbers In-Reply-To: <4CC73B9A.5000302@redhat.com> References: <4CC73B9A.5000302@redhat.com> Message-ID: <20101026222557.GB31988@rivendell.middle-earth.co.uk> On 16:35 Tue 26 Oct , Omair Majid wrote: > Hi, > > The attached patch adds more "supported" specification numbers to netx. > Secureftp2 [1] contains a JNLP file with a specification version 1.4 (I > think they might have confused the Java version with the JNLP > version...). In anticipation of the worst, I have also added 1.3 as a > supported version. > > Personally I am starting to doubt the point of checking and failing if > the jnlp file specifies an unsupported version - I think netx should try > and run whatever it can instead of failing based on a (often wrong) version. > I don't see the harm in not checking the version strictly. I've always had similar doubts about checking the Java specification level offered by a VM (we have to patch this out to make gcj work in IcedTea). > ChangeLog > 2010-20-26 Omair Majid > > * netx/net/sourceforge/jnlp/Parser.java: Add 1.3 and 1.4 to > supportedVersions. > > > Thanks, > Omair > > [1] http://www.glub.com/products/secureftp/jws/secureftp2.jnlp > diff -r b1b876d99849 netx/net/sourceforge/jnlp/Parser.java > --- a/netx/net/sourceforge/jnlp/Parser.java Mon Oct 25 17:16:13 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/Parser.java Tue Oct 26 16:30:53 2010 -0400 > @@ -68,7 +68,7 @@ > > > /** the supported JNLP file versions */ > - private static Version supportedVersions = new Version("1.0 1.5 1.6 6.0"); > + private static Version supportedVersions = new Version("1.0 1.3 1.4 1.5 1.6 6.0"); > > // fix: some descriptors need to use the jnlp file at a later > // date and having file ref lets us pass it to their -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From omajid at redhat.com Tue Oct 26 15:31:35 2010 From: omajid at redhat.com (Omair Majid) Date: Tue, 26 Oct 2010 18:31:35 -0400 Subject: [icedtea-web] Why use a separate basedir for plugin? In-Reply-To: <20101026221801.GG3781@redhat.com> References: <4CC6E900.8050709@redhat.com> <20101026221801.GG3781@redhat.com> Message-ID: <4CC756C7.7060102@redhat.com> On 10/26/2010 06:18 PM, Deepak Bhole wrote: > * Omair Majid [2010-10-26 11:03]: >> Hi, >> >> I noticed that the plugin uses a different basedir (see >> JNLPRuntime.setBaseDir) from javaws. Is there a reason why? >> >> Since committing the deployment configuration patch, I have been >> working on integrating it into icedtea-web (I believe that ~/.netxrc >> is deprecated as of now). The deployment settings however, do not >> distinguish between plugin and javaws - whether in terms of the >> cache they use or which certificates are considered trusted. Hence I >> would like to make them both use the same certificates and cache >> (and possibly other things). Are there any reasons against doing >> this? >> > > Well, for one, they are 2 different things. We use the netx component > for embedding, but the plugin is still separate in terms of > functionality. > Right, but there is no reason they should not use the same proxy/cache/certificates, is there? Oracle JDK goes out of its ways to make them appear behave the same (including reading/parsing the mozilla configuration containing proxy settings in Java Web Start to get the same set of proxies the plugin would - I have not personally confirmed this, but the documentation says so). > How about putting everything in ~/.icedtea? > Sure, makes sense to me. My only question was about issues in having the plugin and netx share files. > Speaking of deployement configuration, perhaps we should use > .java/deployement for that? If a user has previous deployment settings > from the Oracle JDK, they shouldn't have to re-do it just for > IcedTea/NetX. > That's the first thing I thought of, but I see a few potential issues with this. For one, the user can set values in this file which may cause Netx to and Web Start to clash. For example the cache hierarchy is quite different and one of them may overwrite/delete files the other creates. For another, the user may set values which may make sense in one and not another - for example setting a custom user.security.trusted.cacerts (which netx does not support) and then not allowing any security prompts for applications which appear untrusted. Such an application would work under Java Web Start but fail under netx. I am sure these issues can be ironed out, but for now we shouldnt ignore it. Thanks, Omair From ahughes at redhat.com Tue Oct 26 15:45:59 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Tue, 26 Oct 2010 23:45:59 +0100 Subject: [icedtea-web] RFC: Patch to stabilize applet initialization In-Reply-To: <20101022194624.GF7664@redhat.com> References: <20101021213816.GF26975@redhat.com> <20101021215240.GD25601@rivendell.middle-earth.co.uk> <20101022152744.GA7664@redhat.com> <20101022194624.GF7664@redhat.com> Message-ID: <20101026224559.GC31988@rivendell.middle-earth.co.uk> On 15:46 Fri 22 Oct , Deepak Bhole wrote: > * Deepak Bhole [2010-10-22 11:28]: > > * Dr Andrew John Hughes [2010-10-21 17:52]: > > > On 17:38 Thu 21 Oct , Deepak Bhole wrote: > > > > Hi, > > > > > > > > The attached patch envelopes fixes for two of Andrew's pending patches > > > > (fixing 100% CPU load and the frame pop-up issue). In addition to those, > > > > it fixes a lot of other initialization issues, particularly when > > > > initializing multiple applets and/or closing other tabs with applets > > > > which are being initialized. > > > > > > > > With this patch, I tested over 200 parallel applet inits, randomly > > > > closing tabs, and everything works correctly. > > > > > > > > One known issue is that if timed correctly, a frame can appear outside > > > > for a fraction of a second. It always goes away instantly though, and I > > > > will be posting a patch to fix that problem in the near future. > > > > > > > > Cheers, > > > > Deepak > > > > > > Do you have a ChangeLog for this? It would be good to know why each change > > > is being made. > > > > > Sorry, forgot the ChangeLog: > > 2010-10-22 Deepak Bhole > > * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: > Replace all status.put calls with calls to updateStatus(). > (createPanel): Create a frame with a 0 handle. Use the new > waitForAppletInit function to wait until applet is ready. > (reFrame): Re-order code so that the panel is never parentless. > (handleMessage): Re-wrote message processing to handle destroy calls > correctly, checking for them more often to prevent a frame from popping up > if the tab/page is closed before loading finishes. Decode special > characters in the message. > (updateStatus): New function. Updates the status for the given instance if > applicable. > (destroyApplet): New function. Destroys a given applet and frees related > resources. > (waitForAppletInit): New function. Blocks until applet is initialized. > (parse): Remove part that decoded the params. Decoding is now done earlier > in handleMessage(). > * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java: > (getPriorityStrIfPriority): Mark destroy messages as priority. > (bringPriorityMessagesToFront): Scans the queue for priority messages and > brings them to the front. > (run): If the queue is not empty and there are no workers left, run > bringPriorityMessagesToFront() and retry. > > > > > In particular, why: > > > > > > > + > > > > + // Add first, remove later > > > > + newFrame.add("Center", panel); > > > > oldFrame.remove(panel); > > > > oldFrame.dispose(); > > > > + } else { > > > > + newFrame.add("Center", panel); > > > > } > > > > > > > > - newFrame.add("Center", panel); > > > > > > is this necessary? > > > > > > > As crazy as that looks, yes. here is the full piece of the code: > > > > PluginAppletViewer newFrame = new PluginAppletViewer(handle, identifier, statusMsgStream, panel); > > > > if (oldFrame != null) { > > applets.remove(oldFrame.identifier); > > oldFrame.removeWindowListener(oldFrame.windowEventListener); > > panel.removeAppletListener(oldFrame.appletEventListener); > > > > // Add first, remove later > > newFrame.add("Center", panel); > > oldFrame.remove(panel); > > oldFrame.dispose(); > > } else { > > newFrame.add("Center", panel); > > } > > > > oldFrame is an embedded frame in which an applet instance resides, newFrame is > > another embedded frame with a different handle that it needs to be moved to. In > > addition to being implanted in oldFrame, oldFrame is also registered as a > > listener for a few things. We first need to unregister those listeners. We then > > need to add it to the newFrame right away, as there are problems if the panel > > does not have a parent. Hence the add being done in the if loop. > > > > There is a second case where there may be no previous parent frame at all > > (initial embedding) -- in this case, we need to do the add() in the else > > otherwise it will get added twice. > > > > The change I alluded to in the original email (to fix the pop-out frame > > completely) will get rid of the above if/else condition btw, so it is only > > temporary. > > Ok, that makes sense. There are a number of formatting concerns: * Whitespace changes and 8 space indenting as mentioned previously (makes this patch hard to ready). You can use diff -w to ignore whitespace changes. * Surely PAV_INIT_STATUS should be PavInitStatus? This isn't C. * A number of the lines are overly long. It's not clear how threading is working here. Is there some documentation in the class? I see some collections being locked but not others. > > Cheers, > > Deepak > > > > > Also there seems to be some odd whitespace changes and excessive (8 space) indenting. > > > > > > > diff -r 85db7b3a1c93 plugin/icedteanp/java/sun/applet/PluginAppletViewer.java > > > > --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Thu Oct 21 21:12:21 2010 +0100 > > > > +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Thu Oct 21 17:22:56 2010 -0700 > > > > @@ -136,12 +136,10 @@ > > > > } > > > > } > > > > }); > > > > + > > > > + // create the frame. > > > > + PluginAppletViewer.reFrame(null, identifier, System.out, 0, panel); > > > > > > > > - > > > > - > > > > - // create the frame. > > > > - PluginAppletViewer.reFrame(null, identifier, System.out, handle, panel); > > > > - > > > > panel.init(); > > > > > > > > // Start the applet > > > > @@ -179,15 +177,7 @@ > > > > > > > > // Wait for the panel to initialize > > > > // (happens in a separate thread) > > > > - while (panel.getApplet() == null && > > > > - ((NetxPanel) panel).isAlive()) { > > > > - try { > > > > - Thread.sleep(50); > > > > - PluginDebug.debug("Waiting for applet to initialize..."); > > > > - } catch (InterruptedException ie) { > > > > - // just wait > > > > - } > > > > - } > > > > + PluginAppletViewer.waitForAppletInit((NetxPanel) panel); > > > > > > > > a = panel.getApplet(); > > > > > > > > @@ -317,7 +307,17 @@ > > > > */ > > > > private static String defaultSaveFile = "Applet.ser"; > > > > > > > > - private static enum PAV_INIT_STATUS {PRE_INIT, IN_INIT, INIT_COMPLETE, INACTIVE}; > > > > + > > > > + /** > > > > + * Enumerates the current status of an applet > > > > + * > > > > + * PRE_INIT -> Parsing and initialization phase > > > > + * INIT_COMPLETE -> Initialization complete, reframe pending > > > > + * REFRAME_COMPLETE -> Reframe complete, applet is initialized and usable by the user > > > > + * INACTIVE -> Browser has directed that the applet be destroyed (this state is non-overridable except by DESTROYED) > > > > + * DESTROYED -> Applet has been destroyed > > > > + */ > > > > + private static enum PAV_INIT_STATUS {PRE_INIT, INIT_COMPLETE, REFRAME_COMPLETE, INACTIVE, DESTROYED}; > > > > > > > > /** > > > > * The panel in which the applet is being displayed. > > > > @@ -350,7 +350,6 @@ > > > > > > > > private static HashMap status = > > > > new HashMap(); > > > > - > > > > > > > > private long handle = 0; > > > > private WindowListener windowEventListener = null; > > > > @@ -380,16 +379,20 @@ > > > > return; > > > > > > > > PluginAppletViewer newFrame = new PluginAppletViewer(handle, identifier, statusMsgStream, panel); > > > > - > > > > + > > > > if (oldFrame != null) { > > > > applets.remove(oldFrame.identifier); > > > > oldFrame.removeWindowListener(oldFrame.windowEventListener); > > > > panel.removeAppletListener(oldFrame.appletEventListener); > > > > + > > > > + // Add first, remove later > > > > + newFrame.add("Center", panel); > > > > oldFrame.remove(panel); > > > > oldFrame.dispose(); > > > > + } else { > > > > + newFrame.add("Center", panel); > > > > } > > > > > > > > - newFrame.add("Center", panel); > > > > newFrame.pack(); > > > > > > > > newFrame.appletEventListener = new AppletEventListener(newFrame, newFrame); > > > > @@ -397,11 +400,6 @@ > > > > > > > > applets.put(identifier, newFrame); > > > > > > > > - // dispose oldframe if necessary > > > > - if (oldFrame != null) { > > > > - oldFrame.dispose(); > > > > - } > > > > - > > > > PluginDebug.debug(panel + " reframed"); > > > > } > > > > > > > > @@ -449,7 +447,7 @@ > > > > this.frame = frame; > > > > this.appletViewer = appletViewer; > > > > } > > > > - > > > > + > > > > public void appletStateChanged(AppletEvent evt) > > > > { > > > > AppletPanel src = (AppletPanel)evt.getSource(); > > > > @@ -483,9 +481,9 @@ > > > > AppletPanel.changeFrameAppContext(frame, SunToolkit.targetToAppContext(a)); > > > > else > > > > AppletPanel.changeFrameAppContext(frame, AppContext.getAppContext()); > > > > - > > > > - status.put(appletViewer.identifier, PAV_INIT_STATUS.INIT_COMPLETE); > > > > - > > > > + > > > > + updateStatus(appletViewer.identifier, PAV_INIT_STATUS.INIT_COMPLETE); > > > > + > > > > break; > > > > } > > > > } > > > > @@ -510,7 +508,13 @@ > > > > > > > > try { > > > > if (message.startsWith("handle")) { > > > > - > > > > + > > > > + // If there is a key for this status, it means it > > > > + // was either initialized before, or destroy has been > > > > + // processed. Stop moving further. > > > > + if (updateStatus(identifier, PAV_INIT_STATUS.PRE_INIT) != null) > > > > + return; > > > > + > > > > // Extract the information from the message > > > > String[] msgParts = new String[4]; > > > > for (int i=0; i < 3; i++) { > > > > @@ -519,32 +523,38 @@ > > > > msgParts[i] = message.substring(spaceLocation + 1, nextSpaceLocation); > > > > message = message.substring(nextSpaceLocation + 1); > > > > } > > > > - > > > > + > > > > long handle = Long.parseLong(msgParts[0]); > > > > String width = msgParts[1]; > > > > String height = msgParts[2]; > > > > - > > > > + > > > > int spaceLocation = message.indexOf(' ', "tag".length()+1); > > > > String documentBase = > > > > UrlUtil.decode(message.substring("tag".length() + 1, spaceLocation)); > > > > - String tag = message.substring(spaceLocation+1); > > > > + String tag = message.substring(spaceLocation+1); > > > > + > > > > + // Decode the tag > > > > + tag = tag.replace(">", ">"); > > > > + tag = tag.replace("<", "<"); > > > > + tag = tag.replace("&", "&"); > > > > + tag = tag.replace(" ", "\n"); > > > > + tag = tag.replace(" ", "\r"); > > > > + tag = tag.replace(""", "\""); > > > > > > > > PluginDebug.debug ("Handle = " + handle + "\n" + > > > > "Width = " + width + "\n" + > > > > "Height = " + height + "\n" + > > > > "DocumentBase = " + documentBase + "\n" + > > > > "Tag = " + tag); > > > > - > > > > - status.put(identifier, PAV_INIT_STATUS.PRE_INIT); > > > > + > > > > PluginAppletViewer.parse > > > > (identifier, handle, width, height, > > > > new StringReader(tag), > > > > new URL(documentBase)); > > > > - > > > > > > > > int maxWait = APPLET_TIMEOUT; // wait for applet to fully load > > > > int wait = 0; > > > > - while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && > > > > + while ( !applets.containsKey(identifier) && // Map is populated only by reFrame > > > > (wait < maxWait)) { > > > > > > > > try { > > > > @@ -555,9 +565,44 @@ > > > > } > > > > } > > > > > > > > - if (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE)) > > > > + // If wait exceeded maxWait, we timed out. Throw an exception > > > > + if (wait >= maxWait) > > > > throw new Exception("Applet initialization timeout"); > > > > > > > > + PluginAppletViewer oldFrame = applets.get(identifier); > > > > + > > > > + // We should not try to destroy an applet during > > > > + // initialization. It may cause an inconsistent state, > > > > + // which would bad if it's a trusted applet that > > > > + // read/writes to files > > > > + waitForAppletInit((NetxPanel) applets.get(identifier).panel); > > > > + > > > > + // Should we proceed with reframing? > > > > + if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { > > > > + destroyApplet(identifier); > > > > + return; > > > > + } > > > > + > > > > + // Proceed with re-framing > > > > + reFrame(oldFrame, identifier, System.out, handle, oldFrame.panel); > > > > + > > > > + // There is a slight chance that destroy can happen > > > > + // between the above and below line > > > > + if (updateStatus(identifier, PAV_INIT_STATUS.REFRAME_COMPLETE).equals(PAV_INIT_STATUS.INACTIVE)) { > > > > + destroyApplet(identifier); > > > > + } > > > > + > > > > + } else if (message.startsWith("destroy")) { > > > > + > > > > + // Set it inactive, and try to do cleanup is applicable > > > > + PAV_INIT_STATUS previousStatus = updateStatus(identifier, PAV_INIT_STATUS.INACTIVE); > > > > + PluginDebug.debug("Destroy status set for " + identifier); > > > > + > > > > + if (previousStatus != null && > > > > + previousStatus.equals(PAV_INIT_STATUS.REFRAME_COMPLETE)) { > > > > + destroyApplet(identifier); > > > > + } > > > > + > > > > } else { > > > > PluginDebug.debug ("Handling message: " + message + " instance " + identifier + " " + Thread.currentThread()); > > > > > > > > @@ -568,7 +613,7 @@ > > > > status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT) > > > > ) > > > > ); > > > > - > > > > + > > > > // don't bother processing further for inactive applets > > > > if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) > > > > return; > > > > @@ -580,31 +625,131 @@ > > > > e.printStackTrace(); > > > > > > > > // If an exception happened during pre-init, we need to update status > > > > - if (status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT)) > > > > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > > > > + updateStatus(identifier, PAV_INIT_STATUS.INACTIVE); > > > > > > > > throw new RuntimeException("Failed to handle message: " + > > > > message + " for instance " + identifier, e); > > > > } > > > > } > > > > - > > > > + > > > > + /** > > > > + * Sets the status unless an overriding status is set (e.g. if > > > > + * status is DESTROYED, it may not be overridden). > > > > + * > > > > + * @param identifier The identifier for which the status is to be set > > > > + * @param status The status to switch to > > > > + * @return The previous status > > > > + */ > > > > + private static synchronized PAV_INIT_STATUS updateStatus(int identifier, PAV_INIT_STATUS newStatus) { > > > > + > > > > + PAV_INIT_STATUS prev = status.get(identifier); > > > > + > > > > + // If the status is set > > > > + if (status.containsKey(identifier)) { > > > > + > > > > + // Nothing may override destroyed status > > > > + if (status.get(identifier).equals(PAV_INIT_STATUS.DESTROYED)) { > > > > + return prev; > > > > + } > > > > + > > > > + // If status is inactive, only DESTROYED may override it > > > > + if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { > > > > + if (!newStatus.equals(PAV_INIT_STATUS.DESTROYED)) { > > > > + return prev; > > > > + } > > > > + } > > > > + } > > > > + > > > > + // Else set to given status > > > > + status.put(identifier, newStatus); > > > > + > > > > + return prev; > > > > + } > > > > + > > > > + /** > > > > + * Destroys the given applet instance. > > > > + * > > > > + * This function may be called multiple times without problems. > > > > + * It does a synchronized check on the status and will only > > > > + * attempt to destroy the applet if not previously destroyed. > > > > + * > > > > + * @param identifier The instance which is to be destroyed > > > > + */ > > > > + > > > > + private static synchronized void destroyApplet(int identifier) { > > > > + > > > > + PluginDebug.debug("DestroyApplet called for " + identifier); > > > > + > > > > + PAV_INIT_STATUS prev = updateStatus(identifier, PAV_INIT_STATUS.DESTROYED); > > > > + > > > > + // If already destroyed, return > > > > + if (prev.equals(PAV_INIT_STATUS.DESTROYED)) { > > > > + PluginDebug.debug(identifier + " already destroyed. Returning."); > > > > + return; > > > > + } > > > > + > > > > + // If already disposed, return > > > > + if (applets.get(identifier).panel.applet == null) { > > > > + // Try to still dispose the panel itself -- no harm done with double dispose > > > > + applets.get(identifier).dispose(); > > > > + > > > > + PluginDebug.debug(identifier + " inactive. Returning."); > > > > + return; > > > > + } > > > > + > > > > + PluginDebug.debug("Attempting to destroy " + identifier); > > > > + > > > > + final int fIdentifier = identifier; > > > > + SwingUtilities.invokeLater(new Runnable() { > > > > + public void run() { > > > > + applets.get(fIdentifier).appletClose(); > > > > + } > > > > + }); > > > > + > > > > + PluginDebug.debug(identifier + " destroyed"); > > > > + } > > > > + > > > > + /** > > > > + * Function to block until applet initialization is complete > > > > + * > > > > + * @param identifier The instance to wait for > > > > + */ > > > > + public static void waitForAppletInit(NetxPanel panel) { > > > > + > > > > + int waitTime = 0; > > > > + > > > > + // Wait till initialization finishes > > > > + while (panel.getApplet() == null && > > > > + panel.isAlive() && > > > > + waitTime < APPLET_TIMEOUT) { > > > > + try { > > > > + if (waitTime%500 == 0) > > > > + PluginDebug.debug("Waiting for applet panel " + panel + " to initialize..."); > > > > + > > > > + Thread.sleep(waitTime += 50); > > > > + } catch (InterruptedException ie) { > > > > + // just wait > > > > + } > > > > + } > > > > + > > > > + PluginDebug.debug("Applet panel " + panel + " initialized"); > > > > + } > > > > + > > > > public void handleMessage(int reference, String message) > > > > { > > > > if (message.startsWith("width")) { > > > > > > > > // Wait for panel to come alive > > > > int maxWait = APPLET_TIMEOUT; // wait for panel to come alive > > > > - int wait = 0; > > > > + int wait = 0; > > > > while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && wait < maxWait) { > > > > - > > > > - try { > > > > - Thread.sleep(50); > > > > - wait += 50; > > > > - } catch (InterruptedException ie) { > > > > - // just wait > > > > - } > > > > - } > > > > - > > > > + try { > > > > + Thread.sleep(50); > > > > + wait += 50; > > > > + } catch (InterruptedException ie) { > > > > + // just wait > > > > + } > > > > + } > > > > > > > > // 0 => width, 1=> width_value, 2 => height, 3=> height_value > > > > String[] dimMsg = message.split(" "); > > > > @@ -636,7 +781,7 @@ > > > > > > > > panel.setSize(width, height); > > > > panel.validate(); > > > > - > > > > + > > > > panel.applet.resize(width, height); > > > > panel.applet.validate(); > > > > } > > > > @@ -649,9 +794,6 @@ > > > > e.printStackTrace(); > > > > } > > > > > > > > - } else if (message.startsWith("destroy")) { > > > > - dispose(); > > > > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > > > > } else if (message.startsWith("GetJavaObject")) { > > > > > > > > // FIXME: how do we determine what security context this > > > > @@ -672,15 +814,7 @@ > > > > > > > > // Wait for the panel to initialize > > > > // (happens in a separate thread) > > > > - while (panel.getApplet() == null && > > > > - ((NetxPanel) panel).isAlive()) { > > > > - try { > > > > - Thread.sleep(50); > > > > - PluginDebug.debug("Waiting for applet to initialize..."); > > > > - } catch (InterruptedException ie) { > > > > - // just wait > > > > - } > > > > - } > > > > + waitForAppletInit((NetxPanel) panel); > > > > > > > > PluginDebug.debug(panel + " -- " + panel.getApplet() + " -- " + ((NetxPanel) panel).isAlive()); > > > > > > > > @@ -1548,10 +1682,11 @@ > > > > if (countApplets() == 0) { > > > > appletSystemExit(); > > > > } > > > > + > > > > + updateStatus(identifier, PAV_INIT_STATUS.DESTROYED); > > > > } > > > > }).start(); > > > > > > > > - status.put(identifier, PAV_INIT_STATUS.INACTIVE); > > > > } > > > > > > > > /** > > > > @@ -1677,18 +1812,6 @@ > > > > val = buf.toString(); > > > > } > > > > > > > > - att = att.replace(">", ">"); > > > > - att = att.replace("<", "<"); > > > > - att = att.replace("&", "&"); > > > > - att = att.replace(" ", "\n"); > > > > - att = att.replace(" ", "\r"); > > > > - > > > > - val = val.replace(">", ">"); > > > > - val = val.replace("<", "<"); > > > > - val = val.replace("&", "&"); > > > > - val = val.replace(" ", "\n"); > > > > - val = val.replace(" ", "\r"); > > > > - > > > > PluginDebug.debug("PUT " + att + " = '" + val + "'"); > > > > atts.put(att.toLowerCase(java.util.Locale.ENGLISH), val); > > > > > > > > @@ -1708,7 +1831,6 @@ > > > > // private static final == inline > > > > private static final boolean isInt(Object o) { > > > > boolean isInt = false; > > > > - > > > > try { > > > > Integer.parseInt((String) o); > > > > isInt = true; > > > > @@ -1763,7 +1885,6 @@ > > > > } catch (IOException ioe) { > > > > return ioe; > > > > } > > > > - > > > > return null; > > > > } > > > > }; > > > > @@ -1785,6 +1906,7 @@ > > > > boolean isObjectTag = false; > > > > boolean isEmbedTag = false; > > > > boolean objectTagAlreadyParsed = false; > > > > + > > > > // The current character > > > > // FIXME: This is an evil hack to force pass-by-reference.. the > > > > // parsing code needs to be rewritten from scratch to prevent such > > > > @@ -1879,19 +2001,6 @@ > > > > if (val == null) { > > > > statusMsgStream.println(requiresNameWarning); > > > > } else if (atts != null) { > > > > - att = att.replace(">", ">"); > > > > - att = att.replace("<", "<"); > > > > - att = att.replace("&", "&"); > > > > - att = att.replace(" ", "\n"); > > > > - att = att.replace(" ", "\r"); > > > > - att = att.replace(""", "\""); > > > > - > > > > - val = val.replace(">", ">"); > > > > - val = val.replace("<", "<"); > > > > - val = val.replace("&", "&"); > > > > - val = val.replace(" ", "\n"); > > > > - val = val.replace(" ", "\r"); > > > > - val = val.replace(""", "\""); > > > > PluginDebug.debug("PUT " + att + " = " + val); > > > > atts.put(att.toLowerCase(), val); > > > > } else { > > > > @@ -1920,8 +2029,8 @@ > > > > > > > > if (atts.get("width") == null || !isInt(atts.get("width"))) { > > > > atts.put("width", width); > > > > - } > > > > - > > > > + } > > > > + > > > > if (atts.get("height") == null || !isInt(atts.get("height"))) { > > > > atts.put("height", height); > > > > } > > > > @@ -1974,7 +2083,7 @@ > > > > if (atts.get("width") == null || !isInt(atts.get("width"))) { > > > > atts.put("width", width); > > > > } > > > > - > > > > + > > > > if (atts.get("height") == null || !isInt(atts.get("height"))) { > > > > atts.put("height", height); > > > > } > > > > @@ -2023,10 +2132,11 @@ > > > > if (atts.get("width") == null || !isInt(atts.get("width"))) { > > > > atts.put("width", width); > > > > } > > > > - > > > > + > > > > if (atts.get("height") == null || !isInt(atts.get("height"))) { > > > > atts.put("height", height); > > > > } > > > > + > > > > } > > > > } > > > > } > > > > diff -r 85db7b3a1c93 plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java > > > > --- a/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java Thu Oct 21 21:12:21 2010 +0100 > > > > +++ b/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java Thu Oct 21 17:22:56 2010 -0700 > > > > @@ -126,6 +126,10 @@ > > > > } > > > > > > > > private String getPriorityStrIfPriority(String message) { > > > > + > > > > + // Destroy messages are permanently high priority > > > > + if (message.endsWith("destroy")) > > > > + return "destroy"; > > > > > > > > synchronized (priorityWaitQueue) { > > > > Iterator it = priorityWaitQueue.iterator(); > > > > @@ -150,7 +154,6 @@ > > > > } > > > > } > > > > > > > > - > > > > public void notifyWorkerIsFree(PluginMessageHandlerWorker worker) { > > > > synchronized (initWorkers) { > > > > Iterator i = initWorkers.keySet().iterator(); > > > > @@ -176,6 +179,32 @@ > > > > } > > > > > > > > protected class ConsumerThread extends Thread { > > > > + > > > > + /** > > > > + * Scans the readQueue for priority messages and brings them to the front > > > > + */ > > > > + private void bringPriorityMessagesToFront() { > > > > + synchronized (readQueue) { > > > > + > > > > + // iterate through the list > > > > + for (int i=0; i < readQueue.size(); i++) { > > > > + > > > > + // remove element at i to inspect it > > > > + String message = readQueue.remove(i); > > > > + > > > > + // if element at i is a priority msg, bring it forward > > > > + if (getPriorityStrIfPriority(message) != null) { > > > > + readQueue.addFirst(message); > > > > + } else { // else keep it where it was > > > > + readQueue.add(i, message); > > > > + } > > > > + > > > > + // by the end the queue size is the same, so the > > > > + // position indicator (i) is still valid > > > > + } > > > > + } > > > > + } > > > > + > > > > public void run() { > > > > > > > > while (true) { > > > > @@ -190,7 +219,6 @@ > > > > > > > > String[] msgParts = message.split(" "); > > > > > > > > - > > > > String priorityStr = getPriorityStrIfPriority(message); > > > > boolean isPriorityResponse = (priorityStr != null); > > > > > > > > @@ -199,9 +227,12 @@ > > > > > > > > if (worker == null) { > > > > synchronized(readQueue) { > > > > - readQueue.addLast(message); > > > > + readQueue.addFirst(message); > > > > } > > > > > > > > + // re-scan to see if any priority message came in > > > > + bringPriorityMessagesToFront(); > > > > + > > > > continue; // re-loop to try next msg > > > > } > > > > > > > > > > > > > -- > > > Andrew :) > > > > > > Free Java Software Engineer > > > Red Hat, Inc. (http://www.redhat.com) > > > > > > Support Free Java! > > > Contribute to GNU Classpath and the OpenJDK > > > http://www.gnu.org/software/classpath > > > http://openjdk.java.net > > > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > > > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From ahughes at redhat.com Tue Oct 26 15:58:33 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Tue, 26 Oct 2010 23:58:33 +0100 Subject: [icedtea-web] RFC: fix null dtd for swing applications rendering html In-Reply-To: <4CC740AB.3050700@redhat.com> References: <4CC72015.4050401@redhat.com> <20101026203227.GA3781@redhat.com> <4CC740AB.3050700@redhat.com> Message-ID: <20101026225833.GD31988@rivendell.middle-earth.co.uk> On 16:57 Tue 26 Oct , Omair Majid wrote: > Hi Deepak, > > Thanks for taking a look at this! > > On 10/26/2010 04:33 PM, Deepak Bhole wrote: > > * Omair Majid [2010-10-26 15:46]: > >> There has been a regression in netx: applications that render html > >> (using Swing components) now fail with a null pointer exception. > >> This problem can be reproduced by running the program at [1]. > >> > > > > What caused this regression? I thought all the app context stuff was > > still disabled, with just the support added on the side? > > > > The regression itself was caused by having security dialogs in one > AppContext and the actual application in another AppContext. > > The AppContext stuff is enabled and working (in fact, some of the > AppContext code was part of the original import of Netx into IcedTea and > has been active ever since - most of my recent patches are about > enabling it in the plugin case too and using AppContext correctly to > gain its benefits). It is what allows multiple applets to have their own > look and feels and allows security dialogs to always use the system look > and feel without setting the look and feel of applets (or jnlp > applications) too. I thought I had made it pretty explicit in my patches > and changelogs :( > > What is still disabled is allowing applets/applications to access their > individual EventQueues. This is because of a security patch that has > been recently been committed to OpenJDK7. This patch provides some > additional API and says (and I am paraphrasing): "here is some API that > allows the proprietary plugin to check if AWT events are generated by > the system". I dont know how to make use of it, so I havent added code > to allow applets to access their EventQueues. At least one application - > a swing demo, no less [1] - fails without this. > Do you have a link to this patch? We should probably backport it. > >> The problem is caused by how HTMLEditorKit/HTMLDocument and > >> ParserDelgator interact in the presence of multiple AppContexts. The > >> instance of the ParserDelegate is shared between multiple > >> HTMLEditorKit in different AppContexts. However, ParserDelegate > >> maintains a per-AppContext dtd instance. The dtd is valid in the > >> AppContext that created the ParserDelegate but null in all other > >> AppContexts. Using this null dtd throws a NullPointerException. This > >> is really a bug in OpenJDK6 rather than Netx. Fortunately, this bug > >> has been fixed in OpenJDK7 - ParserDelegate maintains an instance of > >> the dtd per runtime instead of per AppContext. > >> > >> The attached patch works around this bug. It manually creates a > >> ParserDelegate for each AppContext to avoid this problem. > >> > > > > Assuming you have tested this, OK for head. > > > > Thanks > Omair > > [1] http://download.oracle.com/javase/tutorial/ui/overview/demo.html -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From omajid at redhat.com Wed Oct 27 06:36:48 2010 From: omajid at redhat.com (Omair Majid) Date: Wed, 27 Oct 2010 09:36:48 -0400 Subject: [icedtea-web] RFC: fix null dtd for swing applications rendering html In-Reply-To: <20101026225833.GD31988@rivendell.middle-earth.co.uk> References: <4CC72015.4050401@redhat.com> <20101026203227.GA3781@redhat.com> <4CC740AB.3050700@redhat.com> <20101026225833.GD31988@rivendell.middle-earth.co.uk> Message-ID: <4CC82AF0.7010603@redhat.com> On 10/26/2010 06:58 PM, Dr Andrew John Hughes wrote: > On 16:57 Tue 26 Oct , Omair Majid wrote: >> Hi Deepak, >> >> Thanks for taking a look at this! >> >> On 10/26/2010 04:33 PM, Deepak Bhole wrote: >>> * Omair Majid [2010-10-26 15:46]: >>>> There has been a regression in netx: applications that render html >>>> (using Swing components) now fail with a null pointer exception. >>>> This problem can be reproduced by running the program at [1]. >>>> >>> >>> What caused this regression? I thought all the app context stuff was >>> still disabled, with just the support added on the side? >>> >> >> The regression itself was caused by having security dialogs in one >> AppContext and the actual application in another AppContext. >> >> The AppContext stuff is enabled and working (in fact, some of the >> AppContext code was part of the original import of Netx into IcedTea and >> has been active ever since - most of my recent patches are about >> enabling it in the plugin case too and using AppContext correctly to >> gain its benefits). It is what allows multiple applets to have their own >> look and feels and allows security dialogs to always use the system look >> and feel without setting the look and feel of applets (or jnlp >> applications) too. I thought I had made it pretty explicit in my patches >> and changelogs :( >> >> What is still disabled is allowing applets/applications to access their >> individual EventQueues. This is because of a security patch that has >> been recently been committed to OpenJDK7. This patch provides some >> additional API and says (and I am paraphrasing): "here is some API that >> allows the proprietary plugin to check if AWT events are generated by >> the system". I dont know how to make use of it, so I havent added code >> to allow applets to access their EventQueues. At least one application - >> a swing demo, no less [1] - fails without this. >> > > Do you have a link to this patch? We should probably backport it. > The changeset is at http://hg.openjdk.java.net/jdk7/awt/jdk/rev/8022709a306d. Unfortunately, aside from the patch itself, there is no other documentation about it and none of the bugs are public :( Thanks, Omair From omajid at redhat.com Wed Oct 27 06:44:22 2010 From: omajid at redhat.com (Omair Majid) Date: Wed, 27 Oct 2010 09:44:22 -0400 Subject: [icedtea-web] RFC: launch application that have a non-public main class In-Reply-To: <20101026214524.GE3781@redhat.com> References: <4CC7343E.9060705@redhat.com> <20101026214524.GE3781@redhat.com> Message-ID: <4CC82CB6.2090000@redhat.com> On 10/26/2010 05:45 PM, Deepak Bhole wrote: > * Omair Majid [2010-10-26 17:22]: >> Hi, >> >> The attached patch bypasses checks imposed by the reflection API to >> ensure that netx is allowed to access the class it is trying to >> access. Generally, this makes complete sense. However, there are >> some applications (such as the Present/Future Value Calculator [1]) >> that declare their main method in a non public class. Netx currently >> fails with an IllegalAccessException when it encounters this. >> > > Ugh. This shouldn't even be allowed :/ > Yeah, I have mixed feelings about this too. But the Oracle Java Web Start runs it, so we should too. > Anyway, we should follow the ri. Ok for HEAD. > Thanks for the review. Pushed. Cheers, Omair From omajid at redhat.com Wed Oct 27 06:53:55 2010 From: omajid at redhat.com (Omair Majid) Date: Wed, 27 Oct 2010 09:53:55 -0400 Subject: [icedtea-web] RFC: launch application that have a non-public main class In-Reply-To: <20101026222323.GA31988@rivendell.middle-earth.co.uk> References: <4CC7343E.9060705@redhat.com> <20101026222323.GA31988@rivendell.middle-earth.co.uk> Message-ID: <4CC82EF3.9080309@redhat.com> On 10/26/2010 06:23 PM, Dr Andrew John Hughes wrote: > On 16:04 Tue 26 Oct , Omair Majid wrote: >> Hi, >> >> The attached patch bypasses checks imposed by the reflection API to >> ensure that netx is allowed to access the class it is trying to access. >> Generally, this makes complete sense. However, there are some >> applications (such as the Present/Future Value Calculator [1]) that >> declare their main method in a non public class. Netx currently fails >> with an IllegalAccessException when it encounters this. >> >> ChangeLog >> 2010-10-26 Omair Majid >> >> * netx/net/sourceforge/jnlp/Launcher.java >> (launchApplication): Mark main method as accessible before invoking >> it. >> >> Thanks, >> Omair >> >> [1] http://www.arbores.ca/PresentFuture.jnlp > > Looks good to me. > Thanks for the review. I have pushed the change. Cheers, Omair From omajid at icedtea.classpath.org Wed Oct 27 09:57:02 2010 From: omajid at icedtea.classpath.org (omajid at icedtea.classpath.org) Date: Wed, 27 Oct 2010 16:57:02 +0000 Subject: /hg/icedtea-web: Add security checks for save and load in Deploy... Message-ID: changeset 92c589a2cf8f in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=92c589a2cf8f author: Omair Majid date: Wed Oct 27 12:55:00 2010 -0400 Add security checks for save and load in DeploymentConfiguration 2010-10-27 Omair Majid * netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java (load): Do a security check at start. A security exception later on may accidentally reveal a filename or a system property. (save): Likewise. diffstat: 2 files changed, 28 insertions(+), 3 deletions(-) ChangeLog | 7 ++ netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java | 24 ++++++++-- diffs (64 lines): diff -r 33f17695e034 -r 92c589a2cf8f ChangeLog --- a/ChangeLog Tue Oct 26 18:14:11 2010 -0400 +++ b/ChangeLog Wed Oct 27 12:55:00 2010 -0400 @@ -1,3 +1,10 @@ 2010-10-26 Omair Majid + + * netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java + (load): Do a security check at start. A security exception later on may + accidentally reveal a filename or a system property. + (save): Likewise. + 2010-10-26 Omair Majid * netx/net/sourceforge/jnlp/Launcher.java diff -r 33f17695e034 -r 92c589a2cf8f netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java --- a/netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java Tue Oct 26 18:14:11 2010 -0400 +++ b/netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java Wed Oct 27 12:55:00 2010 -0400 @@ -155,6 +155,15 @@ public final class DeploymentConfigurati * @throws DeploymentException if it encounters a fatal error. */ public void load() throws ConfigurationException { + // make sure no state leaks if security check fails later on + File userFile = new File(System.getProperty("user.home") + File.separator + ".netx" + + File.separator + DEPLOYMENT_PROPERTIES); + + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkRead(userFile.toString()); + } + Map initialProperties = loadDefaultProperties(); Map systemProperties = null; @@ -189,8 +198,7 @@ public final class DeploymentConfigurati /* * Third, read the user's deployment.properties file */ - userPropertiesFile = new File(System.getProperty("user.home") + File.separator + ".netx" - + File.separator + DEPLOYMENT_PROPERTIES); + userPropertiesFile = userFile; Map userProperties = loadProperties(ConfigType.User, userPropertiesFile, false); if (userProperties != null) { @@ -466,9 +474,19 @@ public final class DeploymentConfigurati /** * Saves all properties that are not part of default or system properties * - * @throws IOException + * @throws IOException if unable to save the file + * @throws IllegalStateException if save() is called before load() */ public void save() throws IOException { + if (userPropertiesFile == null) { + throw new IllegalStateException("must load() before save()"); + } + + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkWrite(userPropertiesFile.toString()); + } + if (JNLPRuntime.isDebug()) { System.out.println("Saving properties into " + userPropertiesFile.toString()); } From omajid at redhat.com Wed Oct 27 09:59:06 2010 From: omajid at redhat.com (Omair Majid) Date: Wed, 27 Oct 2010 12:59:06 -0400 Subject: [RFC] netx: add support for parsing and saving deployment.config files In-Reply-To: <20101026213757.GC3781@redhat.com> References: <4CBC6C17.6090602@redhat.com> <20101021210504.GE26975@redhat.com> <4CC0AFFB.9060601@redhat.com> <20101021213940.GG26975@redhat.com> <4CC58954.5040206@redhat.com> <20101026213757.GC3781@redhat.com> Message-ID: <4CC85A5A.6050404@redhat.com> On 10/26/2010 05:37 PM, Deepak Bhole wrote: > * Omair Majid [2010-10-25 09:42]: >> On 10/21/2010 05:39 PM, Deepak Bhole wrote: >>> * Omair Majid [2010-10-21 17:26]: >>>> On 10/21/2010 05:05 PM, Deepak Bhole wrote: >>>>> * Omair Majid [2010-10-18 11:48]: >>>>>> Hi, >>>>>> >>>>>> As described on [1], The Java Plug-in and Java Web Start support >>>>>> using various deployment.properties and deployment.config files to >>>>>> set behaviour of these tools. The patch adds support for parsing and >>>>>> saving these files to netx. This patch does not actually use any of >>>>>> these settings; it just adds support so other parts of netx can >>>>>> start using them. >>>>>> >>>>>> This was filed as a bug by someone against the original netx project [2]. >>>>>> >>>>>> Any comments or concerns? >>>>>> >>>>>> Thanks, >>>>>> Omair >>>>>> >>>>>> [1] http://download.oracle.com/javase/1.5.0/docs/guide/deployment/deployment-guide/properties.html >>>>>> [2] http://sourceforge.net/tracker/?func=detail&aid=2832947&group_id=72541&atid=534854 >>>>> >>>>> >>>>> >>>>>> + >>>>>> + /** >>>>>> + * Loads properties properties file, if one exists >>>>>> + * >>>>> >>>>> Minor typo above. >>>> >>>> Fixed. >>>> >>>>> >>>>>> + * @param type the ConfigType to load >>>>>> + * @param file the File to load Properties from >>>>> >>>>> >>>>> >>>>>> + /* exit if there is a fatal exception loading the configuration */ >>>>>> + if (isApplication) { >>>>>> + System.out.println(getMessage("RConfigurationError")); >>>>>> + System.exit(-1); >>>>> >>>>> >>>>> Is there a reason you chose negative exit code? NetX uses +1 everywhere >>>>> else. >>>>> >>>> >>>> Ah, I didnt see that netx uses 1. I have fixed it now. >>>> >>>> Thanks for reviewing the patch. Area there other issues I should fix? >>>> >>> >>> Nope, rest looks fine. Ok for commit to HEAD. >>> >> >> Thanks for the review Deepak. Here is a a slightly updated version >> that I plan to commit. I made a few minor tweaks to make this class >> easier to use. >> >> 1. The class is now final and public so it can be used by other >> packages not part of net.sourceforge.jnlp.runtime >> 2. I renamed the methods so they make more sense. "save" and "load" >> are now used for saving and loading the configuration respectively. >> 3. Security checks have been added for getProperty(), >> getPropertyNames() and setProperty(). >> > > save() should have an access check as well, as someone could call it and > then parse the exception error message to figure out user.home. A check > for file read access to the userPropertiesFile should be adequate. > > load() doesn't need to have it as there is no chain that ends up > outputting file names, but it would still be a good idea to add a check > there in case someone adds an output somewhere without realizing it. > > After above changes, ok for HEAD. > Thanks for the review. I accidentally pushed without these fixes; I have now pushed a new changeset to add these security checks. Cheers, Omair From aph at redhat.com Wed Oct 27 10:11:54 2010 From: aph at redhat.com (Andrew Haley) Date: Wed, 27 Oct 2010 18:11:54 +0100 Subject: Icedtea6 HEAD weirdness Message-ID: <4CC85D5A.5030906@redhat.com> Anyone else seeing this? make[4]: stat: /local/icedtea6/openjdk.build-ecj/hotspot/outputdir/linux_amd64_compiler2/product/libjvm.so: Too many levels of symbolic links make[4]: *** No rule to make target `/local/icedtea6/openjdk.build-ecj/hotspot/outputdir/linux_amd64_compiler2/product/libjvm.so', needed by `/local/icedtea6/openjdk.build-ecj/hotspot/import/jre/lib/amd64/server/libjvm.so'. Stop. make[4]: Leaving directory `/local/icedtea6/openjdk-ecj/hotspot/make' make[3]: *** [export_product] Error 2 make[3]: Leaving directory `/local/icedtea6/openjdk-ecj/hotspot/make' make[2]: *** [hotspot-build] Error 2 make[2]: Leaving directory `/local/icedtea6/openjdk-ecj' make[1]: *** [build_product_image] Error 2 make[1]: Leaving directory `/local/icedtea6/openjdk-ecj' make: *** [stamps/icedtea-ecj.stamp] Error 2 happy:icedtea6 $ ls -l /local/icedtea6/openjdk.build-ecj/hotspot/outputdir/linux_amd64_compiler2/product/libjvm.so lrwxrwxrwx. 1 aph aph 9 2010-10-27 18:04 /local/icedtea6/openjdk.build-ecj/hotspot/outputdir/linux_amd64_compiler2/product/libjvm.so -> libjvm.so Andrew. From omajid at redhat.com Wed Oct 27 12:14:11 2010 From: omajid at redhat.com (Omair Majid) Date: Wed, 27 Oct 2010 15:14:11 -0400 Subject: [icedtea-web] RFC: parse jnlps containing component-desc as well as application-desc elements Message-ID: <4CC87A03.2040004@redhat.com> Hi, Some JNLPs such as space weasel [1] contain a "component-desc" element along with an "application-desc" element. Netx current fails trying to run such an application. The parser error says that having multiple *-desc elements is not supported. In the case of "component-desc" this does not make much sense. "application-desc", "applet-desc" and "installer-desc" describe what should be done with this jnlp file; "component-desc" carries no such meaning, so it should be ok to have a "component-desc" along with "application-desc" in the same JNLP file. The attached patch fixes this. ChangeLog: 2010-10-27 Omair Majid * netx/net/sourceforge/jnlp/JNLPFile.java: Add component. (getLaunchInfo): Modify javadoc to indicate that it does not return the ComponentDesc. (getComponent): Return component instead of launchType. (isComponent): Check if component is not null. (parse): Find and set component. * netx/net/sourceforge/jnlp/Parser.java (getLauncher): Remove all checks for component-desc. Allow having none of application-desc, applet-desc and installer-desc. (getComponent): Check for more than one component-desc element. Read and parse the component-desc. Any thoughts or comments? Thanks, Omair [1] http://spaceweasel.googlecode.com/svn/wiki/weasel.jnlp -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-web-component-desc.patch Type: text/x-patch Size: 3644 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101027/6678e78c/icedtea-web-component-desc.patch From doko at ubuntu.com Wed Oct 27 12:42:45 2010 From: doko at ubuntu.com (Matthias Klose) Date: Wed, 27 Oct 2010 21:42:45 +0200 Subject: [ping] Re: [patch, icedtea-web] Don't include copies of jni.h and jni_md.h In-Reply-To: <4CBF6ED4.5070408@ubuntu.com> References: <4CBF6BE4.3030803@ubuntu.com> <4CBF6ED4.5070408@ubuntu.com> Message-ID: <4CC880B5.3070003@ubuntu.com> patch ping On 21.10.2010 00:36, Matthias Klose wrote: > On 21.10.2010 00:23, Matthias Klose wrote: >> These headers are included in every JDK_HOME, no need to carry local copies. > > on some systems, both I$(BOOT_DIR)/include and I$(BOOT_DIR)/include/linux may be > needed. From dbhole at icedtea.classpath.org Wed Oct 27 12:56:29 2010 From: dbhole at icedtea.classpath.org (dbhole at icedtea.classpath.org) Date: Wed, 27 Oct 2010 19:56:29 +0000 Subject: /hg/icedtea-web: Add support for handling spaces between jar nam... Message-ID: changeset 5566a5487109 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=5566a5487109 author: Deepak Bhole date: Wed Oct 27 15:55:55 2010 -0700 Add support for handling spaces between jar names in the archive tag, and other such issues by encoding the entire applet tag. diffstat: 2 files changed, 45 insertions(+), 37 deletions(-) ChangeLog | 5 ++ plugin/icedteanp/IcedTeaNPPlugin.cc | 77 ++++++++++++++++++----------------- diffs (120 lines): diff -r 92c589a2cf8f -r 5566a5487109 ChangeLog --- a/ChangeLog Wed Oct 27 12:55:00 2010 -0400 +++ b/ChangeLog Wed Oct 27 15:55:55 2010 -0700 @@ -1,3 +1,8 @@ 2010-10-27 Omair Majid + + * plugin/icedteanp/IcedTeaNPPlugin.cc (plugin_create_applet_tag): Escape + the entire applet tag, not just the params. + 2010-10-27 Omair Majid * netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java diff -r 92c589a2cf8f -r 5566a5487109 plugin/icedteanp/IcedTeaNPPlugin.cc --- a/plugin/icedteanp/IcedTeaNPPlugin.cc Wed Oct 27 12:55:00 2010 -0400 +++ b/plugin/icedteanp/IcedTeaNPPlugin.cc Wed Oct 27 15:55:55 2010 -0700 @@ -755,6 +755,7 @@ ITNP_SetWindow (NPP instance, NPWindow* } else { + // Else this is initialization PLUGIN_DEBUG ("ITNP_SetWindow: setting window.\n"); @@ -1693,57 +1694,59 @@ plugin_create_applet_tag (int16_t argc, } else { - // Escape the parameter value so that line termination - // characters will pass through the pipe. + if (argv[i] != '\0') { - // worst case scenario -> all characters are newlines or - // returns, each of which translates to 5 substitutions - char* escaped = (char*) calloc(((strlen(argv[i])*5)+1), sizeof(char)); - - strcpy(escaped, ""); - for (int j=0; j < strlen(argv[i]); j++) - { - if (argv[i][j] == '\r') - strcat(escaped, " "); - else if (argv[i][j] == '\n') - strcat(escaped, " "); - else if (argv[i][j] == '>') - strcat(escaped, ">"); - else if (argv[i][j] == '<') - strcat(escaped, "<"); - else if (argv[i][j] == '&') - strcat(escaped, "&"); - else - { - char* orig_char = (char*) calloc(2, sizeof(char)); - orig_char[0] = argv[i][j]; - orig_char[1] = '\0'; - - strcat(escaped, orig_char); - - free(orig_char); - orig_char = NULL; - } - } - parameters = g_strconcat (parameters, "", NULL); - - free (escaped); - escaped = NULL; + "\" VALUE=\"", argv[i], "\">", NULL); } } } applet_tag = g_strconcat (applet_tag, ">", parameters, "", NULL); + // Escape the parameter value so that line termination + // characters will pass through the pipe. + + // worst case scenario -> all characters are newlines or + // returns, each of which translates to 5 substitutions + char* applet_tag_escaped = (char*) calloc(((strlen(applet_tag)*5)+1), sizeof(char)); + + strcpy(applet_tag_escaped, ""); + for (int i=0; i < strlen(applet_tag); i++) + { + if (applet_tag[i] == '\r') + strcat(applet_tag_escaped, " "); + else if (applet_tag[i] == '\n') + strcat(applet_tag_escaped, " "); + else if (applet_tag[i] == '>') + strcat(applet_tag_escaped, ">"); + else if (applet_tag[i] == '<') + strcat(applet_tag_escaped, "<"); + else if (applet_tag[i] == '&') + strcat(applet_tag_escaped, "&"); + else + { + char* orig_char = (char*) calloc(2, sizeof(char)); + orig_char[0] = applet_tag[i]; + orig_char[1] = '\0'; + + strcat(applet_tag_escaped, orig_char); + + free(orig_char); + orig_char = NULL; + } + } + + free (applet_tag); + applet_tag = NULL; + g_free (parameters); parameters = NULL; PLUGIN_DEBUG ("plugin_create_applet_tag return\n"); - return applet_tag; + return applet_tag_escaped; } // plugin_send_message_to_appletviewer must be called while holding From liuqi at icedtea.classpath.org Thu Oct 28 01:21:51 2010 From: liuqi at icedtea.classpath.org (liuqi at icedtea.classpath.org) Date: Thu, 28 Oct 2010 08:21:51 +0000 Subject: /hg/openjdk6-mips: Fix 3 bugs related to the float remainder ope... Message-ID: changeset 85b046e5468b in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=85b046e5468b author: YANG Yongqiang date: Thu Oct 28 11:07:44 2010 +0800 Fix 3 bugs related to the float remainder operation. Fix three bugs related to float remainder operation, TwoOperandLIRForm and integer multiplication respectively: 1. In mips both single-precision and double-precision remainder operations need three registers except result, so they should be three-operand-operation. 2. We made a mistake which setting TwoOperandLIRForm to true. However, LIR mips used is not of TwoOperandLIRForm. 3. In operation, value of a source register must not be changed except that the source register is same as the result one. However, in function strength_reduce_multiply value of left source regiser is always changed. diffstat: 10 files changed, 186 insertions(+), 131 deletions(-) hotspot/src/cpu/mips/vm/assembler_mips.cpp | 29 +-- hotspot/src/cpu/mips/vm/assembler_mips.hpp | 4 hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp | 171 ++++++++++++---------- hotspot/src/cpu/mips/vm/c1_LIRGenerator_mips.cpp | 82 ++++++---- hotspot/src/cpu/mips/vm/c1_globals_mips.hpp | 2 hotspot/src/cpu/mips/vm/templateTable_mips.cpp | 4 hotspot/src/share/vm/c1/c1_LIR.cpp | 17 ++ hotspot/src/share/vm/c1/c1_LIR.hpp | 4 hotspot/src/share/vm/c1/c1_LIRAssembler.hpp | 3 hotspot/src/share/vm/c1/c1_Runtime1.cpp | 1 diffs (truncated from 530 to 500 lines): diff -r 88ad8d87be77 -r 85b046e5468b hotspot/src/cpu/mips/vm/assembler_mips.cpp --- a/hotspot/src/cpu/mips/vm/assembler_mips.cpp Tue Oct 26 20:09:04 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/assembler_mips.cpp Thu Oct 28 11:07:44 2010 +0800 @@ -2304,24 +2304,23 @@ void MacroAssembler::cmpxchg8(Register x } // be sure the three register is different -void MacroAssembler::rem_s(FloatRegister fd, FloatRegister fs, FloatRegister ft) { - assert_different_registers(fd, fs, ft); - div_s(fd, fs, ft); - trunc_l_s(fd, fd); - cvt_s_l(fd, fd); - mul_s(fd, fd, ft); - sub_s(fd, fs, fd); +void MacroAssembler::rem_s(FloatRegister fd, FloatRegister fs, FloatRegister ft, FloatRegister tmp) { + assert_different_registers(tmp, fs, ft); + div_s(tmp, fs, ft); + trunc_l_s(tmp, tmp); + cvt_s_l(tmp, tmp); + mul_s(tmp, tmp, ft); + sub_s(fd, fs, tmp); } // be sure the three register is different -void MacroAssembler::rem_d(FloatRegister fd, FloatRegister fs, FloatRegister ft) { - assert_different_registers(fd, fs, ft); - - div_d(fd, fs, ft); - trunc_l_d(fd, fd); - cvt_d_l(fd, fd); - mul_d(fd, fd, ft); - sub_d(fd, fs, fd); +void MacroAssembler::rem_d(FloatRegister fd, FloatRegister fs, FloatRegister ft, FloatRegister tmp) { + assert_different_registers(tmp, fs, ft); + div_d(tmp, fs, ft); + trunc_l_d(tmp, tmp); + cvt_d_l(tmp, tmp); + mul_d(tmp, tmp, ft); + sub_d(fd, fs, tmp); } class ControlWord { diff -r 88ad8d87be77 -r 85b046e5468b hotspot/src/cpu/mips/vm/assembler_mips.hpp --- a/hotspot/src/cpu/mips/vm/assembler_mips.hpp Tue Oct 26 20:09:04 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/assembler_mips.hpp Thu Oct 28 11:07:44 2010 +0800 @@ -1278,8 +1278,8 @@ static void restore_registers(MacroAssem // Sign extension void sign_extend_short(Register reg) { shl(reg, 16); sar(reg, 16); } void sign_extend_byte(Register reg) { shl(reg, 24); sar(reg, 24); } - void rem_s(FloatRegister fd, FloatRegister fs, FloatRegister ft); - void rem_d(FloatRegister fd, FloatRegister fs, FloatRegister ft); + void rem_s(FloatRegister fd, FloatRegister fs, FloatRegister ft, FloatRegister tmp); + void rem_d(FloatRegister fd, FloatRegister fs, FloatRegister ft, FloatRegister tmp); // Inlined sin/cos generator for Java; must not use CPU instruction // directly on Intel as it does not have high enough precision diff -r 88ad8d87be77 -r 85b046e5468b hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp --- a/hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp Tue Oct 26 20:09:04 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp Thu Oct 28 11:07:44 2010 +0800 @@ -1241,7 +1241,17 @@ Address::ScaleFactor LIR_Assembler::arra void LIR_Assembler::emit_op3(LIR_Op3* op) { - switch (op->code()) { + switch (op->code()) { + case lir_frem: + arithmetic_frem( + op->code(), + op->in_opr1(), + op->in_opr2(), + op->in_opr3(), + op->result_opr(), + op->info()); + break; + case lir_idiv: case lir_irem: arithmetic_idiv( @@ -2855,39 +2865,7 @@ void LIR_Assembler::arith_op(LIR_Code co __ bind(done); } break; -//FIXME, where is the new div and rem? -/* case lir_div_strictfp: - case lir_div: - __ call(Runtime1::entry_for(Runtime1::ldiv_stub_id), relocInfo::runtime_call_type); - __ delayed()->nop(); - add_call_info(code_offset(), info); - - if ( dst_lo != V0 ) { - __ move(dst_lo, V0); - } - - if ( dst_hi != V1) { - __ move(dst_hi, V1); - } - - break; -*/ - /* - case lir_rem: - __ call(Runtime1::entry_for(Runtime1::lrem_stub_id), relocInfo::runtime_call_type); - __ delayed()->nop(); - add_call_info(code_offset(), info); - - if ( dst_lo != V0 ) { - __ move(dst_lo, V0); - } - - if ( dst_hi != V1) { - __ move(dst_hi, V1); - } - - break; - */ + default: ShouldNotReachHere(); } @@ -2902,15 +2880,18 @@ void LIR_Assembler::arith_op(LIR_Code co case lir_add: __ addu(res, lreg, rreg); break; + case lir_mul: __ mult(lreg, rreg); __ nop(); __ nop(); __ mflo(res); break; + case lir_sub: __ subu(res, lreg, rreg); break; + default: ShouldNotReachHere(); } @@ -2976,9 +2957,9 @@ void LIR_Assembler::arith_op(LIR_Code co case lir_div_strictfp: __ div_s(res, lreg, rreg); break; - case lir_rem: - __ rem_s(res, lreg, rreg); - break; +// case lir_rem: +// __ rem_s(res, lreg, rreg); +// break; default : ShouldNotReachHere(); } } else if (left->is_double_fpu()) { @@ -3006,9 +2987,9 @@ void LIR_Assembler::arith_op(LIR_Code co case lir_div_strictfp: __ div_d(res, lreg, rreg); break; - case lir_rem: - __ rem_d(res, lreg, rreg); - break; +// case lir_rem: +// __ rem_d(res, lreg, rreg); +// break; default : ShouldNotReachHere(); } } @@ -3197,39 +3178,74 @@ void LIR_Assembler::logic_op(LIR_Code co // we assume that eax and edx can be overwritten void LIR_Assembler::arithmetic_idiv(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr temp, LIR_Opr result, CodeEmitInfo* info) { - assert(left->is_single_cpu(), "left must be register"); - assert(right->is_single_cpu() || right->is_constant(), "right must be register or constant"); - assert(result->is_single_cpu(), "result must be register"); - - Register lreg = left->as_register(); - Register dreg = result->as_register(); - - if (right->is_constant()) { - int divisor = right->as_constant_ptr()->as_jint(); - assert(divisor!=0, "must be nonzero"); - __ move(AT, divisor); - __ div(lreg, AT); - __ nop(); - __ nop(); - } else { - Register rreg = right->as_register(); - int idivl_offset = code_offset(); - __ div(lreg, rreg); - __ nop(); - __ nop(); - add_debug_info_for_div0(idivl_offset, info); - } - - // get the result - if (code == lir_irem) { - __ mfhi(dreg); - } else if (code == lir_idiv) { - __ mflo(dreg); - } else { - ShouldNotReachHere(); - } -} - + assert(left->is_single_cpu(), "left must be register"); + assert(right->is_single_cpu() || right->is_constant(), "right must be register or constant"); + assert(result->is_single_cpu(), "result must be register"); + + Register lreg = left->as_register(); + Register dreg = result->as_register(); + + if (right->is_constant()) { + int divisor = right->as_constant_ptr()->as_jint(); + assert(divisor!=0, "must be nonzero"); + __ move(AT, divisor); + __ div(lreg, AT); + __ nop(); + __ nop(); + } else { + Register rreg = right->as_register(); + int idivl_offset = code_offset(); + __ div(lreg, rreg); + __ nop(); + __ nop(); + add_debug_info_for_div0(idivl_offset, info); + } + + // get the result + if (code == lir_irem) { + __ mfhi(dreg); + } else if (code == lir_idiv) { + __ mflo(dreg); + } else { + ShouldNotReachHere(); + } +} + +void LIR_Assembler::arithmetic_frem(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr temp, LIR_Opr result, CodeEmitInfo* info) { + if (left->is_single_fpu()) { + assert(right->is_single_fpu(),"right must be float"); + assert(result->is_single_fpu(), "dest must be float"); + assert(temp->is_single_fpu(), "dest must be float"); + + FloatRegister lreg = left->as_float_reg(); + FloatRegister rreg = right->as_float_reg(); + FloatRegister res = result->as_float_reg(); + FloatRegister tmp = temp->as_float_reg(); + + switch (code) { + case lir_frem: + __ rem_s(res, lreg, rreg, tmp); + break; + default : ShouldNotReachHere(); + } + } else if (left->is_double_fpu()) { + assert(right->is_double_fpu(),"right must be double"); + assert(result->is_double_fpu(), "dest must be double"); + assert(temp->is_double_fpu(), "dest must be double"); + + FloatRegister lreg = left->as_double_reg(); + FloatRegister rreg = right->as_double_reg(); + FloatRegister res = result->as_double_reg(); + FloatRegister tmp = temp->as_double_reg(); + + switch (code) { + case lir_frem: + __ rem_d(res, lreg, rreg, tmp); + break; + default : ShouldNotReachHere(); + } + } +} void LIR_Assembler::comp_fl2i(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dst,LIR_Op2 * op) { Register dstreg = dst->as_register(); @@ -3662,7 +3678,6 @@ void LIR_Assembler::shift_op(LIR_Code co Register desthi = dest->as_register_hi(); assert_different_registers(destlo, valuehi, desthi); count = count & 0x3f; - switch (code) { case lir_shl: if (count==0) { @@ -3938,7 +3953,9 @@ void LIR_Assembler::emit_arraycopy(LIR_O __ push(length); - assert_different_registers(A0, A1, length); + assert(A0 != A1 && + A0 != length && + A1 != length, "register checks"); __ move(AT, dst_pos); if (shift_amount > 0 && basic_type != T_OBJECT) { __ sll(A2, length, shift_amount); @@ -3947,6 +3964,10 @@ void LIR_Assembler::emit_arraycopy(LIR_O __ move(A2, length); } __ move(A3, src_pos ); + assert(A0 != dst_pos && + A0 != dst && + dst_pos != dst, "register checks"); + assert_different_registers(A0, dst_pos, dst); __ sll(AT, AT, shift_amount); __ addi(AT, AT, arrayOopDesc::base_offset_in_bytes(basic_type)); diff -r 88ad8d87be77 -r 85b046e5468b hotspot/src/cpu/mips/vm/c1_LIRGenerator_mips.cpp --- a/hotspot/src/cpu/mips/vm/c1_LIRGenerator_mips.cpp Tue Oct 26 20:09:04 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/c1_LIRGenerator_mips.cpp Thu Oct 28 11:07:44 2010 +0800 @@ -299,14 +299,14 @@ bool LIRGenerator::strength_reduce_multi bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, int c, LIR_Opr result, LIR_Opr tmp) { if (tmp->is_valid()) { if (is_power_of_2(c + 1)) { - __ move(left, tmp); - __ shift_left(left, log2_intptr(c + 1), left); - __ sub(left, tmp, result); + __ move(left, result); + __ shift_left(result, log2_intptr(c + 1), result); + __ sub(result, left, result); return true; } else if (is_power_of_2(c - 1)) { - __ move(left, tmp); - __ shift_left(left, log2_intptr(c - 1), left); - __ add(left, tmp, result); + __ move(left, result); + __ shift_left(result, log2_intptr(c - 1), result); + __ add(result, left, result); return true; } } @@ -454,12 +454,24 @@ void LIRGenerator::do_NegateOp(NegateOp* // for _fadd, _fmul, _fsub, _fdiv, _frem // _dadd, _dmul, _dsub, _ddiv, _drem void LIRGenerator::do_ArithmeticOp_FPU(ArithmeticOp* x) { - LIRItem left(x->x(), this); - LIRItem right(x->y(), this); - left.load_item(); - right.load_item(); - rlock_result(x); - arithmetic_op_fpu(x->op(), x->operand(), left.result(), right.result(), x->is_strictfp()); + LIR_Opr tmp; + LIRItem left(x->x(), this); + LIRItem right(x->y(), this); + left.load_item(); + right.load_item(); + rlock_result(x); + switch (x->op()) { + case Bytecodes::_drem: + tmp = new_register(T_DOUBLE); + __ frem(left.result(), right.result(), x->operand(), tmp); + + break; + case Bytecodes::_frem: + tmp = new_register(T_FLOAT); + __ frem(left.result(), right.result(), x->operand(), tmp); + break; + default: arithmetic_op_fpu(x->op(), x->operand(), left.result(), right.result(), x->is_strictfp()); + } } @@ -540,30 +552,30 @@ void LIRGenerator::do_ArithmeticOp_Long( // for: _iadd, _imul, _isub, _idiv, _irem void LIRGenerator::do_ArithmeticOp_Int(ArithmeticOp* x) { - bool is_div_rem = x->op() == Bytecodes::_idiv || x->op() == Bytecodes::_irem; - LIRItem left(x->x(), this); - LIRItem right(x->y(), this); - // missing test if instr is commutative and if we should swap - right.load_nonconstant(); - assert(right.is_constant() || right.is_register(), "wrong state of right"); - left.load_item(); - rlock_result(x); - if (is_div_rem) { - CodeEmitInfo* info = state_for(x); - LIR_Opr tmp =new_register(T_INT); - if (x->op() == Bytecodes::_irem) { - __ irem(left.result(), right.result(), x->operand(), tmp, info); - } else if (x->op() == Bytecodes::_idiv) { - __ idiv(left.result(), right.result(), x->operand(), tmp, info); - } - } else { - //arithmetic_op_int(x->op(), x->operand(), left.result(), - //right.result(), FrameMap::G1_opr); + bool is_div_rem = x->op() == Bytecodes::_idiv || x->op() == Bytecodes::_irem; + LIRItem left(x->x(), this); + LIRItem right(x->y(), this); + // missing test if instr is commutative and if we should swap + right.load_nonconstant(); + assert(right.is_constant() || right.is_register(), "wrong state of right"); + left.load_item(); + rlock_result(x); + if (is_div_rem) { + CodeEmitInfo* info = state_for(x); + LIR_Opr tmp =new_register(T_INT); + if (x->op() == Bytecodes::_irem) { + __ irem(left.result(), right.result(), x->operand(), tmp, info); + } else if (x->op() == Bytecodes::_idiv) { + __ idiv(left.result(), right.result(), x->operand(), tmp, info); + } + } else { + //arithmetic_op_int(x->op(), x->operand(), left.result(), + //right.result(), FrameMap::G1_opr); - LIR_Opr tmp =new_register(T_INT); - arithmetic_op_int(x->op(), x->operand(), left.result(), right.result(), - tmp); - } + LIR_Opr tmp =new_register(T_INT); + arithmetic_op_int(x->op(), x->operand(), left.result(), right.result(), + tmp); + } } diff -r 88ad8d87be77 -r 85b046e5468b hotspot/src/cpu/mips/vm/c1_globals_mips.hpp --- a/hotspot/src/cpu/mips/vm/c1_globals_mips.hpp Tue Oct 26 20:09:04 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/c1_globals_mips.hpp Thu Oct 28 11:07:44 2010 +0800 @@ -69,7 +69,7 @@ define_pd_global(bool, LIRFillDelaySlots define_pd_global(bool, LIRFillDelaySlots, false); define_pd_global(bool, OptimizeSinglePrecision, true); define_pd_global(bool, CSEArrayLength, false); -define_pd_global(bool, TwoOperandLIRForm, true); +define_pd_global(bool, TwoOperandLIRForm, false); define_pd_global(intx, SafepointPollOffset, 256); diff -r 88ad8d87be77 -r 85b046e5468b hotspot/src/cpu/mips/vm/templateTable_mips.cpp --- a/hotspot/src/cpu/mips/vm/templateTable_mips.cpp Tue Oct 26 20:09:04 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/templateTable_mips.cpp Thu Oct 28 11:07:44 2010 +0800 @@ -1669,7 +1669,7 @@ void TemplateTable::fop2(Operation op) { __ mfc1(FSR, FSF); __ mtc1(FSR, F12); __ lwc1(FTF, at_sp()); - __ rem_s(FSF, FTF, F12); + __ rem_s(FSF, FTF, F12, FSF); break; default : ShouldNotReachHere(); } @@ -1710,7 +1710,7 @@ void TemplateTable::dop2(Operation op) { __ mtc1(SSR, F13); __ lwc1(FTF, at_sp()); __ lwc1(STF, at_sp_p1()); - __ rem_d(FSF, FTF, F12); + __ rem_d(FSF, FTF, F12, FSF); break; default : ShouldNotReachHere(); } diff -r 88ad8d87be77 -r 85b046e5468b hotspot/src/share/vm/c1/c1_LIR.cpp --- a/hotspot/src/share/vm/c1/c1_LIR.cpp Tue Oct 26 20:09:04 2010 +0800 +++ b/hotspot/src/share/vm/c1/c1_LIR.cpp Thu Oct 28 11:07:44 2010 +0800 @@ -735,6 +735,9 @@ void LIR_OpVisitState::visit(LIR_Op* op) // LIR_Op3 +#ifdef MIPS32 + case lir_frem: +#endif case lir_idiv: case lir_irem: { assert(op->as_Op3() != NULL, "must be"); @@ -1250,6 +1253,17 @@ void LIR_List::volatile_store_unsafe_reg } +#ifdef MIPS32 +void LIR_List::frem(LIR_Opr left, LIR_Opr right, LIR_Opr res, LIR_Opr tmp, CodeEmitInfo* info) { + append(new LIR_Op3( + lir_frem, + left, + right, + tmp, + res, + info)); +} +#endif void LIR_List::idiv(LIR_Opr left, LIR_Opr right, LIR_Opr res, LIR_Opr tmp, CodeEmitInfo* info) { append(new LIR_Op3( @@ -1773,6 +1787,9 @@ const char * LIR_Op::name() const { case lir_ushr: s = "ushift_right"; break; case lir_alloc_array: s = "alloc_array"; break; // LIR_Op3 +#ifdef MIPS32 + case lir_frem: s = "frem"; break; +#endif case lir_idiv: s = "idiv"; break; case lir_irem: s = "irem"; break; // LIR_OpJavaCall diff -r 88ad8d87be77 -r 85b046e5468b hotspot/src/share/vm/c1/c1_LIR.hpp --- a/hotspot/src/share/vm/c1/c1_LIR.hpp Tue Oct 26 20:09:04 2010 +0800 +++ b/hotspot/src/share/vm/c1/c1_LIR.hpp Thu Oct 28 11:07:44 2010 +0800 @@ -872,6 +872,7 @@ enum LIR_Code { , lir_compare_to , end_op2 , begin_op3 + , lir_frem , lir_idiv , lir_irem , end_op3 @@ -2138,6 +2139,9 @@ class LIR_List: public CompilationResour void volatile_store_mem_reg(LIR_Opr src, LIR_Address* address, CodeEmitInfo* info, LIR_PatchCode patch_code = lir_patch_none); void volatile_store_unsafe_reg(LIR_Opr src, LIR_Opr base, LIR_Opr offset, BasicType type, CodeEmitInfo* info, LIR_PatchCode patch_code); From gbenson at redhat.com Thu Oct 28 01:24:47 2010 From: gbenson at redhat.com (Gary Benson) Date: Thu, 28 Oct 2010 09:24:47 +0100 Subject: Icedtea6 HEAD weirdness In-Reply-To: <4CC85D5A.5030906@redhat.com> References: <4CC85D5A.5030906@redhat.com> Message-ID: <20101028082447.GB3427@redhat.com> Andrew Haley wrote: > Anyone else seeing this? > > make[4]: stat: /local/icedtea6/openjdk.build-ecj/hotspot/outputdir/linux_amd64_compiler2/product/libjvm.so: Too many levels of symbolic links > make[4]: *** No rule to make target `/local/icedtea6/openjdk.build-ecj/hotspot/outputdir/linux_amd64_compiler2/product/libjvm.so', needed by `/local/icedtea6/openjdk.build-ecj/hotspot/import/jre/lib/amd64/server/libjvm.so'. Stop. > make[4]: Leaving directory `/local/icedtea6/openjdk-ecj/hotspot/make' > make[3]: *** [export_product] Error 2 > make[3]: Leaving directory `/local/icedtea6/openjdk-ecj/hotspot/make' > make[2]: *** [hotspot-build] Error 2 > make[2]: Leaving directory `/local/icedtea6/openjdk-ecj' > make[1]: *** [build_product_image] Error 2 > make[1]: Leaving directory `/local/icedtea6/openjdk-ecj' > make: *** [stamps/icedtea-ecj.stamp] Error 2 > happy:icedtea6 $ ls -l /local/icedtea6/openjdk.build-ecj/hotspot/outputdir/linux_amd64_compiler2/product/libjvm.so > lrwxrwxrwx. 1 aph aph 9 2010-10-27 18:04 /local/icedtea6/openjdk.build-ecj/hotspot/outputdir/linux_amd64_compiler2/product/libjvm.so -> libjvm.so This error happens when you try to rebuild after a build failed linking libjvm.so. For some reason subsequent builds skip the broken bit. The only way I've found to get past this is to blow away the tree and rebuild so you can see what the original error was. Cheers, Gary -- http://gbenson.net/ From aph at redhat.com Thu Oct 28 01:53:50 2010 From: aph at redhat.com (Andrew Haley) Date: Thu, 28 Oct 2010 09:53:50 +0100 Subject: Icedtea6 HEAD weirdness In-Reply-To: <20101028082447.GB3427@redhat.com> References: <4CC85D5A.5030906@redhat.com> <20101028082447.GB3427@redhat.com> Message-ID: <4CC93A1E.8040905@redhat.com> On 10/28/2010 09:24 AM, Gary Benson wrote: > Andrew Haley wrote: >> Anyone else seeing this? >> >> make[4]: stat: /local/icedtea6/openjdk.build-ecj/hotspot/outputdir/linux_amd64_compiler2/product/libjvm.so: Too many levels of symbolic links >> make[4]: *** No rule to make target `/local/icedtea6/openjdk.build-ecj/hotspot/outputdir/linux_amd64_compiler2/product/libjvm.so', needed by `/local/icedtea6/openjdk.build-ecj/hotspot/import/jre/lib/amd64/server/libjvm.so'. Stop. >> make[4]: Leaving directory `/local/icedtea6/openjdk-ecj/hotspot/make' >> make[3]: *** [export_product] Error 2 >> make[3]: Leaving directory `/local/icedtea6/openjdk-ecj/hotspot/make' >> make[2]: *** [hotspot-build] Error 2 >> make[2]: Leaving directory `/local/icedtea6/openjdk-ecj' >> make[1]: *** [build_product_image] Error 2 >> make[1]: Leaving directory `/local/icedtea6/openjdk-ecj' >> make: *** [stamps/icedtea-ecj.stamp] Error 2 >> happy:icedtea6 $ ls -l /local/icedtea6/openjdk.build-ecj/hotspot/outputdir/linux_amd64_compiler2/product/libjvm.so >> lrwxrwxrwx. 1 aph aph 9 2010-10-27 18:04 /local/icedtea6/openjdk.build-ecj/hotspot/outputdir/linux_amd64_compiler2/product/libjvm.so -> libjvm.so > > This error happens when you try to rebuild after a build failed > linking libjvm.so. For some reason subsequent builds skip the > broken bit. The only way I've found to get past this is to blow > away the tree and rebuild so you can see what the original error > was. Ah, thanks. I think the problem may have been caused by an attempt to link statically with libstdc++. Andrew. From ahughes at redhat.com Thu Oct 28 06:07:36 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Thu, 28 Oct 2010 14:07:36 +0100 Subject: [ping] Re: [patch, icedtea-web] Don't include copies of jni.h and jni_md.h In-Reply-To: <4CC880B5.3070003@ubuntu.com> References: <4CBF6BE4.3030803@ubuntu.com> <4CBF6ED4.5070408@ubuntu.com> <4CC880B5.3070003@ubuntu.com> Message-ID: <20101028130736.GA10821@rivendell.middle-earth.co.uk> On 21:42 Wed 27 Oct , Matthias Klose wrote: > patch ping > > On 21.10.2010 00:36, Matthias Klose wrote: > > On 21.10.2010 00:23, Matthias Klose wrote: > >> These headers are included in every JDK_HOME, no need to carry local copies. > > > > on some systems, both I$(BOOT_DIR)/include and I$(BOOT_DIR)/include/linux may be > > needed. I've already replied to this. http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-October/010610.html It's approved with the listed change, assuming it has been sufficiently tested. -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From ahughes at redhat.com Thu Oct 28 06:38:07 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Thu, 28 Oct 2010 14:38:07 +0100 Subject: [icedtea-web] Why use a separate basedir for plugin? In-Reply-To: <4CC756C7.7060102@redhat.com> References: <4CC6E900.8050709@redhat.com> <20101026221801.GG3781@redhat.com> <4CC756C7.7060102@redhat.com> Message-ID: <20101028133807.GB10821@rivendell.middle-earth.co.uk> On 18:31 Tue 26 Oct , Omair Majid wrote: > On 10/26/2010 06:18 PM, Deepak Bhole wrote: > > * Omair Majid [2010-10-26 11:03]: > >> Hi, > >> > >> I noticed that the plugin uses a different basedir (see > >> JNLPRuntime.setBaseDir) from javaws. Is there a reason why? > >> > >> Since committing the deployment configuration patch, I have been > >> working on integrating it into icedtea-web (I believe that ~/.netxrc > >> is deprecated as of now). The deployment settings however, do not > >> distinguish between plugin and javaws - whether in terms of the > >> cache they use or which certificates are considered trusted. Hence I > >> would like to make them both use the same certificates and cache > >> (and possibly other things). Are there any reasons against doing > >> this? > >> > > > > Well, for one, they are 2 different things. We use the netx component > > for embedding, but the plugin is still separate in terms of > > functionality. > > > > Right, but there is no reason they should not use the same > proxy/cache/certificates, is there? Oracle JDK goes out of its ways to > make them appear behave the same (including reading/parsing the mozilla > configuration containing proxy settings in Java Web Start to get the > same set of proxies the plugin would - I have not personally confirmed > this, but the documentation says so). > > > How about putting everything in ~/.icedtea? > > > > Sure, makes sense to me. My only question was about issues in having the > plugin and netx share files. > I thought we'd already decided to do this? :-) > > Speaking of deployement configuration, perhaps we should use > > .java/deployement for that? If a user has previous deployment settings > > from the Oracle JDK, they shouldn't have to re-do it just for > > IcedTea/NetX. > > > > That's the first thing I thought of, but I see a few potential issues > with this. For one, the user can set values in this file which may cause > Netx to and Web Start to clash. For example the cache hierarchy is quite > different and one of them may overwrite/delete files the other creates. > For another, the user may set values which may make sense in one and not > another - for example setting a custom user.security.trusted.cacerts > (which netx does not support) and then not allowing any security prompts > for applications which appear untrusted. Such an application would work > under Java Web Start but fail under netx. > > I am sure these issues can be ironed out, but for now we shouldnt ignore it. > Unless this .java/deployment directory is openly specified, and that same specification adhered to by the proprietary plugin, I would steer well clear. If the plugin was open source, then I wouldn't be so wary. But then, we probably wouldn't even be writing our own then, would we? > Thanks, > Omair > > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From ahughes at redhat.com Thu Oct 28 06:42:28 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Thu, 28 Oct 2010 14:42:28 +0100 Subject: [icedtea-web] RFC: fix null dtd for swing applications rendering html In-Reply-To: <4CC82AF0.7010603@redhat.com> References: <4CC72015.4050401@redhat.com> <20101026203227.GA3781@redhat.com> <4CC740AB.3050700@redhat.com> <20101026225833.GD31988@rivendell.middle-earth.co.uk> <4CC82AF0.7010603@redhat.com> Message-ID: <20101028134228.GC10821@rivendell.middle-earth.co.uk> On 09:36 Wed 27 Oct , Omair Majid wrote: > On 10/26/2010 06:58 PM, Dr Andrew John Hughes wrote: > > On 16:57 Tue 26 Oct , Omair Majid wrote: > >> Hi Deepak, > >> > >> Thanks for taking a look at this! > >> > >> On 10/26/2010 04:33 PM, Deepak Bhole wrote: > >>> * Omair Majid [2010-10-26 15:46]: > >>>> There has been a regression in netx: applications that render html > >>>> (using Swing components) now fail with a null pointer exception. > >>>> This problem can be reproduced by running the program at [1]. > >>>> > >>> > >>> What caused this regression? I thought all the app context stuff was > >>> still disabled, with just the support added on the side? > >>> > >> > >> The regression itself was caused by having security dialogs in one > >> AppContext and the actual application in another AppContext. > >> > >> The AppContext stuff is enabled and working (in fact, some of the > >> AppContext code was part of the original import of Netx into IcedTea and > >> has been active ever since - most of my recent patches are about > >> enabling it in the plugin case too and using AppContext correctly to > >> gain its benefits). It is what allows multiple applets to have their own > >> look and feels and allows security dialogs to always use the system look > >> and feel without setting the look and feel of applets (or jnlp > >> applications) too. I thought I had made it pretty explicit in my patches > >> and changelogs :( > >> > >> What is still disabled is allowing applets/applications to access their > >> individual EventQueues. This is because of a security patch that has > >> been recently been committed to OpenJDK7. This patch provides some > >> additional API and says (and I am paraphrasing): "here is some API that > >> allows the proprietary plugin to check if AWT events are generated by > >> the system". I dont know how to make use of it, so I havent added code > >> to allow applets to access their EventQueues. At least one application - > >> a swing demo, no less [1] - fails without this. > >> > > > > Do you have a link to this patch? We should probably backport it. > > > > The changeset is at > http://hg.openjdk.java.net/jdk7/awt/jdk/rev/8022709a306d. Unfortunately, > aside from the patch itself, there is no other documentation about it > and none of the bugs are public :( > Nothing new there then... We can backport this to IcedTea. I think we should push for this to be made a public API if it's generally useful for the plugin, as otherwise we're relying on SunToolkit (again). > Thanks, > Omair -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From ahughes at redhat.com Thu Oct 28 06:44:43 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Thu, 28 Oct 2010 14:44:43 +0100 Subject: [icedtea-web] RFC: launch application that have a non-public main class In-Reply-To: <20101026214524.GE3781@redhat.com> References: <4CC7343E.9060705@redhat.com> <20101026214524.GE3781@redhat.com> Message-ID: <20101028134443.GD10821@rivendell.middle-earth.co.uk> On 17:45 Tue 26 Oct , Deepak Bhole wrote: > * Omair Majid [2010-10-26 17:22]: > > Hi, > > > > The attached patch bypasses checks imposed by the reflection API to > > ensure that netx is allowed to access the class it is trying to > > access. Generally, this makes complete sense. However, there are > > some applications (such as the Present/Future Value Calculator [1]) > > that declare their main method in a non public class. Netx currently > > fails with an IllegalAccessException when it encounters this. > > > > Ugh. This shouldn't even be allowed :/ > > Anyway, we should follow the ri. Ok for HEAD. > Welcome to the wonderful world of undocumented behaviour :-) > Deepak > > > ChangeLog > > 2010-10-26 Omair Majid > > > > * netx/net/sourceforge/jnlp/Launcher.java > > (launchApplication): Mark main method as accessible before invoking > > it. > > > > Thanks, > > Omair > > > > [1] http://www.arbores.ca/PresentFuture.jnlp > > > diff -r b1b876d99849 netx/net/sourceforge/jnlp/Launcher.java > > --- a/netx/net/sourceforge/jnlp/Launcher.java Mon Oct 25 17:16:13 2010 -0400 > > +++ b/netx/net/sourceforge/jnlp/Launcher.java Tue Oct 26 15:46:09 2010 -0400 > > @@ -474,6 +475,7 @@ > > splashScreen.dispose(); > > } > > > > + main.setAccessible(true); > > main.invoke(null, new Object[] { args } ); > > > > return app; > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From ahughes at redhat.com Thu Oct 28 06:56:09 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Thu, 28 Oct 2010 14:56:09 +0100 Subject: Icedtea6 HEAD weirdness In-Reply-To: <4CC93A1E.8040905@redhat.com> References: <4CC85D5A.5030906@redhat.com> <20101028082447.GB3427@redhat.com> <4CC93A1E.8040905@redhat.com> Message-ID: <20101028135609.GE10821@rivendell.middle-earth.co.uk> On 09:53 Thu 28 Oct , Andrew Haley wrote: > On 10/28/2010 09:24 AM, Gary Benson wrote: > > Andrew Haley wrote: > >> Anyone else seeing this? > >> > >> make[4]: stat: /local/icedtea6/openjdk.build-ecj/hotspot/outputdir/linux_amd64_compiler2/product/libjvm.so: Too many levels of symbolic links > >> make[4]: *** No rule to make target `/local/icedtea6/openjdk.build-ecj/hotspot/outputdir/linux_amd64_compiler2/product/libjvm.so', needed by `/local/icedtea6/openjdk.build-ecj/hotspot/import/jre/lib/amd64/server/libjvm.so'. Stop. > >> make[4]: Leaving directory `/local/icedtea6/openjdk-ecj/hotspot/make' > >> make[3]: *** [export_product] Error 2 > >> make[3]: Leaving directory `/local/icedtea6/openjdk-ecj/hotspot/make' > >> make[2]: *** [hotspot-build] Error 2 > >> make[2]: Leaving directory `/local/icedtea6/openjdk-ecj' > >> make[1]: *** [build_product_image] Error 2 > >> make[1]: Leaving directory `/local/icedtea6/openjdk-ecj' > >> make: *** [stamps/icedtea-ecj.stamp] Error 2 > >> happy:icedtea6 $ ls -l /local/icedtea6/openjdk.build-ecj/hotspot/outputdir/linux_amd64_compiler2/product/libjvm.so > >> lrwxrwxrwx. 1 aph aph 9 2010-10-27 18:04 /local/icedtea6/openjdk.build-ecj/hotspot/outputdir/linux_amd64_compiler2/product/libjvm.so -> libjvm.so > > > > This error happens when you try to rebuild after a build failed > > linking libjvm.so. For some reason subsequent builds skip the > > broken bit. The only way I've found to get past this is to blow > > away the tree and rebuild so you can see what the original error > > was. > > Ah, thanks. I think the problem may have been caused by an attempt to > link statically with libstdc++. > > Andrew. As mentioned before, the OpenJDK build system is not great at handling successive builds. In such situations, you can do make clean-icedtea-ecj; make (or just delete openjdk.build-ecj from your build directory which is what the clean target does) -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From omajid at redhat.com Thu Oct 28 07:02:56 2010 From: omajid at redhat.com (Omair Majid) Date: Thu, 28 Oct 2010 10:02:56 -0400 Subject: [icedtea-web] Why use a separate basedir for plugin? In-Reply-To: <20101028133807.GB10821@rivendell.middle-earth.co.uk> References: <4CC6E900.8050709@redhat.com> <20101026221801.GG3781@redhat.com> <4CC756C7.7060102@redhat.com> <20101028133807.GB10821@rivendell.middle-earth.co.uk> Message-ID: <4CC98290.2010503@redhat.com> On 10/28/2010 09:38 AM, Dr Andrew John Hughes wrote: > On 18:31 Tue 26 Oct , Omair Majid wrote: >> On 10/26/2010 06:18 PM, Deepak Bhole wrote: >>> * Omair Majid [2010-10-26 11:03]: >>>> Hi, >>>> >>>> I noticed that the plugin uses a different basedir (see >>>> JNLPRuntime.setBaseDir) from javaws. Is there a reason why? >>>> >>>> Since committing the deployment configuration patch, I have been >>>> working on integrating it into icedtea-web (I believe that ~/.netxrc >>>> is deprecated as of now). The deployment settings however, do not >>>> distinguish between plugin and javaws - whether in terms of the >>>> cache they use or which certificates are considered trusted. Hence I >>>> would like to make them both use the same certificates and cache >>>> (and possibly other things). Are there any reasons against doing >>>> this? >>>> >>> >>> Well, for one, they are 2 different things. We use the netx component >>> for embedding, but the plugin is still separate in terms of >>> functionality. >>> >> >> Right, but there is no reason they should not use the same >> proxy/cache/certificates, is there? Oracle JDK goes out of its ways to >> make them appear behave the same (including reading/parsing the mozilla >> configuration containing proxy settings in Java Web Start to get the >> same set of proxies the plugin would - I have not personally confirmed >> this, but the documentation says so). >> >>> How about putting everything in ~/.icedtea? >>> >> >> Sure, makes sense to me. My only question was about issues in having the >> plugin and netx share files. >> > > I thought we'd already decided to do this? :-) > Really? I was not aware of that. As far as I know the plugin keeps its files under ~/.icedteaplugin/ and netx keeps its files under ~/.netx/ and we never decided to unify it. >>> Speaking of deployement configuration, perhaps we should use >>> .java/deployement for that? If a user has previous deployment settings >>> from the Oracle JDK, they shouldn't have to re-do it just for >>> IcedTea/NetX. >>> >> >> That's the first thing I thought of, but I see a few potential issues >> with this. For one, the user can set values in this file which may cause >> Netx to and Web Start to clash. For example the cache hierarchy is quite >> different and one of them may overwrite/delete files the other creates. >> For another, the user may set values which may make sense in one and not >> another - for example setting a custom user.security.trusted.cacerts >> (which netx does not support) and then not allowing any security prompts >> for applications which appear untrusted. Such an application would work >> under Java Web Start but fail under netx. >> >> I am sure these issues can be ironed out, but for now we shouldnt ignore it. >> > > Unless this .java/deployment directory is openly specified, and that same specification > adhered to by the proprietary plugin, I would steer well clear. > The only "specification" related to the ~/.java/deployment directory that I can find is that it contains the deployment.properties file :/ > If the plugin was open source, then I wouldn't be so wary. But then, we probably wouldn't > even be writing our own then, would we? > Heh. Good point. Thanks, Omair From omajid at redhat.com Thu Oct 28 07:12:27 2010 From: omajid at redhat.com (Omair Majid) Date: Thu, 28 Oct 2010 10:12:27 -0400 Subject: [icedtea-web] RFC: fix null dtd for swing applications rendering html In-Reply-To: <20101028134228.GC10821@rivendell.middle-earth.co.uk> References: <4CC72015.4050401@redhat.com> <20101026203227.GA3781@redhat.com> <4CC740AB.3050700@redhat.com> <20101026225833.GD31988@rivendell.middle-earth.co.uk> <4CC82AF0.7010603@redhat.com> <20101028134228.GC10821@rivendell.middle-earth.co.uk> Message-ID: <4CC984CB.9070702@redhat.com> On 10/28/2010 09:42 AM, Dr Andrew John Hughes wrote: > On 09:36 Wed 27 Oct , Omair Majid wrote: >> On 10/26/2010 06:58 PM, Dr Andrew John Hughes wrote: >>> On 16:57 Tue 26 Oct , Omair Majid wrote: >>>> Hi Deepak, >>>> >>>> Thanks for taking a look at this! >>>> >>>> On 10/26/2010 04:33 PM, Deepak Bhole wrote: >>>>> * Omair Majid [2010-10-26 15:46]: >>>>>> There has been a regression in netx: applications that render html >>>>>> (using Swing components) now fail with a null pointer exception. >>>>>> This problem can be reproduced by running the program at [1]. >>>>>> >>>>> >>>>> What caused this regression? I thought all the app context stuff was >>>>> still disabled, with just the support added on the side? >>>>> >>>> >>>> The regression itself was caused by having security dialogs in one >>>> AppContext and the actual application in another AppContext. >>>> >>>> The AppContext stuff is enabled and working (in fact, some of the >>>> AppContext code was part of the original import of Netx into IcedTea and >>>> has been active ever since - most of my recent patches are about >>>> enabling it in the plugin case too and using AppContext correctly to >>>> gain its benefits). It is what allows multiple applets to have their own >>>> look and feels and allows security dialogs to always use the system look >>>> and feel without setting the look and feel of applets (or jnlp >>>> applications) too. I thought I had made it pretty explicit in my patches >>>> and changelogs :( >>>> >>>> What is still disabled is allowing applets/applications to access their >>>> individual EventQueues. This is because of a security patch that has >>>> been recently been committed to OpenJDK7. This patch provides some >>>> additional API and says (and I am paraphrasing): "here is some API that >>>> allows the proprietary plugin to check if AWT events are generated by >>>> the system". I dont know how to make use of it, so I havent added code >>>> to allow applets to access their EventQueues. At least one application - >>>> a swing demo, no less [1] - fails without this. >>>> >>> >>> Do you have a link to this patch? We should probably backport it. >>> >> >> The changeset is at >> http://hg.openjdk.java.net/jdk7/awt/jdk/rev/8022709a306d. Unfortunately, >> aside from the patch itself, there is no other documentation about it >> and none of the bugs are public :( >> > > Nothing new there then... > > We can backport this to IcedTea. I think we should push for this to be made > a public API if it's generally useful for the plugin, as otherwise we're relying > on SunToolkit (again). > Yup, I was going to backport this to icedtea6 as soon as I figured out how to use it. As for making it public, even the original developers agree: "this information could be useful to more clients and probably should be formalized in the public API" (second hunk in SunToolkit.java). I am not sure on how the process for making an API public works, but if it is possible we should be looking at making a few more APIs public too. Cheers, Omair From ahughes at redhat.com Thu Oct 28 09:11:41 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Thu, 28 Oct 2010 17:11:41 +0100 Subject: [icedtea-web] Why use a separate basedir for plugin? In-Reply-To: <4CC98290.2010503@redhat.com> References: <4CC6E900.8050709@redhat.com> <20101026221801.GG3781@redhat.com> <4CC756C7.7060102@redhat.com> <20101028133807.GB10821@rivendell.middle-earth.co.uk> <4CC98290.2010503@redhat.com> Message-ID: <20101028161141.GL10821@rivendell.middle-earth.co.uk> On 10:02 Thu 28 Oct , Omair Majid wrote: > On 10/28/2010 09:38 AM, Dr Andrew John Hughes wrote: > > On 18:31 Tue 26 Oct , Omair Majid wrote: > >> On 10/26/2010 06:18 PM, Deepak Bhole wrote: > >>> * Omair Majid [2010-10-26 11:03]: > >>>> Hi, > >>>> > >>>> I noticed that the plugin uses a different basedir (see > >>>> JNLPRuntime.setBaseDir) from javaws. Is there a reason why? > >>>> > >>>> Since committing the deployment configuration patch, I have been > >>>> working on integrating it into icedtea-web (I believe that ~/.netxrc > >>>> is deprecated as of now). The deployment settings however, do not > >>>> distinguish between plugin and javaws - whether in terms of the > >>>> cache they use or which certificates are considered trusted. Hence I > >>>> would like to make them both use the same certificates and cache > >>>> (and possibly other things). Are there any reasons against doing > >>>> this? > >>>> > >>> > >>> Well, for one, they are 2 different things. We use the netx component > >>> for embedding, but the plugin is still separate in terms of > >>> functionality. > >>> > >> > >> Right, but there is no reason they should not use the same > >> proxy/cache/certificates, is there? Oracle JDK goes out of its ways to > >> make them appear behave the same (including reading/parsing the mozilla > >> configuration containing proxy settings in Java Web Start to get the > >> same set of proxies the plugin would - I have not personally confirmed > >> this, but the documentation says so). > >> > >>> How about putting everything in ~/.icedtea? > >>> > >> > >> Sure, makes sense to me. My only question was about issues in having the > >> plugin and netx share files. > >> > > > > I thought we'd already decided to do this? :-) > > > > Really? I was not aware of that. As far as I know the plugin keeps its > files under ~/.icedteaplugin/ and netx keeps its files under ~/.netx/ > and we never decided to unify it. > I can't seem to find the particular mail, but it was something to do with a patch introducing the ~/.netx tree IIRC. > >>> Speaking of deployement configuration, perhaps we should use > >>> .java/deployement for that? If a user has previous deployment settings > >>> from the Oracle JDK, they shouldn't have to re-do it just for > >>> IcedTea/NetX. > >>> > >> > >> That's the first thing I thought of, but I see a few potential issues > >> with this. For one, the user can set values in this file which may cause > >> Netx to and Web Start to clash. For example the cache hierarchy is quite > >> different and one of them may overwrite/delete files the other creates. > >> For another, the user may set values which may make sense in one and not > >> another - for example setting a custom user.security.trusted.cacerts > >> (which netx does not support) and then not allowing any security prompts > >> for applications which appear untrusted. Such an application would work > >> under Java Web Start but fail under netx. > >> > >> I am sure these issues can be ironed out, but for now we shouldnt ignore it. > >> > > > > Unless this .java/deployment directory is openly specified, and that same specification > > adhered to by the proprietary plugin, I would steer well clear. > > > > The only "specification" related to the ~/.java/deployment directory > that I can find is that it contains the deployment.properties file :/ > So steer well clear. > > If the plugin was open source, then I wouldn't be so wary. But then, we probably wouldn't > > even be writing our own then, would we? > > > > Heh. Good point. > > Thanks, > Omair -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From ahughes at redhat.com Thu Oct 28 09:12:56 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Thu, 28 Oct 2010 17:12:56 +0100 Subject: [icedtea-web] RFC: fix null dtd for swing applications rendering html In-Reply-To: <4CC984CB.9070702@redhat.com> References: <4CC72015.4050401@redhat.com> <20101026203227.GA3781@redhat.com> <4CC740AB.3050700@redhat.com> <20101026225833.GD31988@rivendell.middle-earth.co.uk> <4CC82AF0.7010603@redhat.com> <20101028134228.GC10821@rivendell.middle-earth.co.uk> <4CC984CB.9070702@redhat.com> Message-ID: <20101028161256.GM10821@rivendell.middle-earth.co.uk> On 10:12 Thu 28 Oct , Omair Majid wrote: > On 10/28/2010 09:42 AM, Dr Andrew John Hughes wrote: > > On 09:36 Wed 27 Oct , Omair Majid wrote: > >> On 10/26/2010 06:58 PM, Dr Andrew John Hughes wrote: > >>> On 16:57 Tue 26 Oct , Omair Majid wrote: > >>>> Hi Deepak, > >>>> > >>>> Thanks for taking a look at this! > >>>> > >>>> On 10/26/2010 04:33 PM, Deepak Bhole wrote: > >>>>> * Omair Majid [2010-10-26 15:46]: > >>>>>> There has been a regression in netx: applications that render html > >>>>>> (using Swing components) now fail with a null pointer exception. > >>>>>> This problem can be reproduced by running the program at [1]. > >>>>>> > >>>>> > >>>>> What caused this regression? I thought all the app context stuff was > >>>>> still disabled, with just the support added on the side? > >>>>> > >>>> > >>>> The regression itself was caused by having security dialogs in one > >>>> AppContext and the actual application in another AppContext. > >>>> > >>>> The AppContext stuff is enabled and working (in fact, some of the > >>>> AppContext code was part of the original import of Netx into IcedTea and > >>>> has been active ever since - most of my recent patches are about > >>>> enabling it in the plugin case too and using AppContext correctly to > >>>> gain its benefits). It is what allows multiple applets to have their own > >>>> look and feels and allows security dialogs to always use the system look > >>>> and feel without setting the look and feel of applets (or jnlp > >>>> applications) too. I thought I had made it pretty explicit in my patches > >>>> and changelogs :( > >>>> > >>>> What is still disabled is allowing applets/applications to access their > >>>> individual EventQueues. This is because of a security patch that has > >>>> been recently been committed to OpenJDK7. This patch provides some > >>>> additional API and says (and I am paraphrasing): "here is some API that > >>>> allows the proprietary plugin to check if AWT events are generated by > >>>> the system". I dont know how to make use of it, so I havent added code > >>>> to allow applets to access their EventQueues. At least one application - > >>>> a swing demo, no less [1] - fails without this. > >>>> > >>> > >>> Do you have a link to this patch? We should probably backport it. > >>> > >> > >> The changeset is at > >> http://hg.openjdk.java.net/jdk7/awt/jdk/rev/8022709a306d. Unfortunately, > >> aside from the patch itself, there is no other documentation about it > >> and none of the bugs are public :( > >> > > > > Nothing new there then... > > > > We can backport this to IcedTea. I think we should push for this to be made > > a public API if it's generally useful for the plugin, as otherwise we're relying > > on SunToolkit (again). > > > > Yup, I was going to backport this to icedtea6 as soon as I figured out > how to use it. > > As for making it public, even the original developers agree: "this > information could be useful to more clients and probably should be > formalized in the public API" (second hunk in SunToolkit.java). I am not > sure on how the process for making an API public works, but if it is > possible we should be looking at making a few more APIs public too. > We bug them on awt-dev to do it. It can't happen in 6 but could still go in 7 AIUI. If we can show that it would be useful to us as well, that would give them a reason to add it. > Cheers, > Omair -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From omajid at redhat.com Thu Oct 28 11:04:05 2010 From: omajid at redhat.com (Omair Majid) Date: Thu, 28 Oct 2010 14:04:05 -0400 Subject: [icedtea-web] RFC: regression in certificate information dialogs Message-ID: <4CC9BB15.4090902@redhat.com> Hi, There has been a regression in netx which causes some some dialogs (those showing information about certificates) to be disposed immediately after they shown. The attached patch makes these dialogs modal again so they are not disposed instantly. ChangeLog 2010-10-28 Omair Majid * netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java (showMoreInfoDialog): Make dialog modal. (showCertInfoDialog): Likewise. (showSingleCertInfoDialog): Likewise. (initDialog): Use setModality instead of setModal. Any thoughts or comments? Thanks, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-web-show-moreinfo-dialogs.patch Type: text/x-patch Size: 1708 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101028/dd99f369/icedtea-web-show-moreinfo-dialogs.patch From dbhole at redhat.com Thu Oct 28 11:14:50 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Thu, 28 Oct 2010 14:14:50 -0400 Subject: [icedtea-web] RFC: regression in certificate information dialogs In-Reply-To: <4CC9BB15.4090902@redhat.com> References: <4CC9BB15.4090902@redhat.com> Message-ID: <20101028181450.GB23720@redhat.com> * Omair Majid [2010-10-28 14:10]: > Hi, > > There has been a regression in netx which causes some some dialogs > (those showing information about certificates) to be disposed > immediately after they shown. The attached patch makes these dialogs > modal again so they are not disposed instantly. > What introduced this regression? This is a pretty bad regression :/ We need a better way to test and assess commit feasibility. OK for HEAD. Deepak > ChangeLog > 2010-10-28 Omair Majid > > * netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java > (showMoreInfoDialog): Make dialog modal. > (showCertInfoDialog): Likewise. > (showSingleCertInfoDialog): Likewise. > (initDialog): Use setModality instead of setModal. > > Any thoughts or comments? > > Thanks, > Omair > diff -r 5566a5487109 netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java > --- a/netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java Wed Oct 27 15:55:55 2010 -0700 > +++ b/netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java Thu Oct 28 13:29:37 2010 -0400 > @@ -167,6 +167,7 @@ > SecurityWarningDialog dialog = > new SecurityWarningDialog(DialogType.MORE_INFO, null, null, > jarSigner); > + dialog.setModalityType(ModalityType.APPLICATION_MODAL); > dialog.setVisible(true); > dialog.dispose(); > } > @@ -181,6 +182,7 @@ > SecurityWarningDialog dialog = new SecurityWarningDialog(DialogType.CERT_INFO, > null, null, jarSigner); > dialog.setLocationRelativeTo(parent); > + dialog.setModalityType(ModalityType.APPLICATION_MODAL); > dialog.setVisible(true); > dialog.dispose(); > } > @@ -195,6 +197,7 @@ > JDialog parent) { > SecurityWarningDialog dialog = new SecurityWarningDialog(DialogType.SINGLE_CERT_INFO, c); > dialog.setLocationRelativeTo(parent); > + dialog.setModalityType(ModalityType.APPLICATION_MODAL); > dialog.setVisible(true); > dialog.dispose(); > } > @@ -219,7 +222,7 @@ > dialogTitle = "Security Warning"; > > setTitle(dialogTitle); > - setModal(false); > + setModalityType(ModalityType.MODELESS); > > setDefaultCloseOperation(DISPOSE_ON_CLOSE); > From dbhole at redhat.com Thu Oct 28 11:27:07 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Thu, 28 Oct 2010 14:27:07 -0400 Subject: [icedtea-web] Why use a separate basedir for plugin? In-Reply-To: <20101028161141.GL10821@rivendell.middle-earth.co.uk> References: <4CC6E900.8050709@redhat.com> <20101026221801.GG3781@redhat.com> <4CC756C7.7060102@redhat.com> <20101028133807.GB10821@rivendell.middle-earth.co.uk> <4CC98290.2010503@redhat.com> <20101028161141.GL10821@rivendell.middle-earth.co.uk> Message-ID: <20101028182707.GD23720@redhat.com> * Dr Andrew John Hughes [2010-10-28 12:39]: > On 10:02 Thu 28 Oct , Omair Majid wrote: > > On 10/28/2010 09:38 AM, Dr Andrew John Hughes wrote: > > > On 18:31 Tue 26 Oct , Omair Majid wrote: > > >> On 10/26/2010 06:18 PM, Deepak Bhole wrote: > > >>> * Omair Majid [2010-10-26 11:03]: > > >>>> Hi, > > >>>> > > >>>> I noticed that the plugin uses a different basedir (see > > >>>> JNLPRuntime.setBaseDir) from javaws. Is there a reason why? > > >>>> > > >>>> Since committing the deployment configuration patch, I have been > > >>>> working on integrating it into icedtea-web (I believe that ~/.netxrc > > >>>> is deprecated as of now). The deployment settings however, do not > > >>>> distinguish between plugin and javaws - whether in terms of the > > >>>> cache they use or which certificates are considered trusted. Hence I > > >>>> would like to make them both use the same certificates and cache > > >>>> (and possibly other things). Are there any reasons against doing > > >>>> this? > > >>>> > > >>> > > >>> Well, for one, they are 2 different things. We use the netx component > > >>> for embedding, but the plugin is still separate in terms of > > >>> functionality. > > >>> > > >> > > >> Right, but there is no reason they should not use the same > > >> proxy/cache/certificates, is there? Oracle JDK goes out of its ways to > > >> make them appear behave the same (including reading/parsing the mozilla > > >> configuration containing proxy settings in Java Web Start to get the > > >> same set of proxies the plugin would - I have not personally confirmed > > >> this, but the documentation says so). > > >> > > >>> How about putting everything in ~/.icedtea? > > >>> > > >> > > >> Sure, makes sense to me. My only question was about issues in having the > > >> plugin and netx share files. > > >> > > > > > > I thought we'd already decided to do this? :-) > > > > > > > Really? I was not aware of that. As far as I know the plugin keeps its > > files under ~/.icedteaplugin/ and netx keeps its files under ~/.netx/ > > and we never decided to unify it. > > > > I can't seem to find the particular mail, but it was something to do with > a patch introducing the ~/.netx tree IIRC. > > > >>> Speaking of deployement configuration, perhaps we should use > > >>> .java/deployement for that? If a user has previous deployment settings > > >>> from the Oracle JDK, they shouldn't have to re-do it just for > > >>> IcedTea/NetX. > > >>> > > >> > > >> That's the first thing I thought of, but I see a few potential issues > > >> with this. For one, the user can set values in this file which may cause > > >> Netx to and Web Start to clash. For example the cache hierarchy is quite > > >> different and one of them may overwrite/delete files the other creates. > > >> For another, the user may set values which may make sense in one and not > > >> another - for example setting a custom user.security.trusted.cacerts > > >> (which netx does not support) and then not allowing any security prompts > > >> for applications which appear untrusted. Such an application would work > > >> under Java Web Start but fail under netx. > > >> > > >> I am sure these issues can be ironed out, but for now we shouldnt ignore it. > > >> > > > > > > Unless this .java/deployment directory is openly specified, and that same specification > > > adhered to by the proprietary plugin, I would steer well clear. > > > > > > > The only "specification" related to the ~/.java/deployment directory > > that I can find is that it contains the deployment.properties file :/ > > > > So steer well clear. > Well, the deployment.properties file is what I was referring to and it is the only thing I think we should share. It is supposed to be a simple = file. Cheers, Deepak > > > If the plugin was open source, then I wouldn't be so wary. But then, we probably wouldn't > > > even be writing our own then, would we? > > > > > > > Heh. Good point. > > > > Thanks, > > Omair > > -- > Andrew :) > > Free Java Software Engineer > Red Hat, Inc. (http://www.redhat.com) > > Support Free Java! > Contribute to GNU Classpath and the OpenJDK > http://www.gnu.org/software/classpath > http://openjdk.java.net > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From omajid at redhat.com Thu Oct 28 11:32:50 2010 From: omajid at redhat.com (Omair Majid) Date: Thu, 28 Oct 2010 14:32:50 -0400 Subject: [icedtea-web] RFC: regression in certificate information dialogs In-Reply-To: <20101028181450.GB23720@redhat.com> References: <4CC9BB15.4090902@redhat.com> <20101028181450.GB23720@redhat.com> Message-ID: <4CC9C1D2.8080905@redhat.com> On 10/28/2010 02:14 PM, Deepak Bhole wrote: > * Omair Majid [2010-10-28 14:10]: >> Hi, >> >> There has been a regression in netx which causes some some dialogs >> (those showing information about certificates) to be disposed >> immediately after they shown. The attached patch makes these dialogs >> modal again so they are not disposed instantly. >> > > What introduced this regression? > This is the commit that changes the setModal from true to false: http://icedtea.classpath.org/hg/icedtea-web/rev/eb998ed0ab1a This regression was introduced because we wanted to allow multiple applets to show their own security warning dialogs without interfering with security dialogs from other applets. For example if signed applets A and B are launched, each will show their own security prompt. If A shows the security warning first, the user can not accept the warning from B without accepting or rejecting the warning from A first. One of the ideas behind this changeset was to allow this behaviour. Unfortunately, some dialogs which are not technically security warnings also rely on this class, and their behaviour changed which slipped by unnoticed. > This is a pretty bad regression :/ We need a better way to test and > assess commit feasibility. > Yes, it is a bad regression, but it does not affect any security prompts - it only affects dialogs that explain why the security warning is being shown. I agree that we need a process to ensure these things don't happen again. > OK for HEAD. > Thanks, I will push this commit shortly. Cheers, Omair > Deepak > >> ChangeLog >> 2010-10-28 Omair Majid >> >> * netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java >> (showMoreInfoDialog): Make dialog modal. >> (showCertInfoDialog): Likewise. >> (showSingleCertInfoDialog): Likewise. >> (initDialog): Use setModality instead of setModal. >> >> Any thoughts or comments? >> >> Thanks, >> Omair From omajid at redhat.com Thu Oct 28 13:04:39 2010 From: omajid at redhat.com (Omair Majid) Date: Thu, 28 Oct 2010 16:04:39 -0400 Subject: [icedtea-web] RFC: allow running make clean multiple times Message-ID: <4CC9D757.4050106@redhat.com> Hi, Running make clean twice causes the second make clean to fail as it can not delete the non-existing directory $(PLUGIN_DIR)/launcher. The patch checks that the directory exists before trying to delete it. make clean will still fail if the directory exists and is not empty. ChangeLog 2010-10-28 Omair Majid * Makefile.am (clean-IcedTeaPlugin): Remove launcher directory only if it exists. Thanks, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-web-make-clean-twice.patch Type: text/x-patch Size: 496 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101028/e350b331/icedtea-web-make-clean-twice.patch From omajid at icedtea.classpath.org Thu Oct 28 13:21:37 2010 From: omajid at icedtea.classpath.org (omajid at icedtea.classpath.org) Date: Thu, 28 Oct 2010 20:21:37 +0000 Subject: /hg/icedtea-web: Fix regression in showing certificate info dialogs Message-ID: changeset 3571cd24829e in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=3571cd24829e author: Omair Majid date: Thu Oct 28 16:18:36 2010 -0400 Fix regression in showing certificate info dialogs 2010-10-28 Omair Majid * netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java (showMoreInfoDialog): Make dialog modal. (showCertInfoDialog): Likewise. (showSingleCertInfoDialog): Likewise. (initDialog): Use setModality instead of setModal. diffstat: 2 files changed, 12 insertions(+), 1 deletion(-) ChangeLog | 8 ++++++++ netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java | 5 ++++- diffs (51 lines): diff -r 5566a5487109 -r 3571cd24829e ChangeLog --- a/ChangeLog Wed Oct 27 15:55:55 2010 -0700 +++ b/ChangeLog Thu Oct 28 16:18:36 2010 -0400 @@ -1,3 +1,11 @@ 2010-10-27 Deepak Bhole + + * netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java + (showMoreInfoDialog): Make dialog modal. + (showCertInfoDialog): Likewise. + (showSingleCertInfoDialog): Likewise. + (initDialog): Use setModality instead of setModal. + 2010-10-27 Deepak Bhole * plugin/icedteanp/IcedTeaNPPlugin.cc (plugin_create_applet_tag): Escape diff -r 5566a5487109 -r 3571cd24829e netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java --- a/netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java Wed Oct 27 15:55:55 2010 -0700 +++ b/netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java Thu Oct 28 16:18:36 2010 -0400 @@ -167,6 +167,7 @@ public class SecurityWarningDialog exten SecurityWarningDialog dialog = new SecurityWarningDialog(DialogType.MORE_INFO, null, null, jarSigner); + dialog.setModalityType(ModalityType.APPLICATION_MODAL); dialog.setVisible(true); dialog.dispose(); } @@ -181,6 +182,7 @@ public class SecurityWarningDialog exten SecurityWarningDialog dialog = new SecurityWarningDialog(DialogType.CERT_INFO, null, null, jarSigner); dialog.setLocationRelativeTo(parent); + dialog.setModalityType(ModalityType.APPLICATION_MODAL); dialog.setVisible(true); dialog.dispose(); } @@ -195,6 +197,7 @@ public class SecurityWarningDialog exten JDialog parent) { SecurityWarningDialog dialog = new SecurityWarningDialog(DialogType.SINGLE_CERT_INFO, c); dialog.setLocationRelativeTo(parent); + dialog.setModalityType(ModalityType.APPLICATION_MODAL); dialog.setVisible(true); dialog.dispose(); } @@ -219,7 +222,7 @@ public class SecurityWarningDialog exten dialogTitle = "Security Warning"; setTitle(dialogTitle); - setModal(false); + setModalityType(ModalityType.MODELESS); setDefaultCloseOperation(DISPOSE_ON_CLOSE); From dbhole at redhat.com Thu Oct 28 13:57:50 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Thu, 28 Oct 2010 16:57:50 -0400 Subject: [icedtea-web] RFC: allow running make clean multiple times In-Reply-To: <4CC9D757.4050106@redhat.com> References: <4CC9D757.4050106@redhat.com> Message-ID: <20101028205750.GE23720@redhat.com> * Omair Majid [2010-10-28 16:09]: > Hi, > > Running make clean twice causes the second make clean to fail as it > can not delete the non-existing directory $(PLUGIN_DIR)/launcher. > The patch checks that the directory exists before trying to delete > it. make clean will still fail if the directory exists and is not > empty. > I'd just change it to use rmdir --ignore-fail-on-non-empty. Or is there a reason for the if check to exist? Deepak > ChangeLog > 2010-10-28 Omair Majid > > * Makefile.am > (clean-IcedTeaPlugin): Remove launcher directory only if it exists. > > Thanks, > Omair > diff -r 33f17695e034 Makefile.am > --- a/Makefile.am Tue Oct 26 18:14:11 2010 -0400 > +++ b/Makefile.am Thu Oct 28 15:57:36 2010 -0400 > @@ -190,7 +190,9 @@ > clean-IcedTeaPlugin: > rm -f $(PLUGIN_DIR)/launcher/*.o > rm -f $(PLUGIN_DIR)/launcher/pluginappletviewer > - rmdir $(PLUGIN_DIR)/launcher > + if [ -e $(PLUGIN_DIR)/launcher ]; then \ > + rmdir $(PLUGIN_DIR)/launcher ; \ > + fi > rm -f $(PLUGIN_DIR)/*.o > rm -f $(PLUGIN_DIR)/IcedTeaPlugin.so > if [ $(abs_top_srcdir) != $(abs_top_builddir) ]; then \ From omajid at redhat.com Thu Oct 28 14:04:12 2010 From: omajid at redhat.com (Omair Majid) Date: Thu, 28 Oct 2010 17:04:12 -0400 Subject: [icedtea-web] RFC: parse jnlps containing component-desc as well as application-desc elements In-Reply-To: <4CC87A03.2040004@redhat.com> References: <4CC87A03.2040004@redhat.com> Message-ID: <4CC9E54C.1020007@redhat.com> On 10/27/2010 03:14 PM, Omair Majid wrote: > Hi, > > Some JNLPs such as space weasel [1] contain a "component-desc" element > along with an "application-desc" element. Netx current fails trying to > run such an application. The parser error says that having multiple > *-desc elements is not supported. In the case of "component-desc" this > does not make much sense. "application-desc", "applet-desc" and > "installer-desc" describe what should be done with this jnlp file; > "component-desc" carries no such meaning, so it should be ok to have a > "component-desc" along with "application-desc" in the same JNLP file. > The attached patch fixes this. > A very slightly updated patch attached. Instead of using recursion (and always returning null - my mistake) in getComponent, return a new ComponentDesc. As far as I know nothing in netx actually uses ComponentDesc - applications that loaded components/extensions worked before this patch, work with the patch I posted yesterday and work with this latest patch. > ChangeLog: > 2010-10-27 Omair Majid > > * netx/net/sourceforge/jnlp/JNLPFile.java: Add component. > (getLaunchInfo): Modify javadoc to indicate that it does not return > the ComponentDesc. > (getComponent): Return component instead of launchType. > (isComponent): Check if component is not null. > (parse): Find and set component. > * netx/net/sourceforge/jnlp/Parser.java > (getLauncher): Remove all checks for component-desc. Allow having > none of application-desc, applet-desc and installer-desc. > (getComponent): Check for more than one component-desc element. > Read and parse the component-desc. > > Any thoughts or comments? Anyone? > [1] http://spaceweasel.googlecode.com/svn/wiki/weasel.jnlp > Thanks, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-web-component-desc-02.patch Type: text/x-patch Size: 3644 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101028/0d0f7839/icedtea-web-component-desc-02.patch From omajid at redhat.com Thu Oct 28 14:18:36 2010 From: omajid at redhat.com (Omair Majid) Date: Thu, 28 Oct 2010 17:18:36 -0400 Subject: [icedtea-web] RFC: allow running make clean multiple times In-Reply-To: <20101028205750.GE23720@redhat.com> References: <4CC9D757.4050106@redhat.com> <20101028205750.GE23720@redhat.com> Message-ID: <4CC9E8AC.6050702@redhat.com> On 10/28/2010 04:57 PM, Deepak Bhole wrote: > * Omair Majid [2010-10-28 16:09]: >> Hi, >> >> Running make clean twice causes the second make clean to fail as it >> can not delete the non-existing directory $(PLUGIN_DIR)/launcher. >> The patch checks that the directory exists before trying to delete >> it. make clean will still fail if the directory exists and is not >> empty. >> > > I'd just change it to use rmdir --ignore-fail-on-non-empty. Or is there > a reason for the if check to exist? > Andrew Hughes (in the recent discussion related to other Makefile fixes) said "I _want_ rmdir to fail if the launcher directory contains anything other than compiled objects." [1]. Hence the check. Thanks, Omair [1] http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-October/010678.html From ahughes at redhat.com Thu Oct 28 15:35:44 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Thu, 28 Oct 2010 23:35:44 +0100 Subject: [icedtea-web] RFC: allow running make clean multiple times In-Reply-To: <4CC9D757.4050106@redhat.com> References: <4CC9D757.4050106@redhat.com> Message-ID: <20101028223544.GS10821@rivendell.middle-earth.co.uk> On 16:04 Thu 28 Oct , Omair Majid wrote: > Hi, > > Running make clean twice causes the second make clean to fail as it can > not delete the non-existing directory $(PLUGIN_DIR)/launcher. The patch > checks that the directory exists before trying to delete it. make clean > will still fail if the directory exists and is not empty. > > ChangeLog > 2010-10-28 Omair Majid > > * Makefile.am > (clean-IcedTeaPlugin): Remove launcher directory only if it exists. > > Thanks, > Omair > diff -r 33f17695e034 Makefile.am > --- a/Makefile.am Tue Oct 26 18:14:11 2010 -0400 > +++ b/Makefile.am Thu Oct 28 15:57:36 2010 -0400 > @@ -190,7 +190,9 @@ > clean-IcedTeaPlugin: > rm -f $(PLUGIN_DIR)/launcher/*.o > rm -f $(PLUGIN_DIR)/launcher/pluginappletviewer > - rmdir $(PLUGIN_DIR)/launcher > + if [ -e $(PLUGIN_DIR)/launcher ]; then \ > + rmdir $(PLUGIN_DIR)/launcher ; \ > + fi > rm -f $(PLUGIN_DIR)/*.o > rm -f $(PLUGIN_DIR)/IcedTeaPlugin.so > if [ $(abs_top_srcdir) != $(abs_top_builddir) ]; then \ Yeah, sorry we need these checks here just as we do in IcedTea6. The option suggested by Deepak sounds both non-standard and won't solve this problem (lack of existence not emptiness). -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From ahughes at redhat.com Thu Oct 28 15:47:48 2010 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Thu, 28 Oct 2010 23:47:48 +0100 Subject: [icedtea-web] Why use a separate basedir for plugin? In-Reply-To: <20101028182707.GD23720@redhat.com> References: <4CC6E900.8050709@redhat.com> <20101026221801.GG3781@redhat.com> <4CC756C7.7060102@redhat.com> <20101028133807.GB10821@rivendell.middle-earth.co.uk> <4CC98290.2010503@redhat.com> <20101028161141.GL10821@rivendell.middle-earth.co.uk> <20101028182707.GD23720@redhat.com> Message-ID: <20101028224748.GT10821@rivendell.middle-earth.co.uk> On 14:27 Thu 28 Oct , Deepak Bhole wrote: > * Dr Andrew John Hughes [2010-10-28 12:39]: > > On 10:02 Thu 28 Oct , Omair Majid wrote: > > > On 10/28/2010 09:38 AM, Dr Andrew John Hughes wrote: > > > > On 18:31 Tue 26 Oct , Omair Majid wrote: > > > >> On 10/26/2010 06:18 PM, Deepak Bhole wrote: > > > >>> * Omair Majid [2010-10-26 11:03]: > > > >>>> Hi, > > > >>>> > > > >>>> I noticed that the plugin uses a different basedir (see > > > >>>> JNLPRuntime.setBaseDir) from javaws. Is there a reason why? > > > >>>> > > > >>>> Since committing the deployment configuration patch, I have been > > > >>>> working on integrating it into icedtea-web (I believe that ~/.netxrc > > > >>>> is deprecated as of now). The deployment settings however, do not > > > >>>> distinguish between plugin and javaws - whether in terms of the > > > >>>> cache they use or which certificates are considered trusted. Hence I > > > >>>> would like to make them both use the same certificates and cache > > > >>>> (and possibly other things). Are there any reasons against doing > > > >>>> this? > > > >>>> > > > >>> > > > >>> Well, for one, they are 2 different things. We use the netx component > > > >>> for embedding, but the plugin is still separate in terms of > > > >>> functionality. > > > >>> > > > >> > > > >> Right, but there is no reason they should not use the same > > > >> proxy/cache/certificates, is there? Oracle JDK goes out of its ways to > > > >> make them appear behave the same (including reading/parsing the mozilla > > > >> configuration containing proxy settings in Java Web Start to get the > > > >> same set of proxies the plugin would - I have not personally confirmed > > > >> this, but the documentation says so). > > > >> > > > >>> How about putting everything in ~/.icedtea? > > > >>> > > > >> > > > >> Sure, makes sense to me. My only question was about issues in having the > > > >> plugin and netx share files. > > > >> > > > > > > > > I thought we'd already decided to do this? :-) > > > > > > > > > > Really? I was not aware of that. As far as I know the plugin keeps its > > > files under ~/.icedteaplugin/ and netx keeps its files under ~/.netx/ > > > and we never decided to unify it. > > > > > > > I can't seem to find the particular mail, but it was something to do with > > a patch introducing the ~/.netx tree IIRC. > > > > > >>> Speaking of deployement configuration, perhaps we should use > > > >>> .java/deployement for that? If a user has previous deployment settings > > > >>> from the Oracle JDK, they shouldn't have to re-do it just for > > > >>> IcedTea/NetX. > > > >>> > > > >> > > > >> That's the first thing I thought of, but I see a few potential issues > > > >> with this. For one, the user can set values in this file which may cause > > > >> Netx to and Web Start to clash. For example the cache hierarchy is quite > > > >> different and one of them may overwrite/delete files the other creates. > > > >> For another, the user may set values which may make sense in one and not > > > >> another - for example setting a custom user.security.trusted.cacerts > > > >> (which netx does not support) and then not allowing any security prompts > > > >> for applications which appear untrusted. Such an application would work > > > >> under Java Web Start but fail under netx. > > > >> > > > >> I am sure these issues can be ironed out, but for now we shouldnt ignore it. > > > >> > > > > > > > > Unless this .java/deployment directory is openly specified, and that same specification > > > > adhered to by the proprietary plugin, I would steer well clear. > > > > > > > > > > The only "specification" related to the ~/.java/deployment directory > > > that I can find is that it contains the deployment.properties file :/ > > > > > > > So steer well clear. > > > > Well, the deployment.properties file is what I was referring to and it > is the only thing I think we should share. It is supposed to be a simple > = file. > Well you could try reading it. I wouldn't write to it. Equally you could look at making use of system facilities such as the HTTP_PROXY and HTTPS_PROXY environment variables and the libproxy library. > Cheers, > Deepak > > > > > If the plugin was open source, then I wouldn't be so wary. But then, we probably wouldn't > > > > even be writing our own then, would we? > > > > > > > > > > Heh. Good point. > > > > > > Thanks, > > > Omair > > > > -- > > Andrew :) > > > > Free Java Software Engineer > > Red Hat, Inc. (http://www.redhat.com) > > > > Support Free Java! > > Contribute to GNU Classpath and the OpenJDK > > http://www.gnu.org/software/classpath > > http://openjdk.java.net > > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From dbhole at redhat.com Thu Oct 28 21:13:02 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Fri, 29 Oct 2010 00:13:02 -0400 Subject: [icedtea-web] RFC: allow running make clean multiple times In-Reply-To: <20101028223544.GS10821@rivendell.middle-earth.co.uk> References: <4CC9D757.4050106@redhat.com> <20101028223544.GS10821@rivendell.middle-earth.co.uk> Message-ID: <20101029041302.GA30305@redhat.com> * Dr Andrew John Hughes [2010-10-28 18:39]: > On 16:04 Thu 28 Oct , Omair Majid wrote: > > Hi, > > > > Running make clean twice causes the second make clean to fail as it can > > not delete the non-existing directory $(PLUGIN_DIR)/launcher. The patch > > checks that the directory exists before trying to delete it. make clean > > will still fail if the directory exists and is not empty. > > > > ChangeLog > > 2010-10-28 Omair Majid > > > > * Makefile.am > > (clean-IcedTeaPlugin): Remove launcher directory only if it exists. > > > > Thanks, > > Omair > > > diff -r 33f17695e034 Makefile.am > > --- a/Makefile.am Tue Oct 26 18:14:11 2010 -0400 > > +++ b/Makefile.am Thu Oct 28 15:57:36 2010 -0400 > > @@ -190,7 +190,9 @@ > > clean-IcedTeaPlugin: > > rm -f $(PLUGIN_DIR)/launcher/*.o > > rm -f $(PLUGIN_DIR)/launcher/pluginappletviewer > > - rmdir $(PLUGIN_DIR)/launcher > > + if [ -e $(PLUGIN_DIR)/launcher ]; then \ > > + rmdir $(PLUGIN_DIR)/launcher ; \ > > + fi > > rm -f $(PLUGIN_DIR)/*.o > > rm -f $(PLUGIN_DIR)/IcedTeaPlugin.so > > if [ $(abs_top_srcdir) != $(abs_top_builddir) ]; then \ > > Yeah, sorry we need these checks here just as we do in IcedTea6. > > The option suggested by Deepak sounds both non-standard and won't solve > this problem (lack of existence not emptiness). Doh! Sorry, I misread the man page (and clearly copied and pasted without reading the switch name!). I thought it was "ignore if dir doesn't exist". Sorry about that :/ Cheers, Deepak > -- > Andrew :) > > Free Java Software Engineer > Red Hat, Inc. (http://www.redhat.com) > > Support Free Java! > Contribute to GNU Classpath and the OpenJDK > http://www.gnu.org/software/classpath > http://openjdk.java.net > PGP Key: 94EFD9D8 (http://subkeys.pgp.net) > Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From dbhole at redhat.com Fri Oct 29 08:20:16 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Fri, 29 Oct 2010 11:20:16 -0400 Subject: [icedtea-web] RFC: parse jnlps containing component-desc as well as application-desc elements In-Reply-To: <4CC9E54C.1020007@redhat.com> References: <4CC87A03.2040004@redhat.com> <4CC9E54C.1020007@redhat.com> Message-ID: <20101029152015.GB31866@redhat.com> * Omair Majid [2010-10-28 17:09]: > On 10/27/2010 03:14 PM, Omair Majid wrote: > >Hi, > > > >Some JNLPs such as space weasel [1] contain a "component-desc" element > >along with an "application-desc" element. Netx current fails trying to > >run such an application. The parser error says that having multiple > >*-desc elements is not supported. In the case of "component-desc" this > >does not make much sense. "application-desc", "applet-desc" and > >"installer-desc" describe what should be done with this jnlp file; > >"component-desc" carries no such meaning, so it should be ok to have a > >"component-desc" along with "application-desc" in the same JNLP file. > >The attached patch fixes this. > > > > A very slightly updated patch attached. Instead of using recursion > (and always returning null - my mistake) in getComponent, return a > new ComponentDesc. As far as I know nothing in netx actually uses > ComponentDesc - applications that loaded components/extensions > worked before this patch, work with the patch I posted yesterday and > work with this latest patch. > > >ChangeLog: > >2010-10-27 Omair Majid > > > >* netx/net/sourceforge/jnlp/JNLPFile.java: Add component. > >(getLaunchInfo): Modify javadoc to indicate that it does not return > >the ComponentDesc. > >(getComponent): Return component instead of launchType. > >(isComponent): Check if component is not null. > >(parse): Find and set component. > >* netx/net/sourceforge/jnlp/Parser.java > >(getLauncher): Remove all checks for component-desc. Allow having > >none of application-desc, applet-desc and installer-desc. > >(getComponent): Check for more than one component-desc element. > >Read and parse the component-desc. > > > >Any thoughts or comments? > > Anyone? > > >[1] http://spaceweasel.googlecode.com/svn/wiki/weasel.jnlp > > > > Thanks, > Omair > diff -r 5566a5487109 netx/net/sourceforge/jnlp/JNLPFile.java > --- a/netx/net/sourceforge/jnlp/JNLPFile.java Wed Oct 27 15:55:55 2010 -0700 > +++ b/netx/net/sourceforge/jnlp/JNLPFile.java Thu Oct 28 16:49:24 2010 -0400 > @@ -95,6 +95,9 @@ > /** the application description */ > protected Object launchType; > > + /** the component description */ > + protected ComponentDesc component; > + > /** the security descriptor */ > protected SecurityDesc security; > > @@ -402,7 +405,7 @@ > > /** > * Returns an object of one of the following types: AppletDesc, > - * ApplicationDesc, InstallerDesc, and ComponentDesc. > + * ApplicationDesc and InstallerDesc > */ > public Object getLaunchInfo() { > return launchType; > @@ -441,7 +444,7 @@ > if (!isComponent()) > throw new UnsupportedOperationException(R("JNotComponent")); > > - return (ComponentDesc) launchType; > + return component; > } > > /** > @@ -474,7 +477,7 @@ > * Returns whether the lauch descriptor describes a Component. > */ > public boolean isComponent() { > - return launchType instanceof ComponentDesc; > + return component != null; > } > > /** > @@ -574,6 +577,7 @@ > update = parser.getUpdate(root); > resources = parser.getResources(root, false); // false == not a j2se/java resources section > launchType = parser.getLauncher(root); > + component = parser.getComponent(root); > security = parser.getSecurity(root); > } > catch (ParseException ex) { > diff -r 5566a5487109 netx/net/sourceforge/jnlp/Parser.java > --- a/netx/net/sourceforge/jnlp/Parser.java Wed Oct 27 15:55:55 2010 -0700 > +++ b/netx/net/sourceforge/jnlp/Parser.java Thu Oct 28 16:49:24 2010 -0400 > @@ -598,16 +598,15 @@ > > /** > * Returns the launch descriptor element, either AppletDesc, > - * ApplicationDesc, ComponentDesc, or InstallerDesc. > + * ApplicationDesc, or InstallerDesc. > * > * @param parent the parent node > * @throws ParseException if the JNLP file is invalid > */ > public Object getLauncher(Node parent) throws ParseException { > // check for other than one application type > - if (1 != getChildNodes(parent, "applet-desc").length > + if (1 < getChildNodes(parent, "applet-desc").length > + getChildNodes(parent, "application-desc").length > - + getChildNodes(parent, "component-desc").length > + getChildNodes(parent, "installer-desc").length) > throw new ParseException(R("PTwoDescriptors")); Does the spec allow a jnlp without any of the above descriptors? Deepak > > @@ -619,8 +618,6 @@ > return getApplet(child); > if ("application-desc".equals(name)) > return getApplication(child); > - if ("component-desc".equals(name)) > - return getComponent(child); > if ("installer-desc".equals(name)) > return getInstaller(child); > > @@ -693,8 +690,23 @@ > /** > * Returns the component descriptor. > */ > - public ComponentDesc getComponent(Node node) { > - return new ComponentDesc(); > + public ComponentDesc getComponent(Node parent) throws ParseException { > + > + if (1 < getChildNodes(parent, "component-desc").length) { > + throw new ParseException(R("PTwoDescriptors")); > + } > + > + Node child = parent.getFirstChild(); > + while (child != null) { > + String name = child.getNodeName(); > + > + if ("component-desc".equals(name)) > + return new ComponentDesc(); > + > + child = child.getNextSibling(); > + } > + > + return null; > } > > /** From omajid at redhat.com Fri Oct 29 08:39:24 2010 From: omajid at redhat.com (Omair Majid) Date: Fri, 29 Oct 2010 11:39:24 -0400 Subject: [icedtea-web] RFC: parse jnlps containing component-desc as well as application-desc elements In-Reply-To: <20101029152015.GB31866@redhat.com> References: <4CC87A03.2040004@redhat.com> <4CC9E54C.1020007@redhat.com> <20101029152015.GB31866@redhat.com> Message-ID: <4CCAEAAC.7000902@redhat.com> On 10/29/2010 11:20 AM, Deepak Bhole wrote: > * Omair Majid [2010-10-28 17:09]: >> On 10/27/2010 03:14 PM, Omair Majid wrote: >>> Hi, >>> >>> Some JNLPs such as space weasel [1] contain a "component-desc" element >>> along with an "application-desc" element. Netx current fails trying to >>> run such an application. The parser error says that having multiple >>> *-desc elements is not supported. In the case of "component-desc" this >>> does not make much sense. "application-desc", "applet-desc" and >>> "installer-desc" describe what should be done with this jnlp file; >>> "component-desc" carries no such meaning, so it should be ok to have a >>> "component-desc" along with "application-desc" in the same JNLP file. >>> The attached patch fixes this. >>> >> >> A very slightly updated patch attached. Instead of using recursion >> (and always returning null - my mistake) in getComponent, return a >> new ComponentDesc. As far as I know nothing in netx actually uses >> ComponentDesc - applications that loaded components/extensions >> worked before this patch, work with the patch I posted yesterday and >> work with this latest patch. >> >>> ChangeLog: >>> 2010-10-27 Omair Majid >>> >>> * netx/net/sourceforge/jnlp/JNLPFile.java: Add component. >>> (getLaunchInfo): Modify javadoc to indicate that it does not return >>> the ComponentDesc. >>> (getComponent): Return component instead of launchType. >>> (isComponent): Check if component is not null. >>> (parse): Find and set component. >>> * netx/net/sourceforge/jnlp/Parser.java >>> (getLauncher): Remove all checks for component-desc. Allow having >>> none of application-desc, applet-desc and installer-desc. >>> (getComponent): Check for more than one component-desc element. >>> Read and parse the component-desc. >>> >>> Any thoughts or comments? >> >> Anyone? >> >>> [1] http://spaceweasel.googlecode.com/svn/wiki/weasel.jnlp >>> >> >> Thanks, >> Omair > >> diff -r 5566a5487109 netx/net/sourceforge/jnlp/JNLPFile.java >> --- a/netx/net/sourceforge/jnlp/JNLPFile.java Wed Oct 27 15:55:55 2010 -0700 >> +++ b/netx/net/sourceforge/jnlp/JNLPFile.java Thu Oct 28 16:49:24 2010 -0400 >> @@ -95,6 +95,9 @@ >> /** the application description */ >> protected Object launchType; >> >> + /** the component description */ >> + protected ComponentDesc component; >> + >> /** the security descriptor */ >> protected SecurityDesc security; >> >> @@ -402,7 +405,7 @@ >> >> /** >> * Returns an object of one of the following types: AppletDesc, >> - * ApplicationDesc, InstallerDesc, and ComponentDesc. >> + * ApplicationDesc and InstallerDesc >> */ >> public Object getLaunchInfo() { >> return launchType; >> @@ -441,7 +444,7 @@ >> if (!isComponent()) >> throw new UnsupportedOperationException(R("JNotComponent")); >> >> - return (ComponentDesc) launchType; >> + return component; >> } >> >> /** >> @@ -474,7 +477,7 @@ >> * Returns whether the lauch descriptor describes a Component. >> */ >> public boolean isComponent() { >> - return launchType instanceof ComponentDesc; >> + return component != null; >> } >> >> /** >> @@ -574,6 +577,7 @@ >> update = parser.getUpdate(root); >> resources = parser.getResources(root, false); // false == not a j2se/java resources section >> launchType = parser.getLauncher(root); >> + component = parser.getComponent(root); >> security = parser.getSecurity(root); >> } >> catch (ParseException ex) { >> diff -r 5566a5487109 netx/net/sourceforge/jnlp/Parser.java >> --- a/netx/net/sourceforge/jnlp/Parser.java Wed Oct 27 15:55:55 2010 -0700 >> +++ b/netx/net/sourceforge/jnlp/Parser.java Thu Oct 28 16:49:24 2010 -0400 >> @@ -598,16 +598,15 @@ >> >> /** >> * Returns the launch descriptor element, either AppletDesc, >> - * ApplicationDesc, ComponentDesc, or InstallerDesc. >> + * ApplicationDesc, or InstallerDesc. >> * >> * @param parent the parent node >> * @throws ParseException if the JNLP file is invalid >> */ >> public Object getLauncher(Node parent) throws ParseException { >> // check for other than one application type >> - if (1 != getChildNodes(parent, "applet-desc").length >> + if (1< getChildNodes(parent, "applet-desc").length >> + getChildNodes(parent, "application-desc").length >> - + getChildNodes(parent, "component-desc").length >> + getChildNodes(parent, "installer-desc").length) >> throw new ParseException(R("PTwoDescriptors")); > > > Does the spec allow a jnlp without any of the above descriptors? > Yes. A JNLP extension can have just the element. For example, take a look at the files at http://github.com/sgothel/jogl/tree/HEAD/jnlp-files. Of course, a file without any of the above elements can not be run directly; it must be used as an extension. If a user tries to run such a file directly, net.sourceforge.jnlp.Launcher will throw an exception. Thanks, Omair >> >> @@ -619,8 +618,6 @@ >> return getApplet(child); >> if ("application-desc".equals(name)) >> return getApplication(child); >> - if ("component-desc".equals(name)) >> - return getComponent(child); >> if ("installer-desc".equals(name)) >> return getInstaller(child); >> >> @@ -693,8 +690,23 @@ >> /** >> * Returns the component descriptor. >> */ >> - public ComponentDesc getComponent(Node node) { >> - return new ComponentDesc(); >> + public ComponentDesc getComponent(Node parent) throws ParseException { >> + >> + if (1< getChildNodes(parent, "component-desc").length) { >> + throw new ParseException(R("PTwoDescriptors")); >> + } >> + >> + Node child = parent.getFirstChild(); >> + while (child != null) { >> + String name = child.getNodeName(); >> + >> + if ("component-desc".equals(name)) >> + return new ComponentDesc(); >> + >> + child = child.getNextSibling(); >> + } >> + >> + return null; >> } >> >> /** > From dbhole at redhat.com Fri Oct 29 08:53:49 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Fri, 29 Oct 2010 11:53:49 -0400 Subject: [icedtea-web] RFC: parse jnlps containing component-desc as well as application-desc elements In-Reply-To: <4CCAEAAC.7000902@redhat.com> References: <4CC87A03.2040004@redhat.com> <4CC9E54C.1020007@redhat.com> <20101029152015.GB31866@redhat.com> <4CCAEAAC.7000902@redhat.com> Message-ID: <20101029155349.GC31866@redhat.com> * Omair Majid [2010-10-29 11:39]: > On 10/29/2010 11:20 AM, Deepak Bhole wrote: > >* Omair Majid [2010-10-28 17:09]: > >>On 10/27/2010 03:14 PM, Omair Majid wrote: > >>>Hi, > >>> > >>>Some JNLPs such as space weasel [1] contain a "component-desc" element > >>>along with an "application-desc" element. Netx current fails trying to > >>>run such an application. The parser error says that having multiple > >>>*-desc elements is not supported. In the case of "component-desc" this > >>>does not make much sense. "application-desc", "applet-desc" and > >>>"installer-desc" describe what should be done with this jnlp file; > >>>"component-desc" carries no such meaning, so it should be ok to have a > >>>"component-desc" along with "application-desc" in the same JNLP file. > >>>The attached patch fixes this. > >>> > >> > >>A very slightly updated patch attached. Instead of using recursion > >>(and always returning null - my mistake) in getComponent, return a > >>new ComponentDesc. As far as I know nothing in netx actually uses > >>ComponentDesc - applications that loaded components/extensions > >>worked before this patch, work with the patch I posted yesterday and > >>work with this latest patch. > >> > >>>ChangeLog: > >>>2010-10-27 Omair Majid > >>> > >>>* netx/net/sourceforge/jnlp/JNLPFile.java: Add component. > >>>(getLaunchInfo): Modify javadoc to indicate that it does not return > >>>the ComponentDesc. > >>>(getComponent): Return component instead of launchType. > >>>(isComponent): Check if component is not null. > >>>(parse): Find and set component. > >>>* netx/net/sourceforge/jnlp/Parser.java > >>>(getLauncher): Remove all checks for component-desc. Allow having > >>>none of application-desc, applet-desc and installer-desc. > >>>(getComponent): Check for more than one component-desc element. > >>>Read and parse the component-desc. > >>> > >>>Any thoughts or comments? > >> > >>Anyone? > >> > >>>[1] http://spaceweasel.googlecode.com/svn/wiki/weasel.jnlp > >>> > >> > >>Thanks, > >>Omair > > > >>diff -r 5566a5487109 netx/net/sourceforge/jnlp/JNLPFile.java > >>--- a/netx/net/sourceforge/jnlp/JNLPFile.java Wed Oct 27 15:55:55 2010 -0700 > >>+++ b/netx/net/sourceforge/jnlp/JNLPFile.java Thu Oct 28 16:49:24 2010 -0400 > >>@@ -95,6 +95,9 @@ > >> /** the application description */ > >> protected Object launchType; > >> > >>+ /** the component description */ > >>+ protected ComponentDesc component; > >>+ > >> /** the security descriptor */ > >> protected SecurityDesc security; > >> > >>@@ -402,7 +405,7 @@ > >> > >> /** > >> * Returns an object of one of the following types: AppletDesc, > >>- * ApplicationDesc, InstallerDesc, and ComponentDesc. > >>+ * ApplicationDesc and InstallerDesc > >> */ > >> public Object getLaunchInfo() { > >> return launchType; > >>@@ -441,7 +444,7 @@ > >> if (!isComponent()) > >> throw new UnsupportedOperationException(R("JNotComponent")); > >> > >>- return (ComponentDesc) launchType; > >>+ return component; > >> } > >> > >> /** > >>@@ -474,7 +477,7 @@ > >> * Returns whether the lauch descriptor describes a Component. > >> */ > >> public boolean isComponent() { > >>- return launchType instanceof ComponentDesc; > >>+ return component != null; > >> } > >> > >> /** > >>@@ -574,6 +577,7 @@ > >> update = parser.getUpdate(root); > >> resources = parser.getResources(root, false); // false == not a j2se/java resources section > >> launchType = parser.getLauncher(root); > >>+ component = parser.getComponent(root); > >> security = parser.getSecurity(root); > >> } > >> catch (ParseException ex) { > >>diff -r 5566a5487109 netx/net/sourceforge/jnlp/Parser.java > >>--- a/netx/net/sourceforge/jnlp/Parser.java Wed Oct 27 15:55:55 2010 -0700 > >>+++ b/netx/net/sourceforge/jnlp/Parser.java Thu Oct 28 16:49:24 2010 -0400 > >>@@ -598,16 +598,15 @@ > >> > >> /** > >> * Returns the launch descriptor element, either AppletDesc, > >>- * ApplicationDesc, ComponentDesc, or InstallerDesc. > >>+ * ApplicationDesc, or InstallerDesc. > >> * > >> * @param parent the parent node > >> * @throws ParseException if the JNLP file is invalid > >> */ > >> public Object getLauncher(Node parent) throws ParseException { > >> // check for other than one application type > >>- if (1 != getChildNodes(parent, "applet-desc").length > >>+ if (1< getChildNodes(parent, "applet-desc").length > >> + getChildNodes(parent, "application-desc").length > >>- + getChildNodes(parent, "component-desc").length > >> + getChildNodes(parent, "installer-desc").length) > >> throw new ParseException(R("PTwoDescriptors")); > > > > > >Does the spec allow a jnlp without any of the above descriptors? > > > > Yes. A JNLP extension can have just the element. > For example, take a look at the files at > http://github.com/sgothel/jogl/tree/HEAD/jnlp-files. Of course, a > file without any of the above elements can not be run directly; it > must be used as an extension. If a user tries to run such a file > directly, net.sourceforge.jnlp.Launcher will throw an exception. > Ah okay. Fair enough. Looks fine to me. OK for head. Deepak > Thanks, > Omair > > >> > >>@@ -619,8 +618,6 @@ > >> return getApplet(child); > >> if ("application-desc".equals(name)) > >> return getApplication(child); > >>- if ("component-desc".equals(name)) > >>- return getComponent(child); > >> if ("installer-desc".equals(name)) > >> return getInstaller(child); > >> > >>@@ -693,8 +690,23 @@ > >> /** > >> * Returns the component descriptor. > >> */ > >>- public ComponentDesc getComponent(Node node) { > >>- return new ComponentDesc(); > >>+ public ComponentDesc getComponent(Node parent) throws ParseException { > >>+ > >>+ if (1< getChildNodes(parent, "component-desc").length) { > >>+ throw new ParseException(R("PTwoDescriptors")); > >>+ } > >>+ > >>+ Node child = parent.getFirstChild(); > >>+ while (child != null) { > >>+ String name = child.getNodeName(); > >>+ > >>+ if ("component-desc".equals(name)) > >>+ return new ComponentDesc(); > >>+ > >>+ child = child.getNextSibling(); > >>+ } > >>+ > >>+ return null; > >> } > >> > >> /** > > > From bugzilla-daemon at icedtea.classpath.org Fri Oct 29 09:01:53 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 29 Oct 2010 16:01:53 +0000 Subject: [Bug 581] New: shark using llvm-2.8 fails to build on newer x86_64 hardware Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=581 Summary: shark using llvm-2.8 fails to build on newer x86_64 hardware Product: IcedTea Version: 6-hg Platform: all URL: https://launchpad.net/bugs/664465 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: Shark AssignedTo: unassigned at icedtea.classpath.org ReportedBy: doko at ubuntu.com this is seen on newer x86_64 hardware with llvm-2.8. I did verify that a 2.7 based build does succeed on the same hardware, so this looks like an issue in llvm-2.8. This hardware is only used as a buildd, I don't have remote access to it. the build succeeds on: model name : AMD Opteron(tm) Processor 246 flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext lm 3dnowext 3dnow rep_good it fails on: model name : Intel(R) Xeon(R) CPU E5530 @ 2.40GHz flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr dca sse4_1 sse4_2 popcnt lahf_lm ida it fails in make[8]: Leaving directory `/build/buildd/openjdk-6-6b20-1.10~pre2/build/zerovm/openjdk.build/hotspot/out putdir/linux_amd64_shark/product' cd linux_amd64_shark/product && ./test_gamma java full version "1.6.0_20-b20" java version "1.6.0_20" OpenJDK Runtime Environment (IcedTea6 1.10pre) (6b20-1.10~pre2-0ubuntu2) OpenJDK 64-Bit Shark VM (build 19.0-b06, mixed mode) 1. A1 B5 C8 D6 E3 F7 G2 H4 2. A1 B6 C8 D3 E7 F4 G2 H5 [...] 77. A6 B4 C2 D8 E5 F7 G1 H3 78. A6 B4 C7 D1 E# # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (os_linux_zero.cpp:236), pid=714, tid=47829536597344 # fatal error: caught unhandled signal 11 # # JRE version: 6.0_20-b20 # Java VM: OpenJDK 64-Bit Shark VM (19.0-b06 mixed mode linux-amd64 ) # Derivative: IcedTea6 1.10pre # Distribution: Ubuntu natty (development branch), package 6b20-1.10~pre2-0ubuntu2 # An error report file with more information is saved as: # /build/buildd/openjdk-6-6b20-1.10~pre2/build/zerovm/openjdk.build/hotspot/outputdir/linux_amd64_shark/product/hs_err_pid714.log # # If you would like to submit a bug report, please include # instructions how to reproduce the bug and visit: # https://bugs.launchpad.net/ubuntu/+source/openjdk-6/ # Aborted make[7]: *** [productshark] Error 134 make[7]: Leaving directory `/build/buildd/openjdk-6-6b20-1.10~pre2/build/zerovm/openjdk.build/hotspot/outputdir' make[6]: *** [generic_buildshark] Error 2 make[6]: Leaving directory `/build/buildd/openjdk-6-6b20-1.10~pre2/build/zerovm/openjdk/hotspot/make' make[5]: *** [productshark] Error 2 make[5]: Leaving directory `/build/buildd/openjdk-6-6b20-1.10~pre2/build/zerovm/openjdk/hotspot/make' make[4]: *** [hotspot-build] Error 2 -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From omajid at redhat.com Fri Oct 29 09:21:56 2010 From: omajid at redhat.com (Omair Majid) Date: Fri, 29 Oct 2010 12:21:56 -0400 Subject: [icedtea-web] RFC: use the new configuration file for infrastructure settings Message-ID: <4CCAF4A4.10303@redhat.com> Hi, The attached patch integrates the "infrastructure" part of the deployment properties into netx/icedteanpplugin. ChangeLog: 2010-10-29 Omair Majid * netx/net/sourceforge/jnlp/Launcher.java (markNetxRunning): Get file name from configuration. (markNetxStopped): Likewise. * netx/net/sourceforge/jnlp/cache/CacheUtil.java (clearCache): Get cache directory from configuration. (okToClearCache): Get netx_running file from configuration. (getCacheFile): Get cache directory from configuration. (urlToPath): Change semantics to take in the full path of the directory instead of a directory under runtime. * netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java: Change DEPLOYMENT_DIR to ".icedtea". Add constants KEY_USER_CACHE_DIR, KEY_USER_PERSISTENCE_CACHE_DIR, KEY_SYSTEM_CACHE_DIR, KEY_USER_LOG_DIR, KEY_USER_TMP_DIR, KEY_USER_LOCKS_DIR, and KEY_USER_NETX_RUNNING_FILE. (load): Use DEPLOYMENT_DIR instead of hardcoded string. (loadDefaultProperties): Add LOCKS_DIR. Replace strings with constants. Add new default values for persistence cache directory, single instance locks directory and the netx_running file. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Remove unneeded TMP_DIR, LOCKS_DIR and NETX_RUNNING_FILE * netx/net/sourceforge/jnlp/services/SingleInstanceLock.java (getLockFile): Get locks directory from configuration. * netx/net/sourceforge/jnlp/services/XPersistenceService.java (toCacheFile): Get persistence cache directory from configuration. * netx/net/sourceforge/jnlp/util/XDesktopEntry.java (getContentsAsReader): Get cache directory from configuration. (installDesktopLauncher): Get temporary directory from configuration. Make parent directories if required. * plugin/icedteanp/java/sun/applet/JavaConsole.java (initialize): Get log directory from configuration and create the error and output files under it. * plugin/icedteanp/java/sun/applet/PluginMain.java: PLUGIN_STDERR_FILE and PLUGIN_STDOUT_FILE are now just filesnames. (PluginMain): Use configuration for finding the log directory. Initialize JNLPRuntime before creating the stderr and stdout logs. Any comments? Thanks, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-web-integrate-configuration-global-01.patch Type: text/x-patch Size: 18873 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101029/2e19afae/icedtea-web-integrate-configuration-global-01.patch From ptisnovs at redhat.com Fri Oct 29 09:26:10 2010 From: ptisnovs at redhat.com (Pavel Tisnovsky) Date: Fri, 29 Oct 2010 18:26:10 +0200 Subject: Regression test for non-Latin character rendering Message-ID: <4CCAF5A2.8010803@redhat.com> Hi all, I created regression test (reproducer) for RH bug https://bugzilla.redhat.com/show_bug.cgi?id=643674 This regression test checks if all required fonts are properly installed and that *.src.properties font configuration file is correct for given system (Debian, Fedora, Ubuntu, SuSE...). The test is based on rendering certain characters from selected code pages into BufferedImage. When the required font does not exists or font configuration is broken in any way, only empty rectangle is rendered instead of the selected character shape. This rectangle is filtered and then the destination image is tested whether it is empty or almost empty (ie if it contains only white area). White area means that selected character is not correctly rendered and vice versa. If test images with rendered characters needs to be created, please use the following flag: -create-images (name of each image start with character code) Is it ok to push this test (as patch) to IcedTea6 HEAD? (I'd like to push it to OpenJDK6 & OpenJDK7, but it takes some time to get approved...) Cheers, Pavel -------------- next part -------------- A non-text attachment was scrubbed... Name: InternationalFontsRendering.java Type: text/x-java Size: 7106 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20101029/833b02fb/InternationalFontsRendering.java From pcpa at mandriva.com.br Fri Oct 29 12:17:05 2010 From: pcpa at mandriva.com.br (Paulo =?iso-8859-1?Q?C=E9sar_Pereira_de_Andrade?=) Date: Fri, 29 Oct 2010 17:17:05 -0200 Subject: About recent Security Advisories In-Reply-To: <4CC6A6A5.7090806@oracle.com> References: <1ab27589b677c9b998f32f365fbb41a5.squirrel@webmail.conectiva.com.br> <4CC6A6A5.7090806@oracle.com> Message-ID: <107c13edfd9aa5c2c0c23898d4b3ccbf.squirrel@webmail.mandriva.com.br> Dalibor Topic wrote: > On 10/25/10 9:31 PM, Paulo C?sar Pereira de Andrade wrote: Hi again :-) I did some more work/tests on a possible updated package. I am trying to correct some issues with the jmol applet in the sagemath notebook, as this is the reason I started doing some work on the openjdk package... I had it somewhat usable with icedtea-1.8.1, and almost got it to be in an usable state with icedtea-1.8.2. One problem is that opendjdk does not allow popups, but sun-java allows it, at least for connections to localhost. Because of that, I had previously changed the package to use signed jars, and due to that, I needed to patch the scripts because when using signed jars, it would search files from the root directory, but now in icedtea-1.8.2 it does not, and I need to use unsigned jars again, bad that should be better as now it should have better compatibility with sun-java. So far, with this patch I almost got things to work, but without popups in the applet: -%<- cat /home/pcpa/mandriva/svn/java-1.6.0-openjdk/SOURCES/icedtea6-1.8.2-mutex_and_leak.patch diff -p -up icedtea6-1.8.2/plugin/icedteanp/IcedTeaNPPlugin.cc.orig icedtea6-1.8.2/plugin/icedteanp/IcedTeaNPPlugin.cc --- icedtea6-1.8.2/plugin/icedteanp/IcedTeaNPPlugin.cc.orig 2010-10-29 16:01:16.842506014 -0200 +++ icedtea6-1.8.2/plugin/icedteanp/IcedTeaNPPlugin.cc 2010-10-29 16:20:23.627505837 -0200 @@ -412,7 +412,9 @@ void start_jvm_if_needed() // This is asynchronized function. It must // have exclusivity when running. - GMutex *vm_start_mutex = g_mutex_new(); + static GMutex *vm_start_mutex; + if (vm_start_mutex == NULL) + vm_start_mutex = g_mutex_new(); g_mutex_lock(vm_start_mutex); PLUGIN_DEBUG("Checking JVM status...\n"); @@ -421,6 +423,7 @@ void start_jvm_if_needed() if (jvm_up) { PLUGIN_DEBUG("JVM is up. Returning.\n"); + g_mutex_unlock(vm_start_mutex); return; } diff -p -up icedtea6-1.8.2/plugin/icedteanp/IcedTeaPluginUtils.cc.orig icedtea6-1.8.2/plugin/icedteanp/IcedTeaPluginUtils.cc --- icedtea6-1.8.2/plugin/icedteanp/IcedTeaPluginUtils.cc.orig 2010-10-29 16:05:34.780507206 -0200 +++ icedtea6-1.8.2/plugin/icedteanp/IcedTeaPluginUtils.cc 2010-10-29 16:31:36.731506939 -0200 @@ -1029,6 +1029,7 @@ MessageBus::post(const char* message) PLUGIN_DEBUG("Trying to lock %p...\n", &msg_queue_mutex); pthread_mutex_lock(&subscriber_mutex); + pthread_mutex_lock(&msg_queue_mutex); PLUGIN_DEBUG("Message %s received on bus. Notifying subscribers.\n", msg); @@ -1038,10 +1039,14 @@ MessageBus::post(const char* message) message_consumed = ((BusSubscriber*) *i)->newMessageOnBus(msg); } + pthread_mutex_unlock(&msg_queue_mutex); pthread_mutex_unlock(&subscriber_mutex); - if (!message_consumed) + if (!message_consumed) { PLUGIN_DEBUG("Warning: No consumer found for message %s\n", msg); + /* no subscribers */ + free(msg); + } PLUGIN_DEBUG("%p unlocked...\n", &msg_queue_mutex); } -%<- I believe there is some interleaved mutex somewhere, of maybe, it should somehow only return from IcedTeaNPPlugin.cc:plugin_send_message_to_appletviewer() after having some kind of ack that the message was processed. It is almost running in the sense that with the above patch, I can open a few 3d graphics on a sagemath notebook, but usually it will lock hard soon or later. If anybody have hints, what should be an acceptable solution is: o Kill any previous applets when starting a new one. o Patching where it disallows popups to allow from localhost connections at least. Any hints where to investigate and/or patch for it? I will do some more debugging and hope to extend the patch above to correct the problems, but it somewhat acceptable now if one opens only one applet and/or run "killall -9 `pidof java`" before the next (last option is not acceptable of course)... Thanks, Paulo >> Hi, >> >> Does http://lwn.net/Articles/410013/ affect recent openjdk and/or b18 >> in some way? > > Hi, > > the patches have been pushed into OpenJDK 6, and have made their way > downstream as > well, afaik. > > cheers, > dalibor topic > > -- > Oracle > Dalibor Topic | Java F/OSS Ambassador > Phone: +494023646738 | | | Mobile: +491772664192 > > Oracle Java Platform Group > > ORACLE Deutschland B.V. & Co. KG | Nagelsweg 55 | 20097 Hamburg > > ORACLE Deutschland B.V. & Co. KG > Hauptverwaltung: Riesstr. 25, D-80992 M?nchen > Registergericht: Amtsgericht M?nchen, HRA 95603 > > Komplement?rin: ORACLE Deutschland Verwaltung B.V. > Rijnzathe 6, 3454PV De Meern, Niederlande > Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697 > Gesch?ftsf?hrer: J?rgen Kunz, Marcel van de Molen, Alexander van der Ven > > Green Oracle Oracle is committed to > developing practices and products that help protect the environment > From dbhole at redhat.com Fri Oct 29 12:43:10 2010 From: dbhole at redhat.com (Deepak Bhole) Date: Fri, 29 Oct 2010 15:43:10 -0400 Subject: [icedtea-web] RFC: use the new configuration file for infrastructure settings In-Reply-To: <4CCAF4A4.10303@redhat.com> References: <4CCAF4A4.10303@redhat.com> Message-ID: <20101029194310.GB2057@redhat.com> * Omair Majid [2010-10-29 12:39]: > Hi, > > The attached patch integrates the "infrastructure" part of the > deployment properties into netx/icedteanpplugin. > Looks fine to me. Please make sure this is very well tested though. Things like cache are critical parts of the code... Ok for HEAD assuming it has undergone edge case testing. Cheers, Deepak > ChangeLog: > > 2010-10-29 Omair Majid > > * netx/net/sourceforge/jnlp/Launcher.java > (markNetxRunning): Get file name from configuration. > (markNetxStopped): Likewise. > * netx/net/sourceforge/jnlp/cache/CacheUtil.java > (clearCache): Get cache directory from configuration. > (okToClearCache): Get netx_running file from configuration. > (getCacheFile): Get cache directory from configuration. > (urlToPath): Change semantics to take in the full path of the > directory instead of a directory under runtime. > * netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java: > Change DEPLOYMENT_DIR to ".icedtea". Add constants > KEY_USER_CACHE_DIR, KEY_USER_PERSISTENCE_CACHE_DIR, > KEY_SYSTEM_CACHE_DIR, KEY_USER_LOG_DIR, KEY_USER_TMP_DIR, > KEY_USER_LOCKS_DIR, and KEY_USER_NETX_RUNNING_FILE. > (load): Use DEPLOYMENT_DIR instead of hardcoded string. > (loadDefaultProperties): Add LOCKS_DIR. Replace strings with > constants. Add new default values for persistence cache directory, > single instance locks directory and the netx_running file. > * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Remove > unneeded TMP_DIR, LOCKS_DIR and NETX_RUNNING_FILE > * netx/net/sourceforge/jnlp/services/SingleInstanceLock.java > (getLockFile): Get locks directory from configuration. > * netx/net/sourceforge/jnlp/services/XPersistenceService.java > (toCacheFile): Get persistence cache directory from configuration. > * netx/net/sourceforge/jnlp/util/XDesktopEntry.java > (getContentsAsReader): Get cache directory from configuration. > (installDesktopLauncher): Get temporary directory from > configuration. Make parent directories if required. > * plugin/icedteanp/java/sun/applet/JavaConsole.java > (initialize): Get log directory from configuration and create the > error and output files under it. > * plugin/icedteanp/java/sun/applet/PluginMain.java: > PLUGIN_STDERR_FILE and PLUGIN_STDOUT_FILE are now just filesnames. > (PluginMain): Use configuration for finding the log directory. > Initialize JNLPRuntime before creating the stderr and stdout logs. > > Any comments? > > Thanks, > Omair > diff -r 3571cd24829e netx/net/sourceforge/jnlp/Launcher.java > --- a/netx/net/sourceforge/jnlp/Launcher.java Thu Oct 28 16:18:36 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/Launcher.java Fri Oct 29 11:48:26 2010 -0400 > @@ -43,6 +43,7 @@ > import net.sourceforge.jnlp.runtime.AppThreadGroup; > import net.sourceforge.jnlp.runtime.AppletInstance; > import net.sourceforge.jnlp.runtime.ApplicationInstance; > +import net.sourceforge.jnlp.runtime.DeploymentConfiguration; > import net.sourceforge.jnlp.runtime.JNLPClassLoader; > import net.sourceforge.jnlp.runtime.JNLPRuntime; > import net.sourceforge.jnlp.services.InstanceExistsException; > @@ -724,7 +725,8 @@ > try { > String message = "This file is used to check if netx is running"; > > - File netxRunningFile = new File(JNLPRuntime.NETX_RUNNING_FILE); > + File netxRunningFile = new File(JNLPRuntime.getConfiguration() > + .getProperty(DeploymentConfiguration.KEY_USER_NETX_RUNNING_FILE)); > netxRunningFile.getParentFile().mkdirs(); > if (netxRunningFile.createNewFile()) { > FileOutputStream fos = new FileOutputStream(netxRunningFile); > @@ -749,7 +751,7 @@ > if (fileLock != null && fileLock.isShared()) { > if (JNLPRuntime.isDebug()) { > System.out.println("Acquired shared lock on " + > - JNLPRuntime.NETX_RUNNING_FILE + " to indicate javaws is running"); > + netxRunningFile.toString() + " to indicate javaws is running"); > } > } else { > fileLock = null; > @@ -773,7 +775,9 @@ > fileLock.channel().close(); > fileLock = null; > if (JNLPRuntime.isDebug()) { > - System.out.println("Release shared lock on " + JNLPRuntime.NETX_RUNNING_FILE); > + String file = JNLPRuntime.getConfiguration() > + .getProperty(DeploymentConfiguration.KEY_USER_NETX_RUNNING_FILE); > + System.out.println("Release shared lock on " + file); > } > } catch (IOException e) { > e.printStackTrace(); > diff -r 3571cd24829e netx/net/sourceforge/jnlp/cache/CacheUtil.java > --- a/netx/net/sourceforge/jnlp/cache/CacheUtil.java Thu Oct 28 16:18:36 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/cache/CacheUtil.java Fri Oct 29 11:48:26 2010 -0400 > @@ -141,7 +141,8 @@ > return; > } > > - File cacheDir = new File(JNLPRuntime.getBaseDir() + File.separator + "cache"); > + File cacheDir = new File(JNLPRuntime.getConfiguration() > + .getProperty(DeploymentConfiguration.KEY_USER_CACHE_DIR)); > if (!(cacheDir.isDirectory())) { > return; > } > @@ -150,7 +151,8 @@ > System.err.println("Clearing cache directory: " + cacheDir); > } > try { > - FileUtils.recursiveDelete(cacheDir, JNLPRuntime.getBaseDir()); > + cacheDir = cacheDir.getCanonicalFile(); > + FileUtils.recursiveDelete(cacheDir, cacheDir); > } catch (IOException e) { > throw new RuntimeException(e); > } > @@ -161,7 +163,8 @@ > * @return true if the cache can be cleared at this time without problems > */ > private static boolean okToClearCache() { > - File otherJavawsRunning = new File(JNLPRuntime.NETX_RUNNING_FILE); > + File otherJavawsRunning = new File(JNLPRuntime.getConfiguration() > + .getProperty(DeploymentConfiguration.KEY_USER_NETX_RUNNING_FILE)); > try { > if (otherJavawsRunning.isFile()) { > FileOutputStream fis = new FileOutputStream(otherJavawsRunning); > @@ -289,7 +292,9 @@ > throw new IllegalArgumentException(R("CNotCacheable", source)); > > try { > - File localFile = urlToPath(source, "cache"); > + String cacheDir = JNLPRuntime.getConfiguration() > + .getProperty(DeploymentConfiguration.KEY_USER_CACHE_DIR); > + File localFile = urlToPath(source, cacheDir); > localFile.getParentFile().mkdirs(); > > return localFile; > @@ -345,20 +350,23 @@ > } > > /** > - * Converts a URL into a local path string within the runtime's > - * base directory. > + * Converts a URL into a local path string within the given directory. For > + * example a url with subdirectory /tmp/ will > + * result in a File that is located somewhere within /tmp/ > * > * @param location the url > - * @param subdir subdirectory under the base directory > + * @param subdir the subdirectory > * @return the file > */ > public static File urlToPath(URL location, String subdir) { > + if (subdir == null) { > + throw new NullPointerException(); > + } > + > StringBuffer path = new StringBuffer(); > > - if (subdir != null) { > - path.append(subdir); > - path.append(File.separatorChar); > - } > + path.append(subdir); > + path.append(File.separatorChar); > > path.append(location.getProtocol()); > path.append(File.separatorChar); > @@ -366,7 +374,7 @@ > path.append(File.separatorChar); > path.append(location.getPath().replace('/', File.separatorChar)); > > - return new File(JNLPRuntime.getBaseDir(), FileUtils.sanitizePath(path.toString())); > + return new File(FileUtils.sanitizePath(path.toString())); > } > > > diff -r 3571cd24829e netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java > --- a/netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java Thu Oct 28 16:18:36 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java Fri Oct 29 11:48:26 2010 -0400 > @@ -28,6 +28,7 @@ > import java.io.Reader; > import java.net.MalformedURLException; > import java.net.URL; > +import java.nio.channels.FileLock; > import java.util.HashMap; > import java.util.Map; > import java.util.Properties; > @@ -98,7 +99,7 @@ > } > } > > - public static final String DEPLOYMENT_DIR = ".netx"; > + public static final String DEPLOYMENT_DIR = ".icedtea"; > public static final String DEPLOYMENT_CONFIG = "deployment.config"; > public static final String DEPLOYMENT_PROPERTIES = "deployment.properties"; > > @@ -125,6 +126,22 @@ > public static final int PROXY_TYPE_AUTO = 2; > public static final int PROXY_TYPE_BROWSER = 3; > > + public static final String KEY_USER_CACHE_DIR = "deployment.user.cachedir"; > + public static final String KEY_USER_PERSISTENCE_CACHE_DIR = "deployment.user.pcachedir"; > + public static final String KEY_SYSTEM_CACHE_DIR = "deployment.system.cachedir"; > + public static final String KEY_USER_LOG_DIR = "deployment.user.logdir"; > + public static final String KEY_USER_TMP_DIR = "deployment.user.tmp"; > + /** the directory containing locks for single instance applications */ > + public static final String KEY_USER_LOCKS_DIR = "deployment.user.locksdir"; > + /** > + * The netx_running file is used to indicate if any instances of netx are > + * running (this file may exist even if no instances are running). All netx > + * instances acquire a shared lock on this file. If this file can be locked > + * (using a {@link FileLock}) in exclusive mode, then other netx instances > + * are not running > + */ > + public static final String KEY_USER_NETX_RUNNING_FILE = "deployment.user.runningfile"; > + > public enum ConfigType { > System, User > } > @@ -156,7 +173,7 @@ > */ > public void load() throws ConfigurationException { > // make sure no state leaks if security check fails later on > - File userFile = new File(System.getProperty("user.home") + File.separator + ".netx" > + File userFile = new File(System.getProperty("user.home") + File.separator + DEPLOYMENT_DIR > + File.separator + DEPLOYMENT_PROPERTIES); > > SecurityManager sm = System.getSecurityManager(); > @@ -277,6 +294,10 @@ > final String USER_HOME = System.getProperty("user.home") + File.separator + DEPLOYMENT_DIR; > final String USER_SECURITY = USER_HOME + File.separator + "security"; > > + final String LOCKS_DIR = System.getProperty("java.io.tmpdir") + File.separator > + + System.getProperty("user.name") + File.separator + "netx" + File.separator > + + "locks"; > + > /* > * This is more or less a straight copy from the deployment > * configuration page, with occasional replacements of "" or no-defaults > @@ -285,10 +306,13 @@ > > String[][] defaults = new String[][] { > /* infrastructure */ > - { "deployment.user.cachedir", USER_HOME + File.separator + "cache" }, > - { "deployment.system.cachedir", null }, > - { "deployment.user.logdir", USER_HOME + File.separator + "log" }, > - { "deployment.user.tmp", USER_HOME + File.separator + "tmp" }, > + { KEY_USER_CACHE_DIR, USER_HOME + File.separator + "cache" }, > + { KEY_USER_PERSISTENCE_CACHE_DIR, USER_HOME + File.separator + "pcache" }, > + { KEY_SYSTEM_CACHE_DIR, null }, > + { KEY_USER_LOG_DIR, USER_HOME + File.separator + "log" }, > + { KEY_USER_TMP_DIR, USER_HOME + File.separator + "tmp" }, > + { KEY_USER_LOCKS_DIR, LOCKS_DIR }, > + { KEY_USER_NETX_RUNNING_FILE, LOCKS_DIR + File.separator + "netx_running" }, > /* certificates and policy files */ > { "deployment.user.security.policy", "file://" + USER_SECURITY + File.separator + "java.policy" }, > { "deployment.user.security.trusted.cacerts", USER_SECURITY + File.separator + "trusted.cacerts" }, > diff -r 3571cd24829e netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Thu Oct 28 16:18:36 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Fri Oct 29 11:48:26 2010 -0400 > @@ -132,25 +132,6 @@ > /** the ~/.netx/security/trusted.certs file containing trusted certificates */ > public static final String CERTIFICATES_FILE = SECURITY_DIR + File.separator + "trusted.certs"; > > - /** the /tmp/ directory used for temporary files */ > - public static final String TMP_DIR = System.getProperty("java.io.tmpdir"); > - > - /** > - * the /tmp/$USER/netx/locks/ directory containing locks for single instance > - * applications > - */ > - public static final String LOCKS_DIR = TMP_DIR + File.separator + USER + File.separator > - + "netx" + File.separator + "locks"; > - > - /** > - * The /tmp/$USER/netx/locks/netx_running file is used to indicate if any > - * instances of netx are running (this file may exist even if no instances > - * are running). All netx instances acquire a shared lock on this file. If > - * this file can be locked (using a {@link FileLock}) in exclusive mode, then > - * other netx instances are not running > - */ > - public static final String NETX_RUNNING_FILE = LOCKS_DIR + File.separator + "netx_running"; > - > /** the java.home directory */ > public static final String JAVA_HOME_DIR = System.getProperty("java.home"); > > diff -r 3571cd24829e netx/net/sourceforge/jnlp/services/SingleInstanceLock.java > --- a/netx/net/sourceforge/jnlp/services/SingleInstanceLock.java Thu Oct 28 16:18:36 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/services/SingleInstanceLock.java Fri Oct 29 11:48:26 2010 -0400 > @@ -28,6 +28,7 @@ > import java.net.ServerSocket; > > import net.sourceforge.jnlp.JNLPFile; > +import net.sourceforge.jnlp.runtime.DeploymentConfiguration; > import net.sourceforge.jnlp.runtime.JNLPRuntime; > import net.sourceforge.jnlp.util.FileUtils; > > @@ -128,7 +129,8 @@ > * may or may not exist. > */ > private File getLockFile() { > - File baseDir = new File(JNLPRuntime.LOCKS_DIR); > + File baseDir = new File(JNLPRuntime.getConfiguration() > + .getProperty(DeploymentConfiguration.KEY_USER_LOCKS_DIR)); > > if (!baseDir.isDirectory() && !baseDir.mkdirs()) { > throw new RuntimeException(R("RNoLockDir", baseDir)); > diff -r 3571cd24829e netx/net/sourceforge/jnlp/services/XPersistenceService.java > --- a/netx/net/sourceforge/jnlp/services/XPersistenceService.java Thu Oct 28 16:18:36 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/services/XPersistenceService.java Fri Oct 29 11:48:26 2010 -0400 > @@ -80,7 +80,9 @@ > * @return the file > */ > protected File toCacheFile(URL location) throws MalformedURLException { > - return CacheUtil.urlToPath(location, "pcache"); > + String pcache = JNLPRuntime.getConfiguration() > + .getProperty(DeploymentConfiguration.KEY_USER_PERSISTENCE_CACHE_DIR); > + return CacheUtil.urlToPath(location, pcache); > } > > /** > diff -r 3571cd24829e netx/net/sourceforge/jnlp/util/XDesktopEntry.java > --- a/netx/net/sourceforge/jnlp/util/XDesktopEntry.java Thu Oct 28 16:18:36 2010 -0400 > +++ b/netx/net/sourceforge/jnlp/util/XDesktopEntry.java Fri Oct 29 11:48:26 2010 -0400 > @@ -32,6 +32,7 @@ > import net.sourceforge.jnlp.StreamEater; > import net.sourceforge.jnlp.cache.CacheUtil; > import net.sourceforge.jnlp.cache.UpdatePolicy; > +import net.sourceforge.jnlp.runtime.DeploymentConfiguration; > import net.sourceforge.jnlp.runtime.JNLPRuntime; > > /** > @@ -73,7 +74,9 @@ > > String pathToJavaws = System.getProperty("java.home") + File.separator + "bin" > + File.separator + "javaws"; > - File cacheFile = CacheUtil.urlToPath(file.getSourceLocation(), "cache"); > + String cacheDir = JNLPRuntime.getConfiguration() > + .getProperty(DeploymentConfiguration.KEY_USER_CACHE_DIR); > + File cacheFile = CacheUtil.urlToPath(file.getSourceLocation(), cacheDir); > > String fileContents = "[Desktop Entry]\n"; > fileContents += "Version=1.0\n"; > @@ -131,10 +134,14 @@ > * Install this XDesktopEntry into the user's desktop as a launcher > */ > private void installDesktopLauncher() { > - File shortcutFile = new File(JNLPRuntime.TMP_DIR + File.separator > - + FileUtils.sanitizeFileName(file.getTitle()) + ".desktop"); > + File shortcutFile = new File(JNLPRuntime.getConfiguration() > + .getProperty(DeploymentConfiguration.KEY_USER_TMP_DIR) > + + File.separator + FileUtils.sanitizeFileName(file.getTitle()) + ".desktop"); > try { > > + if (!shortcutFile.getParentFile().isDirectory() && !shortcutFile.getParentFile().mkdirs()) { > + throw new IOException(shortcutFile.getParentFile().toString()); > + } > /* > * Write out a Java String (UTF-16) as a UTF-8 file > */ > diff -r 3571cd24829e plugin/icedteanp/java/sun/applet/JavaConsole.java > --- a/plugin/icedteanp/java/sun/applet/JavaConsole.java Thu Oct 28 16:18:36 2010 -0400 > +++ b/plugin/icedteanp/java/sun/applet/JavaConsole.java Fri Oct 29 11:48:26 2010 -0400 > @@ -63,6 +63,9 @@ > import javax.swing.border.EmptyBorder; > import javax.swing.border.TitledBorder; > > +import net.sourceforge.jnlp.runtime.DeploymentConfiguration; > +import net.sourceforge.jnlp.runtime.JNLPRuntime; > + > /** > * A simple Java console for IcedTeaPlugin > * > @@ -86,6 +89,8 @@ > e.printStackTrace(); > } > > + final String logDir = JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_USER_LOG_DIR); > + > consoleWindow = new JFrame("Java Console"); > > JPanel contentPanel = new JPanel(); > @@ -104,7 +109,7 @@ > stdOutText.setEditable(false); > stdOutText.setFont(monoSpace); > > - TextAreaUpdater stdOutUpdater = new TextAreaUpdater(new File( > + TextAreaUpdater stdOutUpdater = new TextAreaUpdater(new File(logDir, > PluginMain.PLUGIN_STDOUT_FILE), stdOutText); > stdOutUpdater.setName("IcedteaPlugin Console Thread(System.out)"); > > @@ -117,7 +122,7 @@ > stdErrText.setEditable(false); > stdErrText.setFont(monoSpace); > > - TextAreaUpdater stdErrUpdater = new TextAreaUpdater(new File( > + TextAreaUpdater stdErrUpdater = new TextAreaUpdater(new File(logDir, > PluginMain.PLUGIN_STDERR_FILE), stdErrText); > stdErrUpdater.setName("IcedteaPlugin Console Thread(System.err)"); > > diff -r 3571cd24829e plugin/icedteanp/java/sun/applet/PluginMain.java > --- a/plugin/icedteanp/java/sun/applet/PluginMain.java Thu Oct 28 16:18:36 2010 -0400 > +++ b/plugin/icedteanp/java/sun/applet/PluginMain.java Fri Oct 29 11:48:26 2010 -0400 > @@ -80,6 +80,8 @@ > import javax.net.ssl.SSLSocketFactory; > import javax.net.ssl.TrustManager; > > +import net.sourceforge.jnlp.runtime.DeploymentConfiguration; > +import net.sourceforge.jnlp.runtime.JNLPRuntime; > import net.sourceforge.jnlp.security.VariableX509TrustManager; > > /** > @@ -87,10 +89,9 @@ > */ > public class PluginMain > { > - > // the files where stdout/stderr are sent to > - public static final String PLUGIN_STDERR_FILE = System.getProperty("user.home") + "/.icedteaplugin/java.stderr"; > - public static final String PLUGIN_STDOUT_FILE = System.getProperty("user.home") + "/.icedteaplugin/java.stdout"; > + public static final String PLUGIN_STDERR_FILE = "java.stderr"; > + public static final String PLUGIN_STDOUT_FILE = "java.stdout"; > > final boolean redirectStreams = System.getenv().containsKey("ICEDTEAPLUGIN_DEBUG"); > static PluginStreamHandler streamHandler; > @@ -123,16 +124,6 @@ > > public PluginMain(String inPipe, String outPipe) { > > - try { > - File errFile = new File(PLUGIN_STDERR_FILE); > - File outFile = new File(PLUGIN_STDOUT_FILE); > - > - System.setErr(new TeeOutputStream(new FileOutputStream(errFile), System.err)); > - System.setOut(new TeeOutputStream(new FileOutputStream(outFile), System.out)); > - } catch (Exception e) { > - PluginDebug.debug("Unable to redirect streams"); > - e.printStackTrace(); > - } > > connect(inPipe, outPipe); > > @@ -141,6 +132,20 @@ > securityContext.setStreamhandler(streamHandler); > AppletSecurityContextManager.addContext(0, securityContext); > > + String logDir = JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_USER_LOG_DIR); > + try { > + File errFile = new File(logDir, PLUGIN_STDERR_FILE); > + errFile.getParentFile().mkdirs(); > + File outFile = new File(logDir, PLUGIN_STDOUT_FILE); > + outFile.getParentFile().mkdirs(); > + > + System.setErr(new TeeOutputStream(new FileOutputStream(errFile), System.err)); > + System.setOut(new TeeOutputStream(new FileOutputStream(outFile), System.out)); > + } catch (Exception e) { > + PluginDebug.debug("Unable to redirect streams"); > + e.printStackTrace(); > + } > + > PluginAppletViewer.setStreamhandler(streamHandler); > PluginAppletViewer.setPluginCallRequestFactory(new PluginCallRequestFactory()); > From omajid at icedtea.classpath.org Fri Oct 29 14:40:44 2010 From: omajid at icedtea.classpath.org (omajid at icedtea.classpath.org) Date: Fri, 29 Oct 2010 21:40:44 +0000 Subject: /hg/icedtea-web: Parse jnlps containing as well... Message-ID: changeset 499642ab12a6 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=499642ab12a6 author: Omair Majid date: Fri Oct 29 17:40:16 2010 -0400 Parse jnlps containing as well as elements 2010-10-29 Omair Majid * netx/net/sourceforge/jnlp/JNLPFile.java: Add component. (getLaunchInfo): Modify javadoc to indicate that it does not return the ComponentDesc. (getComponent): Return component instead of launchType. (isComponent): Check if component is not null. (parse): Find and set component descriptor. * netx/net/sourceforge/jnlp/Parser.java (getLauncher): Remove all checks for component-desc. Allow having none of application- desc, applet-desc and installer-desc. (getComponent): Check for more than one component-desc element. Read and parse the component-desc. diffstat: 3 files changed, 40 insertions(+), 10 deletions(-) ChangeLog | 14 ++++++++++++++ netx/net/sourceforge/jnlp/JNLPFile.java | 10 +++++++--- netx/net/sourceforge/jnlp/Parser.java | 26 +++++++++++++++++++------- diffs (126 lines): diff -r 3571cd24829e -r 499642ab12a6 ChangeLog --- a/ChangeLog Thu Oct 28 16:18:36 2010 -0400 +++ b/ChangeLog Fri Oct 29 17:40:16 2010 -0400 @@ -1,3 +1,17 @@ 2010-10-28 Omair Majid + + * netx/net/sourceforge/jnlp/JNLPFile.java: Add component. + (getLaunchInfo): Modify javadoc to indicate that it does not return + the ComponentDesc. + (getComponent): Return component instead of launchType. + (isComponent): Check if component is not null. + (parse): Find and set component descriptor. + * netx/net/sourceforge/jnlp/Parser.java + (getLauncher): Remove all checks for component-desc. Allow having + none of application-desc, applet-desc and installer-desc. + (getComponent): Check for more than one component-desc element. + Read and parse the component-desc. + 2010-10-28 Omair Majid * netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java diff -r 3571cd24829e -r 499642ab12a6 netx/net/sourceforge/jnlp/JNLPFile.java --- a/netx/net/sourceforge/jnlp/JNLPFile.java Thu Oct 28 16:18:36 2010 -0400 +++ b/netx/net/sourceforge/jnlp/JNLPFile.java Fri Oct 29 17:40:16 2010 -0400 @@ -94,6 +94,9 @@ public class JNLPFile { /** the application description */ protected Object launchType; + + /** the component description */ + protected ComponentDesc component; /** the security descriptor */ protected SecurityDesc security; @@ -402,7 +405,7 @@ public class JNLPFile { /** * Returns an object of one of the following types: AppletDesc, - * ApplicationDesc, InstallerDesc, and ComponentDesc. + * ApplicationDesc and InstallerDesc */ public Object getLaunchInfo() { return launchType; @@ -441,7 +444,7 @@ public class JNLPFile { if (!isComponent()) throw new UnsupportedOperationException(R("JNotComponent")); - return (ComponentDesc) launchType; + return component; } /** @@ -474,7 +477,7 @@ public class JNLPFile { * Returns whether the lauch descriptor describes a Component. */ public boolean isComponent() { - return launchType instanceof ComponentDesc; + return component != null; } /** @@ -574,6 +577,7 @@ public class JNLPFile { update = parser.getUpdate(root); resources = parser.getResources(root, false); // false == not a j2se/java resources section launchType = parser.getLauncher(root); + component = parser.getComponent(root); security = parser.getSecurity(root); } catch (ParseException ex) { diff -r 3571cd24829e -r 499642ab12a6 netx/net/sourceforge/jnlp/Parser.java --- a/netx/net/sourceforge/jnlp/Parser.java Thu Oct 28 16:18:36 2010 -0400 +++ b/netx/net/sourceforge/jnlp/Parser.java Fri Oct 29 17:40:16 2010 -0400 @@ -598,16 +598,15 @@ class Parser { /** * Returns the launch descriptor element, either AppletDesc, - * ApplicationDesc, ComponentDesc, or InstallerDesc. + * ApplicationDesc, or InstallerDesc. * * @param parent the parent node * @throws ParseException if the JNLP file is invalid */ public Object getLauncher(Node parent) throws ParseException { // check for other than one application type - if (1 != getChildNodes(parent, "applet-desc").length + if (1 < getChildNodes(parent, "applet-desc").length + getChildNodes(parent, "application-desc").length - + getChildNodes(parent, "component-desc").length + getChildNodes(parent, "installer-desc").length) throw new ParseException(R("PTwoDescriptors")); @@ -619,8 +618,6 @@ class Parser { return getApplet(child); if ("application-desc".equals(name)) return getApplication(child); - if ("component-desc".equals(name)) - return getComponent(child); if ("installer-desc".equals(name)) return getInstaller(child); @@ -693,8 +690,23 @@ class Parser { /** * Returns the component descriptor. */ - public ComponentDesc getComponent(Node node) { - return new ComponentDesc(); + public ComponentDesc getComponent(Node parent) throws ParseException { + + if (1 < getChildNodes(parent, "component-desc").length) { + throw new ParseException(R("PTwoDescriptors")); + } + + Node child = parent.getFirstChild(); + while (child != null) { + String name = child.getNodeName(); + + if ("component-desc".equals(name)) + return new ComponentDesc(); + + child = child.getNextSibling(); + } + + return null; } /** From bugzilla-daemon at icedtea.classpath.org Sat Oct 30 07:18:20 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Sat, 30 Oct 2010 14:18:20 +0000 Subject: [Bug 582] New: Openoffice crash due to IcedTea in openSuSE 11.3 Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=582 Summary: Openoffice crash due to IcedTea in openSuSE 11.3 Product: IcedTea Version: 6-1.9 Platform: all OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: IcedTea6 AssignedTo: unassigned at icedtea.classpath.org ReportedBy: joop_boonen at web.de When starting up openoffice it crashed due to Icedtea. I've attached the log. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Sat Oct 30 07:19:14 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Sat, 30 Oct 2010 14:19:14 +0000 Subject: [Bug 582] Openoffice crash due to IcedTea in openSuSE 11.3 Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=582 ------- Comment #1 from joop_boonen at web.de 2010-10-30 14:19 ------- Created an attachment (id=431) --> (http://icedtea.classpath.org/bugzilla/attachment.cgi?id=431&action=view) Error log. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From liuqi at icedtea.classpath.org Sat Oct 30 23:19:27 2010 From: liuqi at icedtea.classpath.org (liuqi at icedtea.classpath.org) Date: Sun, 31 Oct 2010 06:19:27 +0000 Subject: /hg/openjdk6-mips: Fix a bug in FrameMap::nr2floatreg. Message-ID: changeset d2a6a000ff33 in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=d2a6a000ff33 author: YANG Yongqiang date: Sat Oct 30 17:47:17 2010 +0800 Fix a bug in FrameMap::nr2floatreg. In FrameMap::nr2floatreg, it is wrong that multiplying 2 to the argument rnr. diffstat: 4 files changed, 30 insertions(+), 92 deletions(-) hotspot/src/cpu/mips/vm/c1_FrameMap_mips.cpp | 2 hotspot/src/cpu/mips/vm/c1_Runtime1_mips.cpp | 23 ++++--- hotspot/src/cpu/mips/vm/sharedRuntime_mips.cpp | 25 +++----- hotspot/src/cpu/mips/vm/templateTable_mips.cpp | 72 ++---------------------- diffs (256 lines): diff -r 85b046e5468b -r d2a6a000ff33 hotspot/src/cpu/mips/vm/c1_FrameMap_mips.cpp --- a/hotspot/src/cpu/mips/vm/c1_FrameMap_mips.cpp Thu Oct 28 11:07:44 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/c1_FrameMap_mips.cpp Sat Oct 30 17:47:17 2010 +0800 @@ -166,7 +166,7 @@ FloatRegister FrameMap::nr2floatreg (int FloatRegister FrameMap::nr2floatreg (int rnr) { assert(_init_done, "tables not initialized"); debug_only(fpu_range_check(rnr);) - return _fpu_regs[rnr*2]; + return _fpu_regs[rnr]; } // returns true if reg could be smashed by a callee. diff -r 85b046e5468b -r d2a6a000ff33 hotspot/src/cpu/mips/vm/c1_Runtime1_mips.cpp --- a/hotspot/src/cpu/mips/vm/c1_Runtime1_mips.cpp Thu Oct 28 11:07:44 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/c1_Runtime1_mips.cpp Sat Oct 30 17:47:17 2010 +0800 @@ -323,17 +323,18 @@ static void restore_live_registers(StubA } static void restore_live_registers_except_V0(StubAssembler* sasm, bool restore_fpu_registers = true) { - //static void restore_live_registers(MacroAssembler* sasm) { - //FIXME , maybe V1 need to be saved too - __ block_comment("restore_live_registers except V0"); - for (Register r = T0; r != T7->successor(); r = r->successor() ) { - __ lw(r, SP, (r->encoding() - T0->encoding() + T0_off) * wordSize); - } - for (Register r = S0; r != S7->successor(); r = r->successor() ) { - __ lw(r, SP, (r->encoding() - S0->encoding() + S0_off) * wordSize); - } - __ lw(V1, SP, V1_off * wordSize); - __ addiu(SP, SP, (reg_save_frame_size - 2)* wordSize); + //static void restore_live_registers(MacroAssembler* sasm) { + //FIXME , maybe V1 need to be saved too + __ block_comment("restore_live_registers except V0"); + for (Register r = T0; r != T7->successor(); r = r->successor() ) { + __ lw(r, SP, (r->encoding() - T0->encoding() + T0_off) * wordSize); + } + for (Register r = S0; r != S7->successor(); r = r->successor() ) { + __ lw(r, SP, (r->encoding() - S0->encoding() + S0_off) * wordSize); + } + + __ lw(V1, SP, V1_off * wordSize); + __ addiu(SP, SP, (reg_save_frame_size - 2)* wordSize); } void Runtime1::initialize_pd() { // nothing to do diff -r 85b046e5468b -r d2a6a000ff33 hotspot/src/cpu/mips/vm/sharedRuntime_mips.cpp --- a/hotspot/src/cpu/mips/vm/sharedRuntime_mips.cpp Thu Oct 28 11:07:44 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/sharedRuntime_mips.cpp Sat Oct 30 17:47:17 2010 +0800 @@ -1181,25 +1181,24 @@ int SharedRuntime::c_calling_convention( if(int_reg_cnt == 0){ regs[i].set2(A0->as_VMReg()); int_reg_cnt += 2; - } - else if (int_reg_cnt == 1){ + } else if (int_reg_cnt == 1){ regs[i].set2(A2->as_VMReg()); int_reg_cnt += 3; - }else if(int_reg_cnt == 2){ + } else if (int_reg_cnt == 2){ regs[i].set2(A2->as_VMReg()); int_reg_cnt += 2; - }else if(int_reg_cnt == 3){ + } else if (int_reg_cnt == 3){ regs[i].set2(VMRegImpl::stack2reg(stack)); stack += 2; int_reg_cnt += 1; - }else{ + } else { regs[i].set2(VMRegImpl::stack2reg(stack)); stack += 2; } break; case T_DOUBLE: assert(sig_bt[i+1] == T_VOID, "missing Half" ); - if(f2i==1){ + if(f2i == 1){ if (int_reg_cnt == 1){ regs[i].set2(A2->as_VMReg()); int_reg_cnt += 3; @@ -1214,19 +1213,16 @@ int SharedRuntime::c_calling_convention( regs[i].set2(VMRegImpl::stack2reg(stack)); stack += 2; } - } - else { - if(flt_reg_cnt==0){ + } else { + if(flt_reg_cnt == 0){ regs[i].set2(F12->as_VMReg()); flt_reg_cnt++; int_reg_cnt += 2; - } - else if( flt_reg_cnt==2){ + } else if( flt_reg_cnt == 2){ regs[i].set2(F14->as_VMReg()); flt_reg_cnt++; if(int_reg_cnt<=1)int_reg_cnt += 1; - } - else if(int_reg_cnt == 2){ + } else if(int_reg_cnt == 2){ regs[i].set2(A2->as_VMReg()); int_reg_cnt +=2; }else if(int_reg_cnt == 3){ @@ -1239,7 +1235,6 @@ int SharedRuntime::c_calling_convention( } } - ; break; case T_VOID: regs[i].set_bad(); break; default: @@ -1247,7 +1242,7 @@ int SharedRuntime::c_calling_convention( break; } } - return stack ; + return stack; } int SharedRuntime::c_calling_convention_jni(const BasicType *sig_bt, diff -r 85b046e5468b -r d2a6a000ff33 hotspot/src/cpu/mips/vm/templateTable_mips.cpp --- a/hotspot/src/cpu/mips/vm/templateTable_mips.cpp Thu Oct 28 11:07:44 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/templateTable_mips.cpp Sat Oct 30 17:47:17 2010 +0800 @@ -2779,7 +2779,7 @@ void TemplateTable::resolve_cache_and_in __ get_cache_and_index_at_bcp(Rcache, index, 1); // is resolved? - __ sll(AT, index, 4); + __ sll(AT, index, 4); __ add(AT, Rcache, AT); __ lw(AT, AT, in_bytes(constantPoolCacheOopDesc::base_offset() + ConstantPoolCacheEntry::indices_offset())); @@ -2877,6 +2877,8 @@ void TemplateTable::load_invoke_cp_cache __ sll(AT, index, 4); __ add(AT, cache, AT); __ lw(method, AT, method_offset); + + if (itable_index != NOREG) { //__ sll(AT, index, 4); //__ addu(AT, cache, AT); @@ -3171,7 +3173,7 @@ void TemplateTable::jvmti_post_field_mod // depending on its type. As a result, we must find // the type to determine where the object is. Label two_word, valsize_known; - __ sll(AT, T4, 4); + __ sll(AT, T4, 4); __ add(AT, T1, AT); __ lw(T3, AT, in_bytes(cp_base_offset + ConstantPoolCacheEntry::flags_offset())); @@ -3201,7 +3203,7 @@ void TemplateTable::jvmti_post_field_mod } // cache entry pointer __ addi(T1, T1, in_bytes(cp_base_offset)); - __ shl(T4, 4); + __ shl(T4, 4); __ addu(T1, T1, T4); // object (tos) __ move(T3, SP); @@ -3564,7 +3566,7 @@ void TemplateTable::fast_storefield(TosS __ get_cache_and_index_at_bcp(T3, T2, 1); // test for volatile with edx but edx is tos register for lputfield. - __ sll(AT, T2, 4); + __ sll(AT, T2, 4); __ add(AT, T3, AT); __ lw(T4, AT, in_bytes(base + ConstantPoolCacheEntry::flags_offset())); @@ -3941,15 +3943,10 @@ void TemplateTable::invokevirtual_helper __ verify_oop(method); // It's final, need a null check here! -//jerome_for_debug __ null_check(recv); // profile this call __ profile_final_call(T0); - - //__ lw(T9, method, in_bytes(methodOopDesc::interpreter_entry_offset())); - //__ jr(T9); - //__ delayed(); __ move(T0, recv); __ jump_from_interpreted(method, T4); @@ -3960,55 +3957,6 @@ void TemplateTable::invokevirtual_helper // Keep recv in ecx for callee expects it there __ lw(T4, recv, oopDesc::klass_offset_in_bytes()); __ verify_oop(T4); -//jerome10 -/* - Label nnn; - __ move(AT, 0x80000000); - __ andr(AT, AT, T4); - __ beq(AT, ZERO, nnn); - __ delayed()->nop(); - - __ move(AT, (int)&jerome10 ); - __ sw(ZERO, AT, 0); - - __ move(AT, (int)&jerome1 ); - __ sw(recv, AT, 0); - __ move(AT, (int)&jerome2 ); - __ sw(T4, AT, 0); - __ move(AT, (int)&jerome3 ); -// __ get_thread(T4); - __ sw(RA, AT, 0); - __ move(AT, (int)&jerome4 ); - __ sw(SP, AT, 0); - - __ move(AT, (int)&jerome5 ); - __ sw(FP, AT, 0); - - __ move(AT, (int)&jerome6 ); - __ sw(ZERO, AT, 0); - - __ move(AT, (int)&jerome7 ); - __ sw(ZERO, AT, 0); - - __ move(AT, (int)&jerome8 ); - __ sw(ZERO, AT, 0); - - __ move(AT, (int)&jerome9 ); - __ sw(ZERO, AT, 0); -// __ move(AT, (int)&jerome2 ); -// __ lw(T4, AT, 0); - - __ pushad(); -// __ enter(); - __ call(CAST_FROM_FN_PTR(address, SharedRuntime::print_call_statistics), - relocInfo::runtime_call_type); - __ delayed()->nop(); -// __ leave(); - __ popad(); - - - __ bind(nnn); -*/ // profile this call __ profile_virtual_call(T1, T0, T4); @@ -4017,14 +3965,8 @@ void TemplateTable::invokevirtual_helper assert(vtableEntry::size() * wordSize == 4, "adjust the scaling in the code below"); __ sll(AT, index, 2); __ add(AT, T4, AT); - //this is a ualign read - __ lw(method,AT,base+vtableEntry::method_offset_in_bytes()); - -// __ lhu(method, AT, base+vtableEntry::method_offset_in_bytes()+2); - // __ lhu(T4, AT, base+vtableEntry::method_offset_in_bytes()); - // __ sll(method, method, 16); - // __ addu(method, method, T4); + __ lw(method, AT, base + vtableEntry::method_offset_in_bytes()); __ move(T0, recv); __ jump_from_interpreted(method, T4); From bugzilla-daemon at icedtea.classpath.org Sun Oct 31 04:05:00 2010 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Sun, 31 Oct 2010 11:05:00 +0000 Subject: [Bug 582] Openoffice crash due to IcedTea in openSuSE 11.3 Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=582 joop_boonen at web.de changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID ------- Comment #2 from joop_boonen at web.de 2010-10-31 11:05 ------- Probably related to issue of Untitled document. After deleting the ~/.ooo3 directory where the to be recovered document resides. The issue was resolve. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.