From jvanek at icedtea.classpath.org Fri Feb 1 00:27:46 2013 From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org) Date: Fri, 01 Feb 2013 08:27:46 +0000 Subject: /hg/icedtea-web: Renamed conflict file for case insensitive systems Message-ID: changeset e631770d76ba in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=e631770d76ba author: Jiri Vanek date: Thu Jan 31 11:12:35 2013 +0100 Renamed conflict file for case insensitive systems diffstat: ChangeLog | 10 ++ tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2E.html | 44 ---------- tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2EE.html | 44 ++++++++++ tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java | 2 +- 4 files changed, 55 insertions(+), 45 deletions(-) diffs (125 lines): diff -r 1648b9f9cddf -r e631770d76ba ChangeLog --- a/ChangeLog Wed Jan 30 19:09:09 2013 +0100 +++ b/ChangeLog Thu Jan 31 11:12:35 2013 +0100 @@ -1,3 +1,13 @@ +2013-01-31 Jiri Vanek + + Renamed conflict file for case insensitive systems + * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2E.html: + Renamed to ParallelAppletsTest_1_x_2EE.html + * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2EE.html: + new file. + * tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java: + (testParallelAppletsTest1x2E) adapted to renaming + 2013-01-30 Jiri Vanek Add unit tests for locales and locales fixed diff -r 1648b9f9cddf -r e631770d76ba tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2E.html --- a/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2E.html Wed Jan 30 19:09:09 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ - - -

-

-

-

- - diff -r 1648b9f9cddf -r e631770d76ba tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2EE.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2EE.html Thu Jan 31 11:12:35 2013 +0100 @@ -0,0 +1,44 @@ + + +

+

+

+

+ + diff -r 1648b9f9cddf -r e631770d76ba tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java --- a/tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java Wed Jan 30 19:09:09 2013 +0100 +++ b/tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java Thu Jan 31 11:12:35 2013 +0100 @@ -59,7 +59,7 @@ @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay public void testParallelAppletsTest1x2E() throws Exception { - ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1_x_2E.html"); + ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1_x_2EE.html"); checkExactCounts(1, 10, pr); checkNotInitialised(pr); From jvanek at redhat.com Fri Feb 1 00:36:18 2013 From: jvanek at redhat.com (Jiri Vanek) Date: Fri, 01 Feb 2013 09:36:18 +0100 Subject: [rfc][icedtea-web] Provide names for all unnamed threads In-Reply-To: <510AE6DF.8000408@redhat.com> References: <510AE6DF.8000408@redhat.com> Message-ID: <510B7E82.6080508@redhat.com> On 01/31/2013 10:49 PM, Adam Domurad wrote: > Simple patch, but very nice for debugging/ tooling. This will make it easier to track down specific threads while debugging or using Thermostat. An absolute must IMO for sane debugging of problems occurring in multiple threads. Agree, after one question patch is ok for head and should go also to branches to avoid future patching conflicts. > > 2013-XX-XX Adam Domurad > > Name threads for easier debugging/tooling. Remove 2 erroneous > VoidPluginCallRequest header comments. > * netx/net/sourceforge/jnlp/NetxPanel.java: > Provide name for thread that calls (run). > * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: > Provide name for shutdown hook thread. > * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java: > Remove erroneous VoidPluginCallRequest comment. Provide name for > ConsumerThread thread. > * plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java: > Provide name for worker thread. > * plugin/icedteanp/java/sun/applet/PluginStreamHandler.java: > Remove erroneous VoidPluginCallRequest comment. Provide name for > stream listener thread. > ... > +++ b/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java > @@ -1,4 +1,4 @@ > -/* VoidPluginCallRequest -- represent Java-to-JavaScript requests > +/* VoidPluginCallRequest is supicious, However this, represent Java-to-JavaScript requests looks like it could be right. Asking just for clarification. as it can be useful if it is correct. > Copyright (C) 2008 Red Hat > > This file is part of IcedTea. > @@ -131,6 +131,10 @@ class PluginMessageConsumer { > > protected class ConsumerThread extends Thread { > > + public ConsumerThread() { > + super("PluginMessageConsumer.ConsumerThread"); > + } > + J. From jvanek at redhat.com Fri Feb 1 01:18:09 2013 From: jvanek at redhat.com (Jiri Vanek) Date: Fri, 01 Feb 2013 10:18:09 +0100 Subject: [rfc][icedtea-web] Ensure applet shutdown finishes without exceptions - 1 - npe In-Reply-To: <510AEAC0.2010104@redhat.com> References: <510AEAC0.2010104@redhat.com> Message-ID: <510B8851.80604@redhat.com> On 01/31/2013 11:05 PM, Adam Domurad wrote: > Hi all. Another round of what I think could be important stability fixes for icedtea-web. > > I noticed while doing my unsigned-applet-confirmation patch that JNLPClassLoader instances did not always reach reference-count == 0 when all their instances should have been destroyed. The first part of that was the applet synchronization issue, that I have posted a patch for. > > 3 additional problems fixed here: > > Fixed in npe-fix-and-wait-for-init.patch: > 1.) There was a sometimes-occurring NPE in JNLPClassLoader#getPermisions, when a CodeSource did not have an associated location when an applet was destroyed. This could cause the destroyApplet code to not finish. This was fixed with a simple null check guard. This fixes some spurious exceptions being printed out during shutdown (causing some noise in reproducer system). > > 2.) Applets can actually be destroyed from one thread *in the middle of initialization*, while somewhat hard to reproduce, spamming refresh on a many-applet page inevitably caused it. Luckily a mechanism was already in place for efficiently waiting for applets to initialize. > > > npe-fix-and-wait-for-init.patch changes: > 2013-XX-XX Adam Domurad > > Ensure applet destruction cannot in the middle of initialization. > Prevent NPE that can sometimes occurs (especially with this change). > * netx/net/sourceforge/jnlp/NetxPanel.java > (destroyApplet): wait for applet initialization > * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > (getPermissions): avoid potential NPE if code source location is > missing > > > > npe-fix-and-wait-for-init.patch > > > diff --git a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > @@ -1144,7 +1144,7 @@ public class JNLPClassLoader extends URL > } > > // Class from host X should be allowed to connect to host X > - if (cs.getLocation().getHost().length()> 0) > + if (cs.getLocation() != null&& cs.getLocation().getHost().length()> 0) Here I'm curious, is NPE here because location was not yet initalised, have no chance to get in, its initialisation was corrupted, or is NPE here because its it wa forgotten to be assigned or its creation was somehow skipped? It it is first case then I'm for NPE guard. If it is the second then I'm against, because the consequence is healed and the cause will be rotten later. However still the NPE guard can be last and only hope. > result.add(new SocketPermission(cs.getLocation().getHost(), > "connect, accept")); > > diff --git a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java > --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java > +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java > @@ -587,6 +587,10 @@ public class PluginAppletViewer extends > > private static synchronized void destroyApplet(int identifier) { > > + // We should not try to destroy an applet during > + // initialization. It may cause an inconsistent state. > + waitForAppletInit( applets.get(identifier).panel ); Ok, this have sense. > + > PluginDebug.debug("DestroyApplet called for ", identifier); > > PAV_INIT_STATUS prev = updateStatus(identifier, PAV_INIT_STATUS.DESTROYED); > From gnu.andrew at redhat.com Fri Feb 1 05:30:17 2013 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Fri, 1 Feb 2013 08:30:17 -0500 (EST) Subject: The Death of IcedTea? Message-ID: <211087304.7902585.1359725417697.JavaMail.root@redhat.com> My thoughts on the future of #IcedTea: http://blog.fuseyism.com/index.php/2013/02/01/the-death-of-icedtea/ Thoughts, comments, flames, etc. very much welcomed. Please pass onto others who may be interested. A brief disclaimer that these are my personal thoughts, and not necessarily those of Red Hat. -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From fcassia at gmail.com Fri Feb 1 07:37:52 2013 From: fcassia at gmail.com (Fernando Cassia) Date: Fri, 1 Feb 2013 12:37:52 -0300 Subject: The Death of IcedTea? In-Reply-To: <211087304.7902585.1359725417697.JavaMail.root@redhat.com> References: <211087304.7902585.1359725417697.JavaMail.root@redhat.com> Message-ID: On Fri, Feb 1, 2013 at 10:30 AM, Andrew Hughes wrote: > My thoughts on the future of #IcedTea: http://blog.fuseyism.com/index.php/2013/02/01/the-death-of-icedtea/ > > Thoughts, comments, flames, etc. very much welcomed. Please pass onto others who may be interested. > > A brief disclaimer that these are my personal thoughts, and not necessarily those of Red Hat. Moving work upstream to OpenJDK is the Right Thing(TM) ;) to do. So +1 for that. Like you say, IcedTea can continue to exist for alternative JVM implementations like Cacao etc. I?m not sure what the big fuss about OpenJDK 6 going on forever is. I mean... people should use the latest greatest JVM available. What?s the point of continuing maintaining openjdk 6?? It?s akin to people still using JDK 1.4 or Microsoft .net 1.0 FC From fcassia at gmail.com Fri Feb 1 07:39:59 2013 From: fcassia at gmail.com (Fernando Cassia) Date: Fri, 1 Feb 2013 12:39:59 -0300 Subject: The Death of IcedTea? In-Reply-To: <211087304.7902585.1359725417697.JavaMail.root@redhat.com> References: <211087304.7902585.1359725417697.JavaMail.root@redhat.com> Message-ID: On Fri, Feb 1, 2013 at 10:30 AM, Andrew Hughes wrote: > A brief disclaimer that these are my personal thoughts, and not necessarily those of Red Hat. By the way, the radical headline of the article contradicts its content. What you are proposing is not the "death of" Icedtea but narrowing the scope of the project, if I understood your text correctly. A radical headline like "death of" will surely result in tons of negative press from the usual suspects in the IT press with an anti-Java agenda. Just my $0.02 FC From adomurad at redhat.com Fri Feb 1 07:44:49 2013 From: adomurad at redhat.com (Adam Domurad) Date: Fri, 01 Feb 2013 10:44:49 -0500 Subject: The Death of IcedTea? In-Reply-To: References: <211087304.7902585.1359725417697.JavaMail.root@redhat.com> Message-ID: <510BE2F1.4040908@redhat.com> On 02/01/2013 10:39 AM, Fernando Cassia wrote: > On Fri, Feb 1, 2013 at 10:30 AM, Andrew Hughes wrote: >> A brief disclaimer that these are my personal thoughts, and not necessarily those of Red Hat. > By the way, the radical headline of the article contradicts its > content. What you are proposing is not the "death of" Icedtea but > narrowing the scope of the project, if I understood your text > correctly. > > A radical headline like "death of" will surely result in tons of > negative press from the usual suspects in the IT press with an > anti-Java agenda. > > Just my $0.02 > FC I agree, can't help but feel that the uninitiated with glance at the headline, and have a first impression (usually unshakable to some extent sadly) that IcedTea was 'dead' in the same way that projects die due to lack of developer resources/interest/usefulness. -Adam From gnu.andrew at redhat.com Fri Feb 1 11:27:48 2013 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Fri, 1 Feb 2013 14:27:48 -0500 (EST) Subject: The Future of IcedTea [Was Re: The Death of IcedTea?] In-Reply-To: <510BE2F1.4040908@redhat.com> Message-ID: <1369924830.8141320.1359746868494.JavaMail.root@redhat.com> ----- Original Message ----- > On 02/01/2013 10:39 AM, Fernando Cassia wrote: > > On Fri, Feb 1, 2013 at 10:30 AM, Andrew Hughes > > wrote: > >> A brief disclaimer that these are my personal thoughts, and not > >> necessarily those of Red Hat. > > By the way, the radical headline of the article contradicts its > > content. What you are proposing is not the "death of" Icedtea but > > narrowing the scope of the project, if I understood your text > > correctly. > > > > A radical headline like "death of" will surely result in tons of > > negative press from the usual suspects in the IT press with an > > anti-Java agenda. > > > > Just my $0.02 > > FC > > I agree, can't help but feel that the uninitiated with glance at the > headline, and have a first impression (usually unshakable to some > extent > sadly) that IcedTea was 'dead' in the same way that projects die due > to > lack of developer resources/interest/usefulness. > -Adam > Yeah, the question mark was there for a reason, but, given we also had comments about this when I proposed it for FOSDEM, it seems it's too subtle. Ok, ok, I changed it :P -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From bugzilla-daemon at icedtea.classpath.org Sat Feb 2 01:42:37 2013 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Sat, 02 Feb 2013 09:42:37 +0000 Subject: [Bug 1295] New: Icedtea 6/7: cacao and jamvm parallel unpack failures Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1295 Bug ID: 1295 Summary: Icedtea 6/7: cacao and jamvm parallel unpack failures Classification: Unclassified Product: IcedTea Version: unspecified Hardware: all OS: Linux Status: NEW Severity: normal Priority: P3 Component: IcedTea Assignee: gnu.andrew at redhat.com Reporter: sera at gentoo.org CC: unassigned at icedtea.classpath.org Created attachment 821 --> http://icedtea.classpath.org/bugzilla/attachment.cgi?id=821&action=edit Patch for icedtea 6 As summary says. This was reported by Rick Farina (Zero_Chaos) in G453608 [1] [1] https://bugs.gentoo.org/show_bug.cgi?id=453608 -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130202/c5f4bc7f/attachment.html From bugzilla-daemon at icedtea.classpath.org Sat Feb 2 01:43:56 2013 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Sat, 02 Feb 2013 09:43:56 +0000 Subject: [Bug 1295] Icedtea 6/7: cacao and jamvm parallel unpack failures In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1295 --- Comment #1 from Ralph Sennhauser --- Created attachment 822 --> http://icedtea.classpath.org/bugzilla/attachment.cgi?id=822&action=edit Patch for icedtea 7 Hope this one makes it in time for 2.4 -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130202/b8b55bc8/attachment.html From gnu.andrew at redhat.com Sat Feb 2 07:42:13 2013 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Sat, 2 Feb 2013 10:42:13 -0500 (EST) Subject: The Death of IcedTea? In-Reply-To: Message-ID: <379417528.8274499.1359819733538.JavaMail.root@redhat.com> ----- Original Message ----- > On Fri, Feb 1, 2013 at 10:30 AM, Andrew Hughes > wrote: > > My thoughts on the future of #IcedTea: > > http://blog.fuseyism.com/index.php/2013/02/01/the-death-of-icedtea/ > > > > Thoughts, comments, flames, etc. very much welcomed. Please pass > > onto others who may be interested. > > > > A brief disclaimer that these are my personal thoughts, and not > > necessarily those of Red Hat. > > Moving work upstream to OpenJDK is the Right Thing(TM) ;) to do. So > +1 for that. > Like you say, IcedTea can continue to exist for alternative JVM > implementations like Cacao etc. > Depends how you define 'work'; technically the patches can go upstream (very slowly) but my main worry is there is a lot lacking on the organisation side in OpenJDK. Still no bug DB for one thing ;) > I?m not sure what the big fuss about OpenJDK 6 going on forever is. I > mean... people should use the latest greatest JVM available. What?s > the point of continuing maintaining openjdk 6?? It?s akin to people > still using JDK 1.4 or Microsoft .net 1.0 The move from 6 to 7 broke a lot of packages just in Fedora. Making such a move requires people to make a lot of investment in porting for little gain. There'll probably be more of a draw with 8 than 7. With it coming so soon after 7, and there being so little change in 7, I guess a lot of people would rather wait. > > FC > -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From gitne at excite.co.jp Sat Feb 2 09:11:07 2013 From: gitne at excite.co.jp (=?ISO-2022-JP?B?SmFrb2IgV2lzb3I=?=) Date: Sun, 3 Feb 2013 02:11:07 +0900 Subject: =?ISO-2022-JP?B?UmU6IC9oZy9pY2VkdGVhLXdlYjogUmVuYW1lZCBjb25mbGljdCBmaWxlIGZvciBjYXNlIGluc2Vuc2l0aXZlIHN5c3RlbXM=?= Message-ID: <201302021711.r12HB7Vb008572@mail-web01.excite.co.jp> wrote: > changeset e631770d76ba in /hg/icedtea-web > details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=e631770d76ba > author: Jiri Vanek > date: Thu Jan 31 11:12:35 2013 +0100 > > Renamed conflict file for case insensitive systems Thank you Jiri. There are more conflicting file names: tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1e_x_2s.html tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1E_x_2s.html There may be even more conflicting file names. Unfortunately, I do not have any means at hand to do a programmatic or in an automated check of the entire repository. Should you have any time left to take a deeper look into this matter, please do so, since I cannot change file names on an case-insensitive file system as long as it has not been cloned. Thank you for your patience. ps.: I have made myself familiar with the commit and review policy. I should be able to post a request for review later this evening. From fcassia at gmail.com Sat Feb 2 09:11:36 2013 From: fcassia at gmail.com (Fernando Cassia) Date: Sat, 2 Feb 2013 14:11:36 -0300 Subject: The Future of IcedTea [Was Re: The Death of IcedTea?] In-Reply-To: <1369924830.8141320.1359746868494.JavaMail.root@redhat.com> References: <510BE2F1.4040908@redhat.com> <1369924830.8141320.1359746868494.JavaMail.root@redhat.com> Message-ID: On Fri, Feb 1, 2013 at 4:27 PM, Andrew Hughes wrote: > > Ok, ok, I changed it :P Great!. Negative headlines wrt Java belong to IDG and ZiffGatesNet (ZDNet). ;) FC From andrew at icedtea.classpath.org Sat Feb 2 11:13:12 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Sat, 02 Feb 2013 19:13:12 +0000 Subject: /hg/release/icedtea6-1.11: 3 new changesets Message-ID: changeset 4baa7108d50f in /hg/release/icedtea6-1.11 details: http://icedtea.classpath.org/hg/release/icedtea6-1.11?cmd=changeset;node=4baa7108d50f author: Andrew John Hughes date: Fri Feb 01 23:20:10 2013 +0000 Security patches for 2013/02/01 errata. 2013-02-01 Andrew John Hughes * Makefile.am: (SECURITY_PATCHES): Add latest batch. * patches/openjdk/6633275-shaped_translucent_windows.patch: Regenerated against security patches. * patches/security/20120612/7145239.patch, * patches/security/20130201/6563318.patch, * patches/security/20130201/6664509.patch, * patches/security/20130201/6776941.patch, * patches/security/20130201/7141694.patch, * patches/security/20130201/7173145.patch, * patches/security/20130201/7186945.patch, * patches/security/20130201/7186948.patch, * patches/security/20130201/7186952.patch, * patches/security/20130201/7186954.patch, * patches/security/20130201/7192392.patch, * patches/security/20130201/7192393.patch, * patches/security/20130201/7192977.patch, * patches/security/20130201/7197546.patch, * patches/security/20130201/7200491.patch, * patches/security/20130201/7200500.patch, * patches/security/20130201/7201064.patch, * patches/security/20130201/7201066.patch, * patches/security/20130201/7201068.patch, * patches/security/20130201/7201070.patch, * patches/security/20130201/7201071.patch, * patches/security/20130201/8000210.patch, * patches/security/20130201/8000537.patch, * patches/security/20130201/8000540.patch, * patches/security/20130201/8000631.patch, * patches/security/20130201/8001235.patch, * patches/security/20130201/8001242.patch, * patches/security/20130201/8001307.patch, * patches/security/20130201/8001972.patch, * patches/security/20130201/8002325.patch: New security patches for 2013/02/01 errata. changeset 7bf56f604b21 in /hg/release/icedtea6-1.11 details: http://icedtea.classpath.org/hg/release/icedtea6-1.11?cmd=changeset;node=7bf56f604b21 author: Andrew John Hughes date: Sat Feb 02 01:43:07 2013 +0000 S7010849: 5/5 Extraneous javac source/target options when building sa-jdi 2013-02-01 Andrew John Hughes * patches/ecj/hotspot.patch: Dropped unnecessary patch. javac script already sets bootclasspath to rt.jar. * Makefile.am: (ICEDTEA_PATCHES): Add 7010849 backport. (ICEDTEA_ECJ_PATCHES): Remove HotSpot patch. * patches/openjdk/7010849-modernise_sa.patch: Backport from 7 to avoid duplicate source/target options when building the serviceability agent, which lead to build issues on current Fedora. * NEWS: Updated. changeset 448eb298bffc in /hg/release/icedtea6-1.11 details: http://icedtea.classpath.org/hg/release/icedtea6-1.11?cmd=changeset;node=448eb298bffc author: Andrew John Hughes date: Sat Feb 02 07:50:53 2013 +0000 Add security fixes to NEWS. 2013-02-01 Andrew John Hughes * NEWS: Add security fixes. diffstat: ChangeLog | 56 + Makefile.am | 35 +- NEWS | 37 + patches/ecj/hotspot.patch | 14 - patches/openjdk/6633275-shaped_translucent_windows.patch | 212 +- patches/openjdk/7010849-modernise_sa.patch | 394 + patches/security/20120612/7145239.patch | 25 +- patches/security/20130201/6563318.patch | 36 + patches/security/20130201/6664509.patch | 1322 + patches/security/20130201/6776941.patch | 272 + patches/security/20130201/7141694.patch | 87 + patches/security/20130201/7173145.patch | 22 + patches/security/20130201/7186945.patch | 10819 +++++++++++++ patches/security/20130201/7186948.patch | 20 + patches/security/20130201/7186952.patch | 127 + patches/security/20130201/7186954.patch | 81 + patches/security/20130201/7192392.patch | 695 + patches/security/20130201/7192393.patch | 60 + patches/security/20130201/7192977.patch | 439 + patches/security/20130201/7197546.patch | 479 + patches/security/20130201/7200491.patch | 49 + patches/security/20130201/7200500.patch | 60 + patches/security/20130201/7201064.patch | 117 + patches/security/20130201/7201066.patch | 66 + patches/security/20130201/7201068.patch | 83 + patches/security/20130201/7201070.patch | 31 + patches/security/20130201/7201071.patch | 553 + patches/security/20130201/8000210.patch | 104 + patches/security/20130201/8000537.patch | 334 + patches/security/20130201/8000540.patch | 187 + patches/security/20130201/8000631.patch | 3964 ++++ patches/security/20130201/8001235.patch | 35 + patches/security/20130201/8001242.patch | 61 + patches/security/20130201/8001307.patch | 27 + patches/security/20130201/8001972.patch | 438 + patches/security/20130201/8002325.patch | 59 + 36 files changed, 21256 insertions(+), 144 deletions(-) diffs (truncated from 22032 to 500 lines): diff -r 17e15b89db78 -r 448eb298bffc ChangeLog --- a/ChangeLog Wed Oct 31 11:33:18 2012 +0000 +++ b/ChangeLog Sat Feb 02 07:50:53 2013 +0000 @@ -1,3 +1,59 @@ +2013-02-01 Andrew John Hughes + + * NEWS: Add security fixes. + +2013-02-01 Andrew John Hughes + + * patches/ecj/hotspot.patch: + Dropped unnecessary patch. javac script + already sets bootclasspath to rt.jar. + * Makefile.am: + (ICEDTEA_PATCHES): Add 7010849 backport. + (ICEDTEA_ECJ_PATCHES): Remove HotSpot patch. + * patches/openjdk/7010849-modernise_sa.patch: + Backport from 7 to avoid duplicate source/target + options when building the serviceability agent, + which lead to build issues on current Fedora. + * NEWS: Updated. + +2013-02-01 Andrew John Hughes + + * Makefile.am: + (SECURITY_PATCHES): Add latest batch. + * patches/openjdk/6633275-shaped_translucent_windows.patch: + Regenerated against security patches. + * patches/security/20120612/7145239.patch, + * patches/security/20130201/6563318.patch, + * patches/security/20130201/6664509.patch, + * patches/security/20130201/6776941.patch, + * patches/security/20130201/7141694.patch, + * patches/security/20130201/7173145.patch, + * patches/security/20130201/7186945.patch, + * patches/security/20130201/7186948.patch, + * patches/security/20130201/7186952.patch, + * patches/security/20130201/7186954.patch, + * patches/security/20130201/7192392.patch, + * patches/security/20130201/7192393.patch, + * patches/security/20130201/7192977.patch, + * patches/security/20130201/7197546.patch, + * patches/security/20130201/7200491.patch, + * patches/security/20130201/7200500.patch, + * patches/security/20130201/7201064.patch, + * patches/security/20130201/7201066.patch, + * patches/security/20130201/7201068.patch, + * patches/security/20130201/7201070.patch, + * patches/security/20130201/7201071.patch, + * patches/security/20130201/8000210.patch, + * patches/security/20130201/8000537.patch, + * patches/security/20130201/8000540.patch, + * patches/security/20130201/8000631.patch, + * patches/security/20130201/8001235.patch, + * patches/security/20130201/8001242.patch, + * patches/security/20130201/8001307.patch, + * patches/security/20130201/8001972.patch, + * patches/security/20130201/8002325.patch: + New security patches for 2013/02/01 errata. + 2011-10-31 Andrew John Hughes * AUTHORS: Update my e-mail address. diff -r 17e15b89db78 -r 448eb298bffc Makefile.am --- a/Makefile.am Wed Oct 31 11:33:18 2012 +0000 +++ b/Makefile.am Sat Feb 02 07:50:53 2013 +0000 @@ -245,7 +245,36 @@ patches/security/20121016/7195917.patch \ patches/security/20121016/7195919.patch \ patches/security/20121016/7198296.patch \ - patches/security/20121016/7198606.patch + patches/security/20121016/7198606.patch \ + patches/security/20130201/7201068.patch \ + patches/security/20130201/6563318.patch \ + patches/security/20130201/6664509.patch \ + patches/security/20130201/6776941.patch \ + patches/security/20130201/7141694.patch \ + patches/security/20130201/7173145.patch \ + patches/security/20130201/7186945.patch \ + patches/security/20130201/7186948.patch \ + patches/security/20130201/7186952.patch \ + patches/security/20130201/7186954.patch \ + patches/security/20130201/7192392.patch \ + patches/security/20130201/7192393.patch \ + patches/security/20130201/7192977.patch \ + patches/security/20130201/7197546.patch \ + patches/security/20130201/7200491.patch \ + patches/security/20130201/7200500.patch \ + patches/security/20130201/7201064.patch \ + patches/security/20130201/7201066.patch \ + patches/security/20130201/7201070.patch \ + patches/security/20130201/7201071.patch \ + patches/security/20130201/8000210.patch \ + patches/security/20130201/8000537.patch \ + patches/security/20130201/8000540.patch \ + patches/security/20130201/8000631.patch \ + patches/security/20130201/8001242.patch \ + patches/security/20130201/8001307.patch \ + patches/security/20130201/8001972.patch \ + patches/security/20130201/8002325.patch \ + patches/security/20130201/8001235.patch SPECIAL_SECURITY_PATCH = patches/security/20120214/7112642.patch @@ -459,7 +488,8 @@ patches/merge_fix.patch \ patches/openjdk/7175845-jar_uf_changes_file_permissions.patch \ patches/openjdk/7177216-native2ascii_changes_file_permissions.patch \ - patches/openjdk/7199153-try_with_resources_pushed_to_6.patch + patches/openjdk/7199153-try_with_resources_pushed_to_6.patch \ + patches/openjdk/7010849-modernise_sa.patch if WITH_RHINO ICEDTEA_PATCHES += \ @@ -511,7 +541,6 @@ # Bootstrapping patches ICEDTEA_ECJ_PATCHES = patches/ecj/icedtea.patch \ - patches/ecj/hotspot.patch \ patches/ecj/javafiles.patch \ patches/ecj/spp.patch \ patches/ecj/jopt.patch \ diff -r 17e15b89db78 -r 448eb298bffc NEWS --- a/NEWS Wed Oct 31 11:33:18 2012 +0000 +++ b/NEWS Sat Feb 02 07:50:53 2013 +0000 @@ -12,6 +12,43 @@ New in release 1.11.6 (20XX-XX-XX): +* Security fixes + - S6563318, CVE-2013-0424: RMI data sanitization + - S6664509, CVE-2013-0425: Add logging context + - S6664528, CVE-2013-0426: Find log level matching its name or value given at construction time + - S6776941: CVE-2013-0427: Improve thread pool shutdown + - S7141694, CVE-2013-0429: Improving CORBA internals + - S7173145: Improve in-memory representation of splashscreens + - S7186945: Unpack200 improvement + - S7186946: Refine unpacker resource usage + - S7186948: Improve Swing data validation + - S7186952, CVE-2013-0432: Improve clipboard access + - S7186954: Improve connection performance + - S7186957: Improve Pack200 data validation + - S7192392, CVE-2013-0443: Better validation of client keys + - S7192393, CVE-2013-0440: Better Checking of order of TLS Messages + - S7192977, CVE-2013-0442: Issue in toolkit thread + - S7197546, CVE-2013-0428: (proxy) Reflect about creating reflective proxies + - S7200491: Tighten up JTable layout code + - S7200500: Launcher better input validation + - S7201064: Better dialogue checking + - S7201066, CVE-2013-0441: Change modifiers on unused fields + - S7201068, CVE-2013-0435: Better handling of UI elements + - S7201070: Serialization to conform to protocol + - S7201071, CVE-2013-0433: InetSocketAddress serialization issue + - S8000210: Improve JarFile code quality + - S8000537, CVE-2013-0450: Contextualize RequiredModelMBean class + - S8000540, CVE-2013-1475: Improve IIOP type reuse management + - S8000631, CVE-2013-1476: Restrict access to class constructor + - S8001235, CVE-2013-0434: Improve JAXP HTTP handling + - S8001242: Improve RMI HTTP conformance + - S8001307: Modify ACC_SUPER behavior + - S8001972, CVE-2013-1478: Improve image processing + - S8002325, CVE-2013-1480: Improve management of images + +* Backports + - S7010849: 5/5 Extraneous javac source/target options when building sa-jdi + New in release 1.11.5 (2012-10-16): * Security fixes diff -r 17e15b89db78 -r 448eb298bffc patches/ecj/hotspot.patch --- a/patches/ecj/hotspot.patch Wed Oct 31 11:33:18 2012 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -diff -Nru openjdk-ecj.orig/hotspot/make/linux/makefiles/sa.make openjdk-ecj/hotspot/make/linux/makefiles/sa.make ---- openjdk-ecj.orig/hotspot/make/linux/makefiles/sa.make 2010-03-29 21:34:15.000000000 +0100 -+++ openjdk-ecj/hotspot/make/linux/makefiles/sa.make 2010-03-29 21:41:28.000000000 +0100 -@@ -80,8 +80,8 @@ - $(foreach file,$(AGENT_FILES1),$(shell echo $(file) >> $(AGENT_FILES1_LIST))) - $(foreach file,$(AGENT_FILES2),$(shell echo $(file) >> $(AGENT_FILES2_LIST))) - -- $(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -source 1.4 -target 1.4 -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES1_LIST) -- $(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -source 1.4 -target 1.4 -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES2_LIST) -+ $(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -source 1.4 -target 1.4 -classpath $(SA_CLASSPATH):$(BOOT_JAVA_HOME)/jre/lib/rt.jar -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES1_LIST) -+ $(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -source 1.4 -target 1.4 -classpath $(SA_CLASSPATH):$(BOOT_JAVA_HOME)/jre/lib/rt.jar -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES2_LIST) - - $(QUIETLY) $(REMOTE) $(COMPILE.RMIC) -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer - $(QUIETLY) echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES) diff -r 17e15b89db78 -r 448eb298bffc patches/openjdk/6633275-shaped_translucent_windows.patch --- a/patches/openjdk/6633275-shaped_translucent_windows.patch Wed Oct 31 11:33:18 2012 +0000 +++ b/patches/openjdk/6633275-shaped_translucent_windows.patch Sat Feb 02 07:50:53 2013 +0000 @@ -1,6 +1,6 @@ diff -Nru openjdk.orig/jdk/make/sun/awt/FILES_c_windows.gmk openjdk/jdk/make/sun/awt/FILES_c_windows.gmk ---- openjdk.orig/jdk/make/sun/awt/FILES_c_windows.gmk 2012-08-31 11:35:28.843940899 +0100 -+++ openjdk/jdk/make/sun/awt/FILES_c_windows.gmk 2012-08-31 11:40:40.950186466 +0100 +--- openjdk.orig/jdk/make/sun/awt/FILES_c_windows.gmk 2013-02-01 22:07:30.320067472 +0000 ++++ openjdk/jdk/make/sun/awt/FILES_c_windows.gmk 2013-02-01 22:08:19.836834676 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. @@ -19,8 +19,8 @@ FILES_cpp = \ CmdIDList.cpp \ diff -Nru openjdk.orig/jdk/make/sun/awt/make.depend openjdk/jdk/make/sun/awt/make.depend ---- openjdk.orig/jdk/make/sun/awt/make.depend 2012-08-31 11:35:28.855941139 +0100 -+++ openjdk/jdk/make/sun/awt/make.depend 2012-08-31 11:40:40.958186626 +0100 +--- openjdk.orig/jdk/make/sun/awt/make.depend 2013-02-01 22:07:30.328067597 +0000 ++++ openjdk/jdk/make/sun/awt/make.depend 2013-02-01 22:08:19.848834862 +0000 @@ -16,7 +16,7 @@ $(OBJDIR)/awt_AWTEvent.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_AWTEvent.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Unicode.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.h @@ -107,8 +107,8 @@ $(OBJDIR)/UnicowsLoader.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.h diff -Nru openjdk.orig/jdk/make/sun/awt/Makefile openjdk/jdk/make/sun/awt/Makefile ---- openjdk.orig/jdk/make/sun/awt/Makefile 2012-08-31 11:35:28.847940980 +0100 -+++ openjdk/jdk/make/sun/awt/Makefile 2012-08-31 11:40:40.958186626 +0100 +--- openjdk.orig/jdk/make/sun/awt/Makefile 2013-02-01 22:07:30.320067472 +0000 ++++ openjdk/jdk/make/sun/awt/Makefile 2013-02-01 22:08:19.848834862 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved. @@ -125,8 +125,8 @@ vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/loops vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/pipe diff -Nru openjdk.orig/jdk/make/sun/awt/mapfile-mawt-vers openjdk/jdk/make/sun/awt/mapfile-mawt-vers ---- openjdk.orig/jdk/make/sun/awt/mapfile-mawt-vers 2012-08-31 11:35:28.855941139 +0100 -+++ openjdk/jdk/make/sun/awt/mapfile-mawt-vers 2012-08-31 11:40:40.958186626 +0100 +--- openjdk.orig/jdk/make/sun/awt/mapfile-mawt-vers 2013-02-01 22:07:30.328067597 +0000 ++++ openjdk/jdk/make/sun/awt/mapfile-mawt-vers 2013-02-01 22:08:19.848834862 +0000 @@ -291,6 +291,7 @@ Java_sun_awt_X11GraphicsConfig_createBackBuffer; Java_sun_awt_X11GraphicsConfig_destroyBackBuffer; @@ -136,8 +136,8 @@ Java_sun_awt_X11GraphicsDevice_getDisplay; Java_sun_awt_X11GraphicsDevice_getDoubleBufferVisuals; diff -Nru openjdk.orig/jdk/make/sun/awt/mapfile-vers-linux openjdk/jdk/make/sun/awt/mapfile-vers-linux ---- openjdk.orig/jdk/make/sun/awt/mapfile-vers-linux 2012-08-31 11:35:28.855941139 +0100 -+++ openjdk/jdk/make/sun/awt/mapfile-vers-linux 2012-08-31 11:40:40.958186626 +0100 +--- openjdk.orig/jdk/make/sun/awt/mapfile-vers-linux 2013-02-01 22:07:30.328067597 +0000 ++++ openjdk/jdk/make/sun/awt/mapfile-vers-linux 2013-02-01 22:08:19.848834862 +0000 @@ -406,6 +406,7 @@ Java_sun_awt_X11GraphicsConfig_getNumColors; Java_sun_awt_X11GraphicsConfig_getXResolution; @@ -147,8 +147,8 @@ Java_sun_awt_X11GraphicsDevice_getDisplay; Java_sun_awt_X11GraphicsDevice_getDoubleBufferVisuals; diff -Nru openjdk.orig/jdk/make/sun/xawt/mapfile-vers openjdk/jdk/make/sun/xawt/mapfile-vers ---- openjdk.orig/jdk/make/sun/xawt/mapfile-vers 2012-08-31 11:35:28.859941219 +0100 -+++ openjdk/jdk/make/sun/xawt/mapfile-vers 2012-08-31 11:40:40.958186626 +0100 +--- openjdk.orig/jdk/make/sun/xawt/mapfile-vers 2013-02-01 22:07:30.328067597 +0000 ++++ openjdk/jdk/make/sun/xawt/mapfile-vers 2013-02-01 22:08:19.848834862 +0000 @@ -216,6 +216,7 @@ Java_sun_awt_X11GraphicsConfig_createBackBuffer; Java_sun_awt_X11GraphicsConfig_destroyBackBuffer; @@ -158,8 +158,8 @@ Java_java_awt_KeyboardFocusManager_initIDs; Java_java_awt_Font_initIDs; diff -Nru openjdk.orig/jdk/src/share/classes/com/sun/awt/AWTUtilities.java openjdk/jdk/src/share/classes/com/sun/awt/AWTUtilities.java ---- openjdk.orig/jdk/src/share/classes/com/sun/awt/AWTUtilities.java 2012-08-31 11:35:28.543934864 +0100 -+++ openjdk/jdk/src/share/classes/com/sun/awt/AWTUtilities.java 2012-08-31 11:40:40.958186626 +0100 +--- openjdk.orig/jdk/src/share/classes/com/sun/awt/AWTUtilities.java 2013-02-01 22:07:30.232066109 +0000 ++++ openjdk/jdk/src/share/classes/com/sun/awt/AWTUtilities.java 2013-02-01 22:08:19.848834862 +0000 @@ -26,17 +26,37 @@ package com.sun.awt; @@ -545,8 +545,8 @@ * Sets a 'mixing-cutout' shape for the given component. * diff -Nru openjdk.orig/jdk/src/share/classes/java/awt/Component.java openjdk/jdk/src/share/classes/java/awt/Component.java ---- openjdk.orig/jdk/src/share/classes/java/awt/Component.java 2012-08-31 11:35:28.863941300 +0100 -+++ openjdk/jdk/src/share/classes/java/awt/Component.java 2012-08-31 11:50:56.060499253 +0100 +--- openjdk.orig/jdk/src/share/classes/java/awt/Component.java 2013-02-01 22:07:30.332067659 +0000 ++++ openjdk/jdk/src/share/classes/java/awt/Component.java 2013-02-01 22:08:19.852834924 +0000 @@ -806,137 +806,148 @@ } } @@ -794,7 +794,7 @@ public void setMixingCutoutShape(Component comp, Shape shape) { Region region = shape == null ? null : Region.getInstance(shape, null); -@@ -7573,7 +7587,7 @@ +@@ -7573,7 +7584,7 @@ // sometimes most recent focus owner may be null, but focus owner is not // e.g. we reset most recent focus owner if user removes focus owner focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); @@ -803,7 +803,7 @@ focusOwner = null; } } -@@ -8808,31 +8822,9 @@ +@@ -8808,31 +8819,9 @@ * null, if component is not a part of window hierarchy */ Window getContainingWindow() { @@ -836,7 +836,7 @@ /** * Initialize JNI field and method IDs */ -@@ -9946,4 +9938,29 @@ +@@ -9946,4 +9935,29 @@ } // ****************** END OF MIXING CODE ******************************** @@ -867,8 +867,8 @@ + } } diff -Nru openjdk.orig/jdk/src/share/classes/java/awt/Container.java openjdk/jdk/src/share/classes/java/awt/Container.java ---- openjdk.orig/jdk/src/share/classes/java/awt/Container.java 2012-08-31 11:35:28.563935265 +0100 -+++ openjdk/jdk/src/share/classes/java/awt/Container.java 2012-08-31 11:40:40.962186705 +0100 +--- openjdk.orig/jdk/src/share/classes/java/awt/Container.java 2013-02-01 22:07:30.236066171 +0000 ++++ openjdk/jdk/src/share/classes/java/awt/Container.java 2013-02-01 22:08:19.860835048 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved. @@ -887,8 +887,8 @@ * JDK 1.1 serialVersionUID */ diff -Nru openjdk.orig/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java openjdk/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java ---- openjdk.orig/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java 2012-08-31 11:35:28.411932207 +0100 -+++ openjdk/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java 2012-08-31 11:40:40.962186705 +0100 +--- openjdk.orig/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java 2013-02-01 22:07:30.184065365 +0000 ++++ openjdk/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java 2013-02-01 22:08:19.860835048 +0000 @@ -490,7 +490,7 @@ // that a Component outside of the focused Window receives a // FOCUS_GAINED event. We synthesize a WINDOW_GAINED_FOCUS @@ -900,7 +900,7 @@ newFocusedWindow != currentFocusedWindow) diff -Nru openjdk.orig/jdk/src/share/classes/java/awt/GraphicsConfiguration.java openjdk/jdk/src/share/classes/java/awt/GraphicsConfiguration.java --- openjdk.orig/jdk/src/share/classes/java/awt/GraphicsConfiguration.java 2011-11-14 22:11:48.000000000 +0000 -+++ openjdk/jdk/src/share/classes/java/awt/GraphicsConfiguration.java 2012-08-31 11:40:40.962186705 +0100 ++++ openjdk/jdk/src/share/classes/java/awt/GraphicsConfiguration.java 2013-02-01 22:08:19.860835048 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. @@ -930,8 +930,8 @@ } +} diff -Nru openjdk.orig/jdk/src/share/classes/java/awt/GraphicsDevice.java openjdk/jdk/src/share/classes/java/awt/GraphicsDevice.java ---- openjdk.orig/jdk/src/share/classes/java/awt/GraphicsDevice.java 2012-08-31 11:35:28.863941300 +0100 -+++ openjdk/jdk/src/share/classes/java/awt/GraphicsDevice.java 2012-08-31 11:40:40.962186705 +0100 +--- openjdk.orig/jdk/src/share/classes/java/awt/GraphicsDevice.java 2013-02-01 22:07:30.332067659 +0000 ++++ openjdk/jdk/src/share/classes/java/awt/GraphicsDevice.java 2013-02-01 22:08:19.860835048 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. @@ -1100,8 +1100,8 @@ + } } diff -Nru openjdk.orig/jdk/src/share/classes/java/awt/KeyboardFocusManager.java openjdk/jdk/src/share/classes/java/awt/KeyboardFocusManager.java ---- openjdk.orig/jdk/src/share/classes/java/awt/KeyboardFocusManager.java 2012-08-31 11:35:28.379931565 +0100 -+++ openjdk/jdk/src/share/classes/java/awt/KeyboardFocusManager.java 2012-08-31 11:40:40.966186785 +0100 +--- openjdk.orig/jdk/src/share/classes/java/awt/KeyboardFocusManager.java 2013-02-01 22:07:30.172065180 +0000 ++++ openjdk/jdk/src/share/classes/java/awt/KeyboardFocusManager.java 2013-02-01 22:08:19.860835048 +0000 @@ -2224,7 +2224,7 @@ boolean temporary, boolean focusedWindowChangeAllowed, long time) @@ -1144,7 +1144,7 @@ } diff -Nru openjdk.orig/jdk/src/share/classes/java/awt/peer/WindowPeer.java openjdk/jdk/src/share/classes/java/awt/peer/WindowPeer.java --- openjdk.orig/jdk/src/share/classes/java/awt/peer/WindowPeer.java 2011-11-14 22:11:49.000000000 +0000 -+++ openjdk/jdk/src/share/classes/java/awt/peer/WindowPeer.java 2012-08-31 11:40:40.966186785 +0100 ++++ openjdk/jdk/src/share/classes/java/awt/peer/WindowPeer.java 2013-02-01 22:08:19.860835048 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved. @@ -1189,8 +1189,8 @@ + void updateWindow(BufferedImage backBuffer); } diff -Nru openjdk.orig/jdk/src/share/classes/java/awt/Window.java openjdk/jdk/src/share/classes/java/awt/Window.java ---- openjdk.orig/jdk/src/share/classes/java/awt/Window.java 2012-08-31 11:35:28.415932289 +0100 -+++ openjdk/jdk/src/share/classes/java/awt/Window.java 2012-08-31 11:40:40.966186785 +0100 +--- openjdk.orig/jdk/src/share/classes/java/awt/Window.java 2013-02-01 22:07:30.188065428 +0000 ++++ openjdk/jdk/src/share/classes/java/awt/Window.java 2013-02-01 22:08:19.860835048 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved. @@ -1532,8 +1532,8 @@ diff -Nru openjdk.orig/jdk/src/share/classes/javax/swing/RepaintManager.java openjdk/jdk/src/share/classes/javax/swing/RepaintManager.java ---- openjdk.orig/jdk/src/share/classes/javax/swing/RepaintManager.java 2011-11-14 22:11:56.000000000 +0000 -+++ openjdk/jdk/src/share/classes/javax/swing/RepaintManager.java 2012-08-31 11:40:40.966186785 +0100 +--- openjdk.orig/jdk/src/share/classes/javax/swing/RepaintManager.java 2013-02-01 22:07:29.980062206 +0000 ++++ openjdk/jdk/src/share/classes/javax/swing/RepaintManager.java 2013-02-01 22:20:00.543789010 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. @@ -1541,15 +1541,7 @@ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it -@@ -34,6 +34,7 @@ - import java.util.*; - import java.applet.*; - -+import sun.awt.AWTAccessor; - import sun.awt.AppContext; - import sun.awt.DisplayChangedListener; - import sun.awt.SunToolkit; -@@ -681,6 +682,44 @@ +@@ -711,6 +711,44 @@ } } @@ -1594,21 +1586,21 @@ /** * Paint all of the components that have been marked dirty. * -@@ -714,6 +753,10 @@ - int localBoundsW = 0; - Enumeration keys; +@@ -733,6 +771,10 @@ + return; + } + // the components belonging to perpixel-translucent windows will be + // removed from the list -+ tmpDirtyComponents = updateWindows(tmpDirtyComponents); -+ - roots = new ArrayList(count); - - for (Component dirty : tmpDirtyComponents.keySet()) { ++ updateWindows(tmpDirtyComponents); ++ + final java.util.List roots = + new ArrayList(tmpDirtyComponents.size()); + diff -Nru openjdk.orig/jdk/src/share/classes/sun/awt/AWTAccessor.java openjdk/jdk/src/share/classes/sun/awt/AWTAccessor.java ---- openjdk.orig/jdk/src/share/classes/sun/awt/AWTAccessor.java 2012-08-31 11:35:28.579935587 +0100 -+++ openjdk/jdk/src/share/classes/sun/awt/AWTAccessor.java 2012-08-31 11:43:53.386005753 +0100 -@@ -202,10 +202,29 @@ +--- openjdk.orig/jdk/src/share/classes/sun/awt/AWTAccessor.java 2013-02-01 22:07:30.236066171 +0000 ++++ openjdk/jdk/src/share/classes/sun/awt/AWTAccessor.java 2013-02-01 22:08:19.864835110 +0000 +@@ -203,10 +203,29 @@ */ Point getLocation(Component comp); @@ -1641,7 +1633,7 @@ */ void setMixingCutoutShape(Component comp, Shape shape); -@@ -234,6 +253,36 @@ +@@ -235,6 +254,36 @@ * components in the specified window to the specified value. */ void setLWRequestStatus(Window changed, boolean status); @@ -1678,7 +1670,7 @@ } /** -@@ -534,8 +583,14 @@ +@@ -540,8 +589,14 @@ */ private static KeyboardFocusManagerAccessor kfmAccessor; @@ -1694,8 +1686,8 @@ private static MenuComponentAccessor menuComponentAccessor; diff -Nru openjdk.orig/jdk/src/share/classes/sun/awt/EmbeddedFrame.java openjdk/jdk/src/share/classes/sun/awt/EmbeddedFrame.java ---- openjdk.orig/jdk/src/share/classes/sun/awt/EmbeddedFrame.java 2012-08-31 11:35:28.231928586 +0100 -+++ openjdk/jdk/src/share/classes/sun/awt/EmbeddedFrame.java 2012-08-31 11:40:40.966186785 +0100 +--- openjdk.orig/jdk/src/share/classes/sun/awt/EmbeddedFrame.java 2013-02-01 22:07:29.704057928 +0000 ++++ openjdk/jdk/src/share/classes/sun/awt/EmbeddedFrame.java 2013-02-01 22:08:19.864835110 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. @@ -1718,8 +1710,8 @@ + } } // class EmbeddedFrame diff -Nru openjdk.orig/jdk/src/share/classes/sun/awt/SunToolkit.java openjdk/jdk/src/share/classes/sun/awt/SunToolkit.java ---- openjdk.orig/jdk/src/share/classes/sun/awt/SunToolkit.java 2012-08-31 11:35:28.579935587 +0100 -+++ openjdk/jdk/src/share/classes/sun/awt/SunToolkit.java 2012-08-31 11:41:50.915577773 +0100 +--- openjdk.orig/jdk/src/share/classes/sun/awt/SunToolkit.java 2013-02-01 22:07:30.236066171 +0000 ++++ openjdk/jdk/src/share/classes/sun/awt/SunToolkit.java 2013-02-01 22:08:19.864835110 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. @@ -1886,7 +1878,7 @@ diff -Nru openjdk.orig/jdk/src/share/native/sun/awt/utility/rect.c openjdk/jdk/src/share/native/sun/awt/utility/rect.c --- openjdk.orig/jdk/src/share/native/sun/awt/utility/rect.c 1970-01-01 01:00:00.000000000 +0100 -+++ openjdk/jdk/src/share/native/sun/awt/utility/rect.c 2012-08-31 11:40:40.966186785 +0100 ++++ openjdk/jdk/src/share/native/sun/awt/utility/rect.c 2013-02-01 22:08:19.864835110 +0000 @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. @@ -1992,7 +1984,7 @@ +#endif diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/generator/WrapperGenerator.java openjdk/jdk/src/solaris/classes/sun/awt/X11/generator/WrapperGenerator.java --- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/generator/WrapperGenerator.java 2011-11-14 22:12:14.000000000 +0000 -+++ openjdk/jdk/src/solaris/classes/sun/awt/X11/generator/WrapperGenerator.java 2012-08-31 11:40:40.966186785 +0100 ++++ openjdk/jdk/src/solaris/classes/sun/awt/X11/generator/WrapperGenerator.java 2013-02-01 22:08:19.864835110 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. @@ -2019,7 +2011,7 @@ } diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/generator/xlibtypes.txt openjdk/jdk/src/solaris/classes/sun/awt/X11/generator/xlibtypes.txt --- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/generator/xlibtypes.txt 2011-11-14 22:12:14.000000000 +0000 -+++ openjdk/jdk/src/solaris/classes/sun/awt/X11/generator/xlibtypes.txt 2012-08-31 11:40:40.970186865 +0100 From andrew at icedtea.classpath.org Sat Feb 2 11:14:50 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Sat, 02 Feb 2013 19:14:50 +0000 Subject: /hg/release/icedtea7-forest-2.3/corba: 4 new changesets Message-ID: changeset c1ed8145c1b8 in /hg/release/icedtea7-forest-2.3/corba details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/corba?cmd=changeset;node=c1ed8145c1b8 author: mbankal date: Fri Nov 09 10:20:16 2012 -0800 7141694: Improving CORBA internals Reviewed-by: coffeys, ahgross changeset 307ddc7799c7 in /hg/release/icedtea7-forest-2.3/corba details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/corba?cmd=changeset;node=307ddc7799c7 author: coffeys date: Tue Nov 06 15:50:14 2012 +0000 7201066: Change modifiers on unused fields Reviewed-by: alanb, skoivu changeset 127e4c348a71 in /hg/release/icedtea7-forest-2.3/corba details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/corba?cmd=changeset;node=127e4c348a71 author: ngmr date: Tue Oct 30 17:15:13 2012 +0000 8000540: Improve IIOP type reuse management Reviewed-by: alanb, ahgross, coffeys changeset 5116fe321210 in /hg/release/icedtea7-forest-2.3/corba details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/corba?cmd=changeset;node=5116fe321210 author: coffeys date: Tue Oct 30 17:06:35 2012 +0000 8000631: Restrict access to class constructor Reviewed-by: alanb, ahgross diffstat: make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk | 14 +- src/share/classes/com/sun/corba/se/impl/activation/ServerMain.java | 8 +- src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java | 6 +- src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java | 61 +- src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java | 20 +- src/share/classes/com/sun/corba/se/impl/io/FVDCodeBaseImpl.java | 8 +- src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java | 114 +- src/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java | 85 +- src/share/classes/com/sun/corba/se/impl/io/ValueUtility.java | 10 +- src/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java | 6 +- src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java | 2 +- src/share/classes/com/sun/corba/se/impl/orbutil/IIOPInputStream_1_3.java | 57 - src/share/classes/com/sun/corba/se/impl/orbutil/IIOPInputStream_1_3_1.java | 54 - src/share/classes/com/sun/corba/se/impl/orbutil/IIOPOutputStream_1_3.java | 68 - src/share/classes/com/sun/corba/se/impl/orbutil/IIOPOutputStream_1_3_1.java | 66 - src/share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java | 38 +- src/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamClass_1_3_1.java | 6 +- src/share/classes/com/sun/corba/se/impl/orbutil/RepIdDelegator_1_3.java | 177 - src/share/classes/com/sun/corba/se/impl/orbutil/RepIdDelegator_1_3_1.java | 177 - src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdCache_1_3.java | 108 - src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdCache_1_3_1.java | 102 - src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdFactory.java | 53 +- src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryId_1_3.java | 990 --------- src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryId_1_3_1.java | 1065 ---------- src/share/classes/com/sun/corba/se/impl/orbutil/ValueHandlerImpl_1_3.java | 251 -- src/share/classes/com/sun/corba/se/impl/orbutil/ValueHandlerImpl_1_3_1.java | 77 - src/share/classes/com/sun/corba/se/spi/orb/ORB.java | 37 +- src/share/classes/sun/corba/JavaCorbaAccess.java | 32 + src/share/classes/sun/corba/SharedSecrets.java | 60 + 29 files changed, 219 insertions(+), 3533 deletions(-) diffs (truncated from 4249 to 500 lines): diff -r dc9234e25ab0 -r 5116fe321210 make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk --- a/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk Mon Jan 14 22:24:57 2013 +0000 +++ b/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk Tue Oct 30 17:06:35 2012 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2012, 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 @@ -29,10 +29,6 @@ com/sun/corba/se/impl/orbutil/DenseIntMapImpl.java \ com/sun/corba/se/impl/orbutil/GetPropertyAction.java \ com/sun/corba/se/impl/orbutil/HexOutputStream.java \ - com/sun/corba/se/impl/orbutil/IIOPInputStream_1_3.java \ - com/sun/corba/se/impl/orbutil/IIOPInputStream_1_3_1.java \ - com/sun/corba/se/impl/orbutil/IIOPOutputStream_1_3.java \ - com/sun/corba/se/impl/orbutil/IIOPOutputStream_1_3_1.java \ com/sun/corba/se/impl/orbutil/LegacyHookGetFields.java \ com/sun/corba/se/impl/orbutil/LegacyHookPutFields.java \ com/sun/corba/se/impl/orbutil/LogKeywords.java \ @@ -45,19 +41,11 @@ com/sun/corba/se/impl/orbutil/ORBUtility.java \ com/sun/corba/se/impl/orbutil/ORBClassLoader.java \ com/sun/corba/se/impl/orbutil/RepIdDelegator.java \ - com/sun/corba/se/impl/orbutil/RepIdDelegator_1_3.java \ - com/sun/corba/se/impl/orbutil/RepIdDelegator_1_3_1.java \ - com/sun/corba/se/impl/orbutil/RepositoryIdCache_1_3.java \ - com/sun/corba/se/impl/orbutil/RepositoryId_1_3.java \ com/sun/corba/se/impl/orbutil/RepositoryIdFactory.java \ com/sun/corba/se/impl/orbutil/RepositoryIdStrings.java \ com/sun/corba/se/impl/orbutil/RepositoryIdUtility.java \ com/sun/corba/se/impl/orbutil/RepositoryIdInterface.java \ - com/sun/corba/se/impl/orbutil/RepositoryIdCache_1_3_1.java \ - com/sun/corba/se/impl/orbutil/RepositoryId_1_3_1.java \ com/sun/corba/se/impl/orbutil/StackImpl.java \ - com/sun/corba/se/impl/orbutil/ValueHandlerImpl_1_3_1.java \ - com/sun/corba/se/impl/orbutil/ValueHandlerImpl_1_3.java \ com/sun/corba/se/impl/orbutil/closure/Future.java \ com/sun/corba/se/impl/orbutil/closure/Constant.java \ com/sun/corba/se/impl/orbutil/concurrent/Sync.java \ diff -r dc9234e25ab0 -r 5116fe321210 src/share/classes/com/sun/corba/se/impl/activation/ServerMain.java --- a/src/share/classes/com/sun/corba/se/impl/activation/ServerMain.java Mon Jan 14 22:24:57 2013 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/activation/ServerMain.java Tue Oct 30 17:06:35 2012 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -322,9 +322,9 @@ com.sun.corba.se.spi.activation._ServerImplBase { private ORB orb; - private Method installMethod ; - private Method uninstallMethod ; - private Method shutdownMethod ; + private transient Method installMethod ; + private transient Method uninstallMethod ; + private transient Method shutdownMethod ; private Object methodArgs[] ; ServerCallback(ORB orb, Method installMethod, Method uninstallMethod, diff -r dc9234e25ab0 -r 5116fe321210 src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java --- a/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java Mon Jan 14 22:24:57 2013 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java Tue Oct 30 17:06:35 2012 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -1218,7 +1218,7 @@ // See bug 4391648 for more info about the tcORB in this // case. RepositoryIdStrings repStrs - = RepositoryIdFactory.getRepIdStringsFactory(tcORB); + = RepositoryIdFactory.getRepIdStringsFactory(); // Assertion: c instanceof Serializable? @@ -1251,7 +1251,7 @@ // Anything else // We know that this is a TypeCodeImpl since it is our ORB classTC = (TypeCodeImpl)ValueUtility.createTypeCodeForClass( - tcORB, c, ORBUtility.createValueHandler(tcORB)); + tcORB, c, ORBUtility.createValueHandler()); // Intruct classTC to store its buffer classTC.setCaching(true); // Update the cache diff -r dc9234e25ab0 -r 5116fe321210 src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java --- a/src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java Mon Jan 14 22:24:57 2013 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java Tue Oct 30 17:06:35 2012 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -269,8 +269,8 @@ private final void createRepositoryIdHandlers() { - repIdUtil = RepositoryIdFactory.getRepIdUtility(orb); - repIdStrs = RepositoryIdFactory.getRepIdStringsFactory(orb); + repIdUtil = RepositoryIdFactory.getRepIdUtility(); + repIdStrs = RepositoryIdFactory.getRepIdStringsFactory(); } public GIOPVersion getGIOPVersion() { @@ -564,10 +564,7 @@ checkForNegativeLength(len); - if (orb != null && ORBUtility.isLegacyORB((ORB)orb)) - return legacyReadString(len); - else - return internalReadString(len); + return internalReadString(len); } private final String internalReadString(int len) { @@ -588,54 +585,6 @@ return new String(result, 0, getCharConverter().getNumChars()); } - private final String legacyReadString(int len) { - - // - // Workaround for ORBs which send string lengths of - // zero to mean empty string. - // - // - // IMPORTANT: Do not replace 'new String("")' with "", it may result - // in a Serialization bug (See serialization.zerolengthstring) and - // bug id: 4728756 for details - if (len == 0) - return new String(""); - - len--; - char[] c = new char[len]; - - int n = 0; - while (n < len) { - int avail; - int bytes; - int wanted; - - avail = bbwi.buflen - bbwi.position(); - if (avail <= 0) { - grow(1, 1); - avail = bbwi.buflen - bbwi.position(); - } - wanted = len - n; - bytes = (wanted < avail) ? wanted : avail; - // Microbenchmarks are showing a loop of ByteBuffer.get(int) being - // faster than ByteBuffer.get(byte[], int, int). - for (int i=0; i bbwi.buflen) - alignAndCheck(1, 1); - bbwi.position(bbwi.position() + 1); - - return new String(c); - } - public final String read_string() { return readStringOrIndirection(false); } @@ -1045,7 +994,7 @@ try { if (valueHandler == null) - valueHandler = ORBUtility.createValueHandler(orb); + valueHandler = ORBUtility.createValueHandler(); value = valueHandler.readValue(parent, indirection, diff -r dc9234e25ab0 -r 5116fe321210 src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java --- a/src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java Mon Jan 14 22:24:57 2013 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java Tue Oct 30 17:06:35 2012 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -189,18 +189,8 @@ private final void createRepositoryIdHandlers() { - if (orb != null) { - // Get the appropriate versions based on the ORB version. The - // ORB versioning info is only in the core ORB. - repIdUtil - = RepositoryIdFactory.getRepIdUtility(orb); - repIdStrs - = RepositoryIdFactory.getRepIdStringsFactory(orb); - } else { - // Get the latest versions - repIdUtil = RepositoryIdFactory.getRepIdUtility(); - repIdStrs = RepositoryIdFactory.getRepIdStringsFactory(); - } + repIdUtil = RepositoryIdFactory.getRepIdUtility(); + repIdStrs = RepositoryIdFactory.getRepIdStringsFactory(); } public BufferManagerWrite getBufferManager() @@ -705,7 +695,7 @@ private void writeArray(Serializable array, Class clazz) { if (valueHandler == null) - valueHandler = ORBUtility.createValueHandler(orb); //d11638 + valueHandler = ORBUtility.createValueHandler(); //d11638 // Write value_tag int indirection = writeValueTag(mustChunk, true, @@ -768,7 +758,7 @@ private void writeRMIIIOPValueType(Serializable object, Class clazz) { if (valueHandler == null) - valueHandler = ORBUtility.createValueHandler(orb); //d11638 + valueHandler = ORBUtility.createValueHandler(); //d11638 Serializable key = object; diff -r dc9234e25ab0 -r 5116fe321210 src/share/classes/com/sun/corba/se/impl/io/FVDCodeBaseImpl.java --- a/src/share/classes/com/sun/corba/se/impl/io/FVDCodeBaseImpl.java Mon Jan 14 22:24:57 2013 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/io/FVDCodeBaseImpl.java Tue Oct 30 17:06:35 2012 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2011, 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 @@ -86,7 +86,7 @@ // default to using the current ORB version in case the // vhandler is not set if (vhandler == null) { - vhandler = new ValueHandlerImpl(false); + vhandler = ValueHandlerImpl.getInstance(false); } // Util.getCodebase may return null which would @@ -120,7 +120,7 @@ // default to using the current ORB version in case the // vhandler is not set if (vhandler == null) { - vhandler = new ValueHandlerImpl(false); + vhandler = ValueHandlerImpl.getInstance(false); } try{ @@ -161,7 +161,7 @@ // default to using the current ORB version in case the // vhandler is not set if (vhandler == null) { - vhandler = new ValueHandlerImpl(false); + vhandler = ValueHandlerImpl.getInstance(false); } Stack repIds = new Stack(); diff -r dc9234e25ab0 -r 5116fe321210 src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java --- a/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java Mon Jan 14 22:24:57 2013 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java Tue Oct 30 17:06:35 2012 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2012, 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 @@ -25,7 +25,7 @@ /* * Licensed Materials - Property of IBM * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved + * Copyright IBM Corp. 1998 2012 All Rights Reserved * */ @@ -56,7 +56,6 @@ import java.util.Arrays; import java.util.Comparator; -import java.util.Hashtable; import com.sun.corba.se.impl.util.RepositoryId; @@ -83,8 +82,6 @@ private static Object noArgsList[] = {}; private static Class noTypesList[] = {}; - private static Hashtable translatedFields; - /** true if represents enum type */ private boolean isEnum; @@ -384,6 +381,42 @@ */ } + private static final class PersistentFieldsValue + extends ClassValue { + PersistentFieldsValue() { } + + protected ObjectStreamField[] computeValue(Class type) { + try { + Field pf = type.getDeclaredField("serialPersistentFields"); + int mods = pf.getModifiers(); + if (Modifier.isPrivate(mods) && Modifier.isStatic(mods) && + Modifier.isFinal(mods)) { + pf.setAccessible(true); + java.io.ObjectStreamField[] fields = + (java.io.ObjectStreamField[])pf.get(type); + return translateFields(fields); + } + } catch (NoSuchFieldException | IllegalAccessException | + IllegalArgumentException | ClassCastException e) { + } + return null; + } + + private static ObjectStreamField[] translateFields( + java.io.ObjectStreamField[] fields) { + ObjectStreamField[] translation = + new ObjectStreamField[fields.length]; + for (int i = 0; i < fields.length; i++) { + translation[i] = new ObjectStreamField(fields[i].getName(), + fields[i].getType()); + } + return translation; + } + } + + private static final PersistentFieldsValue persistentFieldsValue = + new PersistentFieldsValue(); + /* * Initialize class descriptor. This method is only invoked on class * descriptors created via calls to lookupInternal(). This method is kept @@ -416,35 +449,7 @@ * If it is declared, use the declared serialPersistentFields. * Otherwise, extract the fields from the class itself. */ - try { - Field pf = cl.getDeclaredField("serialPersistentFields"); - // serial bug 7; the serialPersistentFields were not - // being read and stored as Accessible bit was not set - pf.setAccessible(true); - // serial bug 7; need to find if the field is of type - // java.io.ObjectStreamField - java.io.ObjectStreamField[] f = - (java.io.ObjectStreamField[])pf.get(cl); - int mods = pf.getModifiers(); - if ((Modifier.isPrivate(mods)) && - (Modifier.isStatic(mods)) && - (Modifier.isFinal(mods))) - { - fields = (ObjectStreamField[])translateFields((Object[])pf.get(cl)); - } - } catch (NoSuchFieldException e) { - fields = null; - } catch (IllegalAccessException e) { - fields = null; - } catch (IllegalArgumentException e) { - fields = null; - } catch (ClassCastException e) { - /* Thrown if a field serialPersistentField exists - * but it is not of type ObjectStreamField. - */ - fields = null; - } - + fields = persistentFieldsValue.get(cl); if (fields == null) { /* Get all of the declared fields for this @@ -641,43 +646,6 @@ superclass = null; } - private static Object[] translateFields(Object objs[]) - throws NoSuchFieldException { - try{ - java.io.ObjectStreamField fields[] = (java.io.ObjectStreamField[])objs; - Object translation[] = null; - - if (translatedFields == null) - translatedFields = new Hashtable(); - - translation = (Object[])translatedFields.get(fields); - - if (translation != null) - return translation; - else { - Class osfClass = Class.forName("com.sun.corba.se.impl.io.ObjectStreamField"); - translation = (Object[])java.lang.reflect.Array.newInstance(osfClass, objs.length); - Object arg[] = new Object[2]; - Class types[] = {String.class, Class.class}; - Constructor constructor = osfClass.getDeclaredConstructor(types); - for (int i = fields.length -1; i >= 0; i--){ - arg[0] = fields[i].getName(); - arg[1] = fields[i].getType(); - - translation[i] = constructor.newInstance(arg); - } - translatedFields.put(fields, translation); - - } - - return (Object[])translation; - } - catch(Throwable t){ - NoSuchFieldException nsfe = new NoSuchFieldException(); - nsfe.initCause( t ) ; - throw nsfe ; - } - } /* * Set the class this version descriptor matches. @@ -1555,8 +1523,8 @@ private boolean hasExternalizableBlockData; Method writeObjectMethod; Method readObjectMethod; - private Method writeReplaceObjectMethod; - private Method readResolveObjectMethod; + private transient Method writeReplaceObjectMethod; + private transient Method readResolveObjectMethod; private Constructor cons ; /** diff -r dc9234e25ab0 -r 5116fe321210 src/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java --- a/src/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java Mon Jan 14 22:24:57 2013 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java Tue Oct 30 17:06:35 2012 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2012, 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 @@ -53,7 +53,7 @@ import com.sun.corba.se.impl.logging.OMGSystemException; import com.sun.corba.se.impl.logging.UtilSystemException; -public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat { +public final class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat { // Property to override our maximum stream format version public static final String FORMAT_VERSION_PROPERTY @@ -150,14 +150,22 @@ writeValueWithVersion(out, value, streamFormatVersion); } - public ValueHandlerImpl(){} + private ValueHandlerImpl(){} - public ValueHandlerImpl(boolean isInputStream) { + private ValueHandlerImpl(boolean isInputStream) { this(); useHashtables = false; this.isInputStream = isInputStream; } + static ValueHandlerImpl getInstance() { + return new ValueHandlerImpl(); + } + + static ValueHandlerImpl getInstance(boolean isInputStream) { + return new ValueHandlerImpl(isInputStream); + } + /** * Writes the value to the stream using java semantics. * @param out The stream to write the value to @@ -458,12 +466,7 @@ return ObjectStreamClass.lookup(value.getClass()).writeReplace(value); } - /** - * Encapsulates writing of Java char arrays so that the 1.3 subclass - * can override it without exposing internals across packages. This - * is a fix for bug 4367783. - */ - protected void writeCharArray(org.omg.CORBA_2_3.portable.OutputStream out, From andrew at icedtea.classpath.org Sat Feb 2 11:14:56 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Sat, 02 Feb 2013 19:14:56 +0000 Subject: /hg/release/icedtea7-forest-2.3/jaxp: 8001235: Improve JAXP HTTP... Message-ID: changeset 91fcc41a0b4b in /hg/release/icedtea7-forest-2.3/jaxp details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jaxp?cmd=changeset;node=91fcc41a0b4b author: joehw date: Mon Oct 29 11:53:57 2012 -0700 8001235: Improve JAXP HTTP handling Reviewed-by: lancea, skoivu diffstat: src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r aa3654afea12 -r 91fcc41a0b4b src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java --- a/src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java Mon Jan 14 22:24:57 2013 +0000 +++ b/src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java Mon Oct 29 11:53:57 2012 -0700 @@ -165,7 +165,7 @@ * should already be fully qualified as path/filename * @param target The target property bag the file will be placed into. */ - public void loadPropertyFile(String file, Properties target) + private void loadPropertyFile(String file, Properties target) { try { From andrew at icedtea.classpath.org Sat Feb 2 11:15:10 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Sat, 02 Feb 2013 19:15:10 +0000 Subject: /hg/release/icedtea7-forest-2.3/hotspot: 8001307: Modify ACC_SUP... Message-ID: changeset f2b98ad97b3c in /hg/release/icedtea7-forest-2.3/hotspot details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/hotspot?cmd=changeset;node=f2b98ad97b3c author: kamg date: Thu Nov 08 17:45:05 2012 -0500 8001307: Modify ACC_SUPER behavior Summary: Disallow non-virtual calls even when ACC_SUPER is absent. Reviewed-by: kvn, acorn diffstat: src/share/vm/interpreter/linkResolver.cpp | 2 +- src/share/vm/runtime/globals.hpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diffs (27 lines): diff -r beecf0b9e760 -r f2b98ad97b3c src/share/vm/interpreter/linkResolver.cpp --- a/src/share/vm/interpreter/linkResolver.cpp Mon Jan 14 22:25:00 2013 +0000 +++ b/src/share/vm/interpreter/linkResolver.cpp Thu Nov 08 17:45:05 2012 -0500 @@ -712,7 +712,7 @@ if (check_access && // a) check if ACC_SUPER flag is set for the current class - current_klass->is_super() && + (current_klass->is_super() || !AllowNonVirtualCalls) && // b) check if the method class is a superclass of the current class (superclass relation is not reflexive!) current_klass->is_subtype_of(method_klass()) && current_klass() != method_klass() && // c) check if the method is not diff -r beecf0b9e760 -r f2b98ad97b3c src/share/vm/runtime/globals.hpp --- a/src/share/vm/runtime/globals.hpp Mon Jan 14 22:25:00 2013 +0000 +++ b/src/share/vm/runtime/globals.hpp Thu Nov 08 17:45:05 2012 -0500 @@ -3902,7 +3902,10 @@ product(bool, UseVMInterruptibleIO, false, \ "(Unstable, Solaris-specific) Thread interrupt before or with " \ "EINTR for I/O operations results in OS_INTRPT. The default value"\ - " of this flag is true for JDK 6 and earlier") + " of this flag is true for JDK 6 and earlier") \ + \ + product(bool, AllowNonVirtualCalls, false, \ + "Obey the ACC_SUPER flag and allow invokenonvirtual calls") /* * Macros for factoring of globals From andrew at icedtea.classpath.org Sat Feb 2 11:15:21 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Sat, 02 Feb 2013 19:15:21 +0000 Subject: /hg/release/icedtea7-forest-2.3/jdk: 29 new changesets Message-ID: changeset c1fa21042291 in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=c1fa21042291 author: mullan date: Fri Oct 26 14:22:21 2012 -0400 7201068: Better handling of UI elements Reviewed-by: xuelei changeset 6e173569e1e7 in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=6e173569e1e7 author: dmocek date: Mon Nov 19 13:52:08 2012 -0800 6563318: RMI data sanitization Reviewed-by: ahgross, hawtin, mchung, smarks changeset bb956f1f9764 in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=bb956f1f9764 author: coffeys date: Wed Jun 13 17:04:15 2012 +0100 7175616: Port fix for TimeZone from JDK 8 to JDK 7 Reviewed-by: okutsu changeset ce105dd2e4de in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=ce105dd2e4de author: mchung date: Mon Nov 26 13:32:17 2012 -0800 6664509: Add logging context 6664528: Find log level matching its name or value given at construction time Reviewed-by: alanb, ahgross, jgish, hawtin changeset 87d135824bdf in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=87d135824bdf author: dholmes date: Wed Aug 22 21:40:19 2012 -0400 6776941: Improve thread pool shutdown Reviewed-by: dl, skoivu changeset ffa0202371bf in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=ffa0202371bf author: anthony date: Fri Sep 28 18:09:28 2012 +0400 7173145: Improve in-memory representation of splashscreens Reviewed-by: bae, mschoene changeset a5cc93f64ee1 in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=a5cc93f64ee1 author: ksrini date: Tue Oct 02 07:05:27 2012 -0700 7186945: Unpack200 improvement Reviewed-by: jrose, jjh, mschoene changeset b8fa52891afa in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=b8fa52891afa author: ksrini date: Tue Oct 02 07:50:25 2012 -0700 7186946: Refine unpacker resource usage Reviewed-by: jrose, jjh, mschoene changeset 339678d41db1 in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=339678d41db1 author: rupashka date: Tue Oct 16 14:55:17 2012 +0400 7186948: Improve Swing data validation Reviewed-by: art, ahgross changeset e46d557465da in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=e46d557465da author: denis date: Tue Oct 30 22:18:42 2012 +0400 7186952: Improve clipboard access Reviewed-by: serb, ahgross changeset f5b89b9c7ebd in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=f5b89b9c7ebd author: khazra date: Thu Oct 18 12:13:15 2012 -0700 7186954: Improve connection performance Reviewed-by: chegar, skoivu changeset e0280c9bb411 in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=e0280c9bb411 author: ksrini date: Tue Oct 02 07:34:37 2012 -0700 7186957: Improve Pack200 data validation Reviewed-by: jrose, jjh, mschoene changeset 496bced2d275 in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=496bced2d275 author: xuelei date: Mon Oct 22 07:31:21 2012 -0700 7192392: Better validation of client keys Summary: Also reviewed by Andrew Gross Reviewed-by: vinnie changeset 5c1e8b779c65 in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=5c1e8b779c65 author: xuelei date: Mon Sep 24 02:06:15 2012 -0700 7192393: Better Checking of order of TLS Messages Summary: Also reviewed by Andrew Gross Reviewed-by: weijun changeset 6527ae06da69 in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=6527ae06da69 author: bagiras date: Tue Nov 13 23:33:57 2012 +0400 7192977: Issue in toolkit thread Reviewed-by: skoivu, rupashka, art changeset c9534e095b37 in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=c9534e095b37 author: mchung date: Fri Nov 02 15:16:27 2012 -0700 7197546: (proxy) Reflect about creating reflective proxies Reviewed-by: alanb, jdn, jrose changeset d1d5d5456b02 in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=d1d5d5456b02 author: rupashka date: Tue Nov 06 17:49:01 2012 +0400 7200491: Tighten up JTable layout code Reviewed-by: art, skoivu changeset ce04db4aba39 in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=ce04db4aba39 author: malenkov date: Mon Oct 15 14:06:54 2012 +0400 7200493: Improve cache handling Reviewed-by: art, ahgross changeset 06e2577f0750 in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=06e2577f0750 author: andrew date: Sat Feb 02 13:30:13 2013 +0000 7200499: Better data validation for options Reviewed-by: darcy, jjh, mschoene changeset 7b89c3dbc9d6 in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=7b89c3dbc9d6 author: ksrini date: Tue Oct 16 10:56:25 2012 -0700 7200500: Launcher better input validation Reviewed-by: darcy, jjh, mschoene changeset bcfe6eb51765 in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=bcfe6eb51765 author: denis date: Fri Nov 23 16:27:32 2012 +0400 7201064: Better dialogue checking Reviewed-by: serb, skoivu changeset b4bfcea7658f in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=b4bfcea7658f author: smarks date: Thu Nov 08 15:21:44 2012 -0800 7201070: Serialization to conform to protocol Reviewed-by: dmocek, ahgross, skoivu changeset ab011765c4e8 in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=ab011765c4e8 author: chegar date: Wed Nov 07 14:03:57 2012 +0000 7201071: InetSocketAddress serialization issue Reviewed-by: alanb, michaelm, skoivu changeset ecf0587c6c88 in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=ecf0587c6c88 author: weijun date: Wed Sep 19 12:58:43 2012 +0800 8000210: Improve JarFile code quality Reviewed-by: ahgross, xuelei, mschoene changeset 6e0d9f4942af in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=6e0d9f4942af author: dsamersoff date: Thu Nov 15 09:41:36 2012 +0100 8000537: Contextualize RequiredModelMBean class Reviewed-by: ahgross, dsamersoff, skoivu Contributed-by: Jaroslav Bachorik changeset b09c28ff798f in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=b09c28ff798f author: dsamersoff date: Tue Oct 30 17:18:43 2012 +0400 8000539: Introspect JMX data handling Summary: Added extra packageAccess check call Reviewed-by: ahgross, dfuchs Contributed-by: jaroslav.bachorik at oracle.com changeset 1cbd6d88554c in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=1cbd6d88554c author: dmocek date: Mon Nov 19 15:32:59 2012 -0800 8001242: Improve RMI HTTP conformance Reviewed-by: ahgross, mchung, smarks changeset d89bd26ac435 in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=d89bd26ac435 author: bae date: Thu Nov 15 19:16:41 2012 +0400 8001972: Improve image processing Reviewed-by: prr, ahgross changeset 50e268c1fb1f in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=50e268c1fb1f author: bae date: Sat Nov 17 18:21:24 2012 +0400 8002325: Improve management of images Reviewed-by: prr, ahgross diffstat: make/java/java/FILES_java.gmk | 3 +- src/share/bin/jli_util.h | 2 +- src/share/bin/parse_manifest.c | 15 +- src/share/classes/com/sun/beans/finder/MethodFinder.java | 7 +- src/share/classes/com/sun/crypto/provider/DHKeyAgreement.java | 5 + src/share/classes/com/sun/java/util/jar/pack/BandStructure.java | 3 +- src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java | 2 + src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java | 6 +- src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java | 4 +- src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java | 6 +- src/share/classes/com/sun/jmx/mbeanserver/Introspector.java | 8 +- src/share/classes/java/awt/Dialog.java | 53 +- src/share/classes/java/awt/EventQueue.java | 19 +- src/share/classes/java/awt/TextComponent.java | 25 +- src/share/classes/java/awt/Window.java | 2 +- src/share/classes/java/io/ObjectInputStream.java | 6 + src/share/classes/java/lang/Class.java | 47 +- src/share/classes/java/lang/invoke/MethodHandleProxies.java | 73 +- src/share/classes/java/lang/reflect/Proxy.java | 151 ++- src/share/classes/java/net/InetSocketAddress.java | 272 +++- src/share/classes/java/util/TimeZone.java | 59 +- src/share/classes/java/util/concurrent/ThreadPoolExecutor.java | 172 +- src/share/classes/java/util/jar/JarFile.java | 21 +- src/share/classes/java/util/logging/Level.java | 255 ++++- src/share/classes/java/util/logging/LogManager.java | 535 ++++++--- src/share/classes/java/util/logging/Logger.java | 67 +- src/share/classes/java/util/logging/Logging.java | 14 +- src/share/classes/java/util/logging/LoggingProxyImpl.java | 11 +- src/share/classes/java/util/logging/SimpleFormatter.java | 2 +- src/share/classes/javax/management/modelmbean/RequiredModelMBean.java | 227 +++- src/share/classes/javax/swing/JTable.java | 14 +- src/share/classes/javax/swing/RepaintManager.java | 156 +- src/share/classes/javax/swing/UIDefaults.java | 2 + src/share/classes/javax/swing/plaf/nimbus/NimbusLookAndFeel.java | 7 +- src/share/classes/sun/applet/AppletPanel.java | 60 +- src/share/classes/sun/awt/AWTAccessor.java | 7 + src/share/classes/sun/awt/AppContext.java | 62 +- src/share/classes/sun/awt/image/ByteComponentRaster.java | 70 +- src/share/classes/sun/awt/image/ByteInterleavedRaster.java | 29 +- src/share/classes/sun/awt/image/ShortComponentRaster.java | 69 +- src/share/classes/sun/awt/image/ShortInterleavedRaster.java | 29 +- src/share/classes/sun/misc/JavaAWTAccess.java | 42 + src/share/classes/sun/misc/SharedSecrets.java | 13 +- src/share/classes/sun/net/httpserver/ChunkedInputStream.java | 14 +- src/share/classes/sun/net/www/http/ChunkedInputStream.java | 9 + src/share/classes/sun/nio/ch/DatagramChannelImpl.java | 18 +- src/share/classes/sun/reflect/misc/ReflectUtil.java | 59 + src/share/classes/sun/rmi/transport/proxy/CGIHandler.java | 19 +- src/share/classes/sun/rmi/transport/proxy/HttpInputStream.java | 15 +- src/share/classes/sun/security/pkcs11/P11KeyAgreement.java | 9 + src/share/classes/sun/security/ssl/ClientHandshaker.java | 13 +- src/share/classes/sun/security/ssl/DHClientKeyExchange.java | 19 +- src/share/classes/sun/security/ssl/DHCrypt.java | 87 +- src/share/classes/sun/security/ssl/HandshakeMessage.java | 16 +- src/share/classes/sun/security/ssl/RSAClientKeyExchange.java | 4 +- src/share/classes/sun/security/ssl/ServerHandshaker.java | 18 +- src/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java | 4 +- src/share/classes/sun/security/util/DerIndefLenConverter.java | 4 + src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java | 2 +- src/share/classes/sun/security/util/KeyLength.java | 91 - src/share/classes/sun/security/util/KeyUtil.java | 204 +++ src/share/lib/security/java.security | 22 +- src/share/lib/security/java.security-macosx | 18 +- src/share/lib/security/java.security-solaris | 16 +- src/share/lib/security/java.security-windows | 16 +- src/share/native/com/sun/java/util/jar/pack/bands.cpp | 4 + src/share/native/com/sun/java/util/jar/pack/bands.h | 4 +- src/share/native/com/sun/java/util/jar/pack/jni.cpp | 53 +- src/share/native/com/sun/java/util/jar/pack/unpack.cpp | 33 +- src/share/native/sun/awt/image/awt_parseImage.c | 110 +- src/share/native/sun/awt/image/awt_parseImage.h | 1 + src/share/native/sun/awt/medialib/safe_alloc.h | 5 + src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c | 4 + src/solaris/classes/sun/nio/ch/SctpChannelImpl.java | 14 +- src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java | 16 +- src/solaris/native/sun/nio/ch/DatagramChannelImpl.c | 9 +- src/solaris/native/sun/nio/ch/SctpChannelImpl.c | 27 +- src/windows/bin/java_md.c | 34 +- src/windows/classes/sun/awt/windows/WComponentPeer.java | 9 +- src/windows/classes/sun/awt/windows/WEmbeddedFrame.java | 15 +- src/windows/native/sun/nio/ch/DatagramChannelImpl.c | 10 +- src/windows/native/sun/windows/awt_TextComponent.cpp | 22 +- src/windows/native/sun/windows/awt_TextComponent.h | 3 +- 83 files changed, 2618 insertions(+), 1064 deletions(-) diffs (truncated from 6437 to 500 lines): diff -r 96d4f04f2b7c -r 50e268c1fb1f make/java/java/FILES_java.gmk --- a/make/java/java/FILES_java.gmk Mon Jan 14 22:25:02 2013 +0000 +++ b/make/java/java/FILES_java.gmk Sat Nov 17 18:21:24 2012 +0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1996, 2012, 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 @@ -476,6 +476,7 @@ sun/misc/MessageUtils.java \ sun/misc/GC.java \ sun/misc/Service.java \ + sun/misc/JavaAWTAccess.java \ sun/misc/JavaLangAccess.java \ sun/misc/JavaIOAccess.java \ sun/misc/JavaIOFileDescriptorAccess.java \ diff -r 96d4f04f2b7c -r 50e268c1fb1f src/share/bin/jli_util.h --- a/src/share/bin/jli_util.h Mon Jan 14 22:25:02 2013 +0000 +++ b/src/share/bin/jli_util.h Sat Nov 17 18:21:24 2012 +0400 @@ -55,7 +55,7 @@ #include #define JLI_StrCaseCmp(p1, p2) stricmp((p1), (p2)) #define JLI_StrNCaseCmp(p1, p2, p3) strnicmp((p1), (p2), (p3)) -#define JLI_Snprintf _snprintf +size_t JLI_Snprintf(char *buffer, size_t size, const char *format, ...); #else #include #define JLI_StrCaseCmp(p1, p2) strcasecmp((p1), (p2)) diff -r 96d4f04f2b7c -r 50e268c1fb1f src/share/bin/parse_manifest.c --- a/src/share/bin/parse_manifest.c Mon Jan 14 22:25:02 2013 +0000 +++ b/src/share/bin/parse_manifest.c Sat Nov 17 18:21:24 2012 +0400 @@ -490,9 +490,9 @@ #ifdef O_BINARY | O_BINARY /* use binary mode on windows */ #endif - )) == -1) + )) == -1) { return (-1); - + } info->manifest_version = NULL; info->main_class = NULL; info->jre_version = NULL; @@ -539,12 +539,14 @@ zentry entry; void *data = NULL; - fd = open(jarfile, O_RDONLY + if ((fd = open(jarfile, O_RDONLY #ifdef O_BINARY | O_BINARY /* use binary mode on windows */ #endif - ); - if (fd != -1 && find_file(fd, &entry, filename) == 0) { + )) == -1) { + return NULL; + } + if (find_file(fd, &entry, filename) == 0) { data = inflate_file(fd, &entry, size); } close(fd); @@ -586,8 +588,9 @@ #ifdef O_BINARY | O_BINARY /* use binary mode on windows */ #endif - )) == -1) + )) == -1) { return (-1); + } if (rc = find_file(fd, &entry, manifest_name) != 0) { close(fd); diff -r 96d4f04f2b7c -r 50e268c1fb1f src/share/classes/com/sun/beans/finder/MethodFinder.java --- a/src/share/classes/com/sun/beans/finder/MethodFinder.java Mon Jan 14 22:25:02 2013 +0000 +++ b/src/share/classes/com/sun/beans/finder/MethodFinder.java Sat Nov 17 18:21:24 2012 +0400 @@ -68,11 +68,14 @@ Signature signature = new Signature(type, name, args); Method method = CACHE.get(signature); - if (method != null) { + boolean cached = method != null; + if (cached && isPackageAccessible(method.getDeclaringClass())) { return method; } method = findAccessibleMethod(new MethodFinder(name, args).find(type.getMethods())); - CACHE.put(signature, method); + if (!cached) { + CACHE.put(signature, method); + } return method; } diff -r 96d4f04f2b7c -r 50e268c1fb1f src/share/classes/com/sun/crypto/provider/DHKeyAgreement.java --- a/src/share/classes/com/sun/crypto/provider/DHKeyAgreement.java Mon Jan 14 22:25:02 2013 +0000 +++ b/src/share/classes/com/sun/crypto/provider/DHKeyAgreement.java Sat Nov 17 18:21:24 2012 +0400 @@ -41,6 +41,8 @@ import javax.crypto.SecretKey; import javax.crypto.spec.*; +import sun.security.util.KeyUtil; + /** * This class implements the Diffie-Hellman key agreement protocol between * any number of parties. @@ -200,6 +202,9 @@ throw new InvalidKeyException("Incompatible parameters"); } + // validate the Diffie-Hellman public key + KeyUtil.validate(dhPubKey); + // store the y value this.y = dhPubKey.getY(); diff -r 96d4f04f2b7c -r 50e268c1fb1f src/share/classes/com/sun/java/util/jar/pack/BandStructure.java --- a/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java Mon Jan 14 22:25:02 2013 +0000 +++ b/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java Sat Nov 17 18:21:24 2012 +0400 @@ -1003,7 +1003,6 @@ /** Write a constant pool reference. */ public void putRef(Entry e) { - assert(index != null); addValue(encodeRefOrNull(e, index)); } public void putRef(Entry e, Index index) { @@ -1055,6 +1054,8 @@ int encodeRef(Entry e, Index ix) { + if (ix == null) + throw new RuntimeException("null index for " + e.stringValue()); int coding = ix.indexOf(e); if (verbose > 2) Utils.log.fine("putRef "+coding+" => "+e); diff -r 96d4f04f2b7c -r 50e268c1fb1f src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java --- a/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java Mon Jan 14 22:25:02 2013 +0000 +++ b/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java Sat Nov 17 18:21:24 2012 +0400 @@ -1049,6 +1049,8 @@ /** Index of all CP entries of a given tag and class. */ public Index getMemberIndex(byte tag, ClassEntry classRef) { + if (classRef == null) + throw new RuntimeException("missing class reference for " + tagName(tag)); if (indexByTagAndClass == null) indexByTagAndClass = new Index[CONSTANT_Limit][]; Index allClasses = getIndexByTag(CONSTANT_Class); diff -r 96d4f04f2b7c -r 50e268c1fb1f src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java --- a/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java Mon Jan 14 22:25:02 2013 +0000 +++ b/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java Sat Nov 17 18:21:24 2012 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, 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 @@ -104,6 +104,10 @@ return (p200 == null)? null: p200._nunp; } + private synchronized long getUnpackerPtr() { + return unpackerPtr; + } + // Callback from the unpacker engine to get more data. private long readInputFn(ByteBuffer pbuf, long minlen) throws IOException { if (in == null) return 0; // nothing is readable diff -r 96d4f04f2b7c -r 50e268c1fb1f src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java --- a/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java Mon Jan 14 22:25:02 2013 +0000 +++ b/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java Sat Nov 17 18:21:24 2012 +0400 @@ -83,7 +83,7 @@ * @param out an OutputStream * @exception IOException if an error is encountered. */ - public void pack(JarFile in, OutputStream out) throws IOException { + public synchronized void pack(JarFile in, OutputStream out) throws IOException { assert(Utils.currentInstance.get() == null); TimeZone tz = (props.getBoolean(Utils.PACK_DEFAULT_TIMEZONE)) ? null @@ -118,7 +118,7 @@ * @param out an OutputStream * @exception IOException if an error is encountered. */ - public void pack(JarInputStream in, OutputStream out) throws IOException { + public synchronized void pack(JarInputStream in, OutputStream out) throws IOException { assert(Utils.currentInstance.get() == null); TimeZone tz = (props.getBoolean(Utils.PACK_DEFAULT_TIMEZONE)) ? null : TimeZone.getDefault(); diff -r 96d4f04f2b7c -r 50e268c1fb1f src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java --- a/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java Mon Jan 14 22:25:02 2013 +0000 +++ b/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java Sat Nov 17 18:21:24 2012 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, 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 @@ -106,7 +106,7 @@ * @param out a JarOutputStream. * @exception IOException if an error is encountered. */ - public void unpack(InputStream in, JarOutputStream out) throws IOException { + public synchronized void unpack(InputStream in, JarOutputStream out) throws IOException { if (in == null) { throw new NullPointerException("null input"); } @@ -151,7 +151,7 @@ * @param out a JarOutputStream. * @exception IOException if an error is encountered. */ - public void unpack(File in, JarOutputStream out) throws IOException { + public synchronized void unpack(File in, JarOutputStream out) throws IOException { if (in == null) { throw new NullPointerException("null input"); } diff -r 96d4f04f2b7c -r 50e268c1fb1f src/share/classes/com/sun/jmx/mbeanserver/Introspector.java --- a/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java Mon Jan 14 22:25:02 2013 +0000 +++ b/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java Sat Nov 17 18:21:24 2012 +0400 @@ -56,6 +56,8 @@ import java.lang.reflect.InvocationTargetException; import javax.management.AttributeNotFoundException; import javax.management.openmbean.CompositeData; +import sun.reflect.misc.MethodUtil; +import sun.reflect.misc.ReflectUtil; /** * This class contains the methods for performing all the tests needed to verify @@ -528,8 +530,10 @@ // to locate method readMethod = SimpleIntrospector.getReadMethod(clazz, element); } - if (readMethod != null) - return readMethod.invoke(complex); + if (readMethod != null) { + ReflectUtil.checkPackageAccess(readMethod.getDeclaringClass()); + return MethodUtil.invoke(readMethod, complex, new Class[0]); + } throw new AttributeNotFoundException( "Could not find the getter method for the property " + diff -r 96d4f04f2b7c -r 50e268c1fb1f src/share/classes/java/awt/Dialog.java --- a/src/share/classes/java/awt/Dialog.java Mon Jan 14 22:25:02 2013 +0000 +++ b/src/share/classes/java/awt/Dialog.java Sat Nov 17 18:21:24 2012 +0400 @@ -39,6 +39,7 @@ import sun.awt.util.IdentityArrayList; import sun.awt.util.IdentityLinkedList; import sun.security.util.SecurityConstants; +import java.security.AccessControlException; /** * A Dialog is a top-level window with a title and a border @@ -128,6 +129,8 @@ */ boolean undecorated = false; + private transient boolean initialized = false; + /** * Modal dialogs block all input to some top-level windows. * Whether a particular window is blocked depends on dialog's type @@ -671,6 +674,7 @@ this.title = title; setModalityType(modalityType); SunToolkit.checkAndSetPolicy(this); + initialized = true; } /** @@ -722,6 +726,7 @@ this.title = title; setModalityType(modalityType); SunToolkit.checkAndSetPolicy(this); + initialized = true; } /** @@ -851,12 +856,9 @@ if (modalityType == type) { return; } - if (type == ModalityType.TOOLKIT_MODAL) { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - sm.checkPermission(SecurityConstants.AWT.TOOLKIT_MODALITY_PERMISSION); - } - } + + checkModalityPermission(type); + modalityType = type; modal = (modalityType != ModalityType.MODELESS); } @@ -1025,6 +1027,9 @@ */ @Deprecated public void show() { + if (!initialized) throw new IllegalStateException( + "The dialog component has not been initialized properly"); + beforeFirstShow = false; if (!isModal()) { conditionalShow(null, null); @@ -1600,18 +1605,50 @@ } } + private void checkModalityPermission(ModalityType mt) { + if (mt == ModalityType.TOOLKIT_MODAL) { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission( + SecurityConstants.AWT.TOOLKIT_MODALITY_PERMISSION + ); + } + } + } + private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException, HeadlessException { GraphicsEnvironment.checkHeadless(); - s.defaultReadObject(); + + java.io.ObjectInputStream.GetField fields = + s.readFields(); + + ModalityType localModalityType = (ModalityType)fields.get("modalityType", null); + + try { + checkModalityPermission(localModalityType); + } catch (AccessControlException ace) { + localModalityType = DEFAULT_MODALITY_TYPE; + } // in 1.5 or earlier modalityType was absent, so use "modal" instead - if (modalityType == null) { + if (localModalityType == null) { + this.modal = fields.get("modal", false); setModal(modal); } + this.resizable = fields.get("resizable", true); + this.undecorated = fields.get("undecorated", false); + this.title = (String)fields.get("title", ""); + this.modalityType = localModalityType; + blockedWindows = new IdentityArrayList(); + + SunToolkit.checkAndSetPolicy(this); + + initialized = true; + } /* diff -r 96d4f04f2b7c -r 50e268c1fb1f src/share/classes/java/awt/EventQueue.java --- a/src/share/classes/java/awt/EventQueue.java Mon Jan 14 22:25:02 2013 +0000 +++ b/src/share/classes/java/awt/EventQueue.java Sat Nov 17 18:21:24 2012 +0400 @@ -189,7 +189,8 @@ } public void removeSourceEvents(EventQueue eventQueue, Object source, - boolean removeAllEvents) { + boolean removeAllEvents) + { eventQueue.removeSourceEvents(source, removeAllEvents); } public boolean noEvents(EventQueue eventQueue) { @@ -198,6 +199,11 @@ public void wakeup(EventQueue eventQueue, boolean isShutdown) { eventQueue.wakeup(isShutdown); } + public void invokeAndWait(Object source, Runnable r) + throws InterruptedException, InvocationTargetException + { + EventQueue.invokeAndWait(source, r); + } }); } @@ -1233,8 +1239,14 @@ * @since 1.2 */ public static void invokeAndWait(Runnable runnable) - throws InterruptedException, InvocationTargetException { + throws InterruptedException, InvocationTargetException + { + invokeAndWait(Toolkit.getDefaultToolkit(), runnable); + } + static void invokeAndWait(Object source, Runnable runnable) + throws InterruptedException, InvocationTargetException + { if (EventQueue.isDispatchThread()) { throw new Error("Cannot call invokeAndWait from the event dispatcher thread"); } @@ -1243,8 +1255,7 @@ Object lock = new AWTInvocationLock(); InvocationEvent event = - new InvocationEvent(Toolkit.getDefaultToolkit(), runnable, lock, - true); + new InvocationEvent(source, runnable, lock, true); synchronized (lock) { Toolkit.getEventQueue().postEvent(event); diff -r 96d4f04f2b7c -r 50e268c1fb1f src/share/classes/java/awt/TextComponent.java --- a/src/share/classes/java/awt/TextComponent.java Mon Jan 14 22:25:02 2013 +0000 +++ b/src/share/classes/java/awt/TextComponent.java Sat Nov 17 18:21:24 2012 +0400 @@ -107,12 +107,6 @@ // the background color of non-editable TextComponents. boolean backgroundSetByClientCode = false; - /** - * True if this TextComponent has access - * to the System clipboard. - */ - transient private boolean canAccessClipboard; - transient protected TextListener textListener; /* @@ -137,7 +131,6 @@ GraphicsEnvironment.checkHeadless(); this.text = (text != null) ? text : ""; setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR)); - checkSystemClipboardAccess(); } private void enableInputMethodsIfNecessary() { @@ -727,17 +720,14 @@ /** * Assigns a valid value to the canAccessClipboard instance variable. */ - private void checkSystemClipboardAccess() { - canAccessClipboard = true; + private boolean canAccessClipboard() { SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - try { - sm.checkSystemClipboardAccess(); - } - catch (SecurityException e) { - canAccessClipboard = false; - } - } + if (sm == null) return true; + try { + sm.checkSystemClipboardAccess(); + return true; + } catch (SecurityException e) {} + return false; } /* @@ -820,7 +810,6 @@ } } enableInputMethodsIfNecessary(); - checkSystemClipboardAccess(); } diff -r 96d4f04f2b7c -r 50e268c1fb1f src/share/classes/java/awt/Window.java --- a/src/share/classes/java/awt/Window.java Mon Jan 14 22:25:02 2013 +0000 +++ b/src/share/classes/java/awt/Window.java Sat Nov 17 18:21:24 2012 +0400 @@ -1206,7 +1206,7 @@ } else { try { - EventQueue.invokeAndWait(action); + EventQueue.invokeAndWait(this, action); } catch (InterruptedException e) { System.err.println("Disposal was interrupted:"); diff -r 96d4f04f2b7c -r 50e268c1fb1f src/share/classes/java/io/ObjectInputStream.java --- a/src/share/classes/java/io/ObjectInputStream.java Mon Jan 14 22:25:02 2013 +0000 +++ b/src/share/classes/java/io/ObjectInputStream.java Sat Nov 17 18:21:24 2012 +0400 @@ -1750,6 +1750,12 @@ ObjectStreamClass desc = readClassDesc(false); desc.checkDeserialize(); + Class cl = desc.forClass(); + if (cl == String.class || cl == Class.class + || cl == ObjectStreamClass.class) { + throw new InvalidClassException("invalid class descriptor"); + } + Object obj; try { obj = desc.isInstantiable() ? desc.newInstance() : null; diff -r 96d4f04f2b7c -r 50e268c1fb1f src/share/classes/java/lang/Class.java --- a/src/share/classes/java/lang/Class.java Mon Jan 14 22:25:02 2013 +0000 +++ b/src/share/classes/java/lang/Class.java Sat Nov 17 18:21:24 2012 +0400 @@ -65,7 +65,9 @@ import sun.reflect.generics.scope.ClassScope; import sun.security.util.SecurityConstants; From jvanek at redhat.com Sun Feb 3 04:08:12 2013 From: jvanek at redhat.com (Jiri Vanek) Date: Sun, 03 Feb 2013 13:08:12 +0100 Subject: [fyi][icedtea-web] backend and itw-settings for extended applets security Message-ID: <510E532C.8040401@redhat.com> Whole troubles are described here http://icedtea.classpath.org/wiki/Extended_Applets_Security rather then in plain email. There is what me and adam have already achieved on this topic, what we have o achieve and where we are stil not so sure.... This patch is containing itw-settings part and backend for manipulating stored entries.and basic matching. I noted this just [fyi] because adam ave already walked through the patch, and so have I across his part. So the patch should be ready for push unless someone find something malicious on implementation or even on design. J. -------------- next part -------------- A non-text attachment was scrubbed... Name: intgrationJV-localised-_3.patch Type: text/x-patch Size: 110815 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130203/23b51300/intgrationJV-localised-_3.patch From jvanek at redhat.com Sun Feb 3 04:54:49 2013 From: jvanek at redhat.com (Jiri Vanek) Date: Sun, 03 Feb 2013 13:54:49 +0100 Subject: [rfc][icedtea-web] Renaming of conflict names for case insensitive systems In-Reply-To: <510A82CB.3020608@redhat.com> References: <510A3F0D.10906@redhat.com> <510A82CB.3020608@redhat.com> Message-ID: <510E5E19.2060308@redhat.com> On 01/31/2013 03:42 PM, Adam Domurad wrote: > On 01/31/2013 04:53 AM, Jiri Vanek wrote: >> 2013-01-31 Jiri Vanek >> >> Renamed conflict file for case insensitive systems >> * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2E.html: >> Renamed to ParallelAppletsTest_1_x_2EE.html >> * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2EE.html: >> new file. >> * tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java: >> (testParallelAppletsTest1x2E) adapted to renaming > > Looks good. Approved. > -Adam Argh, one more file name escaped.So renaming now Checked by find . | grep -v \.hg | sort | uniq -di so nothing more should remains 2013-02-03 Jiri Vanek Another renamed conflict file for case insensitive systems * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1E_x_2s.html Renamed to ParallelAppletsTest_1_x_2EE.html * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1EE_x_2s.html new file. * tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java: (testParallelAppletsTest1Ex2s) adapted to renamin -------------- next part -------------- diff --git a/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1E_x_2s.html b/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1EE_x_2s.html rename from tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1E_x_2s.html rename to tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1EE_x_2s.html diff --git a/tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java b/tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java --- a/tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java +++ b/tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java @@ -50,7 +50,7 @@ @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay public void testParallelAppletsTest1Ex2s() throws Exception { - ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1E_x_2s.html"); + ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1EE_x_2s.html"); checkSimpleSignedStarted(pr); checkNotInitialised(pr); } -------------- next part -------------- diff -r e631770d76ba tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1EE_x_2s.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1EE_x_2s.html Sun Feb 03 13:43:54 2013 +0100 @@ -0,0 +1,44 @@ + + +

+

+

+

+ + diff -r e631770d76ba tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1E_x_2s.html --- a/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1E_x_2s.html Thu Jan 31 11:12:35 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ - - -

-

-

-

- - diff -r e631770d76ba tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java --- a/tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java Thu Jan 31 11:12:35 2013 +0100 +++ b/tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java Sun Feb 03 13:43:54 2013 +0100 @@ -50,7 +50,7 @@ @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay public void testParallelAppletsTest1Ex2s() throws Exception { - ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1E_x_2s.html"); + ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1EE_x_2s.html"); checkSimpleSignedStarted(pr); checkNotInitialised(pr); } From jvanek at redhat.com Sun Feb 3 05:05:58 2013 From: jvanek at redhat.com (Jiri Vanek) Date: Sun, 03 Feb 2013 14:05:58 +0100 Subject: /hg/icedtea-web: Renamed conflict file for case insensitive systems In-Reply-To: <201302021711.r12HB7Vb008572@mail-web01.excite.co.jp> References: <201302021711.r12HB7Vb008572@mail-web01.excite.co.jp> Message-ID: <510E60B6.7070006@redhat.com> On 02/02/2013 06:11 PM, Jakob Wisor wrote:> wrote: >> changeset e631770d76ba in /hg/icedtea-web >> details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=e631770d76ba >> author: Jiri Vanek >> date: Thu Jan 31 11:12:35 2013 +0100 >> >> Renamed conflict file for case insensitive systems > > Thank you Jiri. There are more conflicting file names: > > tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1e_x_2s.html > tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1E_x_2s.html Damn, verified that those are last ones. Patch posted for review. > > There may be even more conflicting file names. Unfortunately, I do not have any means at hand to > do a programmatic or in an automated check of the entire repository. Should you have any time eft > to take a deeper look into this matter, please do so, since I cannot change file names on an > case-insensitive file system as long as it has not been cloned. > Thank you for your patience. > > ps.: I have made myself familiar with the commit and review policy. I should be able to post a > request for review later this evening. ps: You really do not need to trouble with it :) You need to send the translated files only and to this list;) The integration, testing and push will be done by somebody with push permissions. But of course it is just welcomed to know the policy, and especially for case of some unexpected troubles. J. From andrew at icedtea.classpath.org Sun Feb 3 10:23:50 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Sun, 03 Feb 2013 18:23:50 +0000 Subject: /hg/release/icedtea6-1.11: 2 new changesets Message-ID: changeset 5abf1a204fb2 in /hg/release/icedtea6-1.11 details: http://icedtea.classpath.org/hg/release/icedtea6-1.11?cmd=changeset;node=5abf1a204fb2 author: Andrew John Hughes date: Sun Feb 03 12:56:19 2013 +0000 Bump to 1.11.6 and set release date. 2013-02-03 Andrew John Hughes * NEWS: Add release date. * configure.ac: Bump to 1.11.6. changeset 8a03649e01c9 in /hg/release/icedtea6-1.11 details: http://icedtea.classpath.org/hg/release/icedtea6-1.11?cmd=changeset;node=8a03649e01c9 author: Andrew John Hughes date: Sun Feb 03 18:23:36 2013 +0000 Added tag icedtea6-1.11.6 for changeset 5abf1a204fb2 diffstat: .hgtags | 1 + ChangeLog | 5 +++++ NEWS | 3 +-- configure.ac | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diffs (49 lines): diff -r 448eb298bffc -r 8a03649e01c9 .hgtags --- a/.hgtags Sat Feb 02 07:50:53 2013 +0000 +++ b/.hgtags Sun Feb 03 18:23:36 2013 +0000 @@ -28,3 +28,4 @@ a9b49bd3d0b5c54eb368b5f9f9b96b8d1aef843d icedtea6-1.11.3 a773e4481576804dfdf51501727bd5461f88b801 icedtea6-1.11.4 f63ce43904998e7e9ac04558ada787bb73044ef6 icedtea6-1.11.5 +5abf1a204fb2d79db87beb5735f4cff245e90ff6 icedtea6-1.11.6 diff -r 448eb298bffc -r 8a03649e01c9 ChangeLog --- a/ChangeLog Sat Feb 02 07:50:53 2013 +0000 +++ b/ChangeLog Sun Feb 03 18:23:36 2013 +0000 @@ -1,3 +1,8 @@ +2013-02-03 Andrew John Hughes + + * NEWS: Add release date. + * configure.ac: Bump to 1.11.6. + 2013-02-01 Andrew John Hughes * NEWS: Add security fixes. diff -r 448eb298bffc -r 8a03649e01c9 NEWS --- a/NEWS Sat Feb 02 07:50:53 2013 +0000 +++ b/NEWS Sun Feb 03 18:23:36 2013 +0000 @@ -10,7 +10,7 @@ CVE-XXXX-YYYY: http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY -New in release 1.11.6 (20XX-XX-XX): +New in release 1.11.6 (2012-02-03): * Security fixes - S6563318, CVE-2013-0424: RMI data sanitization @@ -45,7 +45,6 @@ - S8001307: Modify ACC_SUPER behavior - S8001972, CVE-2013-1478: Improve image processing - S8002325, CVE-2013-1480: Improve management of images - * Backports - S7010849: 5/5 Extraneous javac source/target options when building sa-jdi diff -r 448eb298bffc -r 8a03649e01c9 configure.ac --- a/configure.ac Sat Feb 02 07:50:53 2013 +0000 +++ b/configure.ac Sun Feb 03 18:23:36 2013 +0000 @@ -1,4 +1,4 @@ -AC_INIT([icedtea6],[1.11.6pre],[distro-pkg-dev at openjdk.java.net]) +AC_INIT([icedtea6],[1.11.6],[distro-pkg-dev at openjdk.java.net]) AM_INIT_AUTOMAKE([1.9 tar-pax foreign]) AC_CONFIG_FILES([Makefile]) From gnu.andrew at redhat.com Sun Feb 3 10:30:28 2013 From: gnu.andrew at redhat.com (Andrew John Hughes) Date: Sun, 3 Feb 2013 18:30:28 +0000 Subject: [SECURITY] IcedTea6 1.11.6 Released! Message-ID: <20130203183027.GA14069@carrie.middle-earth.co.uk> The IcedTea project provides a harness to build the source code from OpenJDK6 using Free Software build tools, along with additional features such as a PulseAudio sound driver and support for alternative virtual machines. A new security release is now available: 1.11.6. An update for the recent release, 1.12.1, will follow shortly. The update contains the following security fixes: * S6563318, CVE-2013-0424: RMI data sanitization * S6664509, CVE-2013-0425: Add logging context * S6664528, CVE-2013-0426: Find log level matching its name or value given at construction time * S6776941: CVE-2013-0427: Improve thread pool shutdown * S7141694, CVE-2013-0429: Improving CORBA internals * S7173145: Improve in-memory representation of splashscreens * S7186945: Unpack200 improvement * S7186946: Refine unpacker resource usage * S7186948: Improve Swing data validation * S7186952, CVE-2013-0432: Improve clipboard access * S7186954: Improve connection performance * S7186957: Improve Pack200 data validation * S7192392, CVE-2013-0443: Better validation of client keys * S7192393, CVE-2013-0440: Better Checking of order of TLS Messages * S7192977, CVE-2013-0442: Issue in toolkit thread * S7197546, CVE-2013-0428: (proxy) Reflect about creating reflective proxies * S7200491: Tighten up JTable layout code * S7200500: Launcher better input validation * S7201064: Better dialogue checking * S7201066, CVE-2013-0441: Change modifiers on unused fields * S7201068, CVE-2013-0435: Better handling of UI elements * S7201070: Serialization to conform to protocol * S7201071, CVE-2013-0433: InetSocketAddress serialization issue * S8000210: Improve JarFile code quality * S8000537, CVE-2013-0450: Contextualize RequiredModelMBean class * S8000540, CVE-2013-1475: Improve IIOP type reuse management * S8000631, CVE-2013-1476: Restrict access to class constructor * S8001235, CVE-2013-0434: Improve JAXP HTTP handling * S8001242: Improve RMI HTTP conformance * S8001307: Modify ACC_SUPER behavior * S8001972, CVE-2013-1478: Improve image processing * S8002325, CVE-2013-1480: Improve management of images Full details can be found below. What?s New? ?????? New in release 1.11.6 (2012-02-03): * Security fixes - S6563318, CVE-2013-0424: RMI data sanitization - S6664509, CVE-2013-0425: Add logging context - S6664528, CVE-2013-0426: Find log level matching its name or value given at construction time - S6776941: CVE-2013-0427: Improve thread pool shutdown - S7141694, CVE-2013-0429: Improving CORBA internals - S7173145: Improve in-memory representation of splashscreens - S7186945: Unpack200 improvement - S7186946: Refine unpacker resource usage - S7186948: Improve Swing data validation - S7186952, CVE-2013-0432: Improve clipboard access - S7186954: Improve connection performance - S7186957: Improve Pack200 data validation - S7192392, CVE-2013-0443: Better validation of client keys - S7192393, CVE-2013-0440: Better Checking of order of TLS Messages - S7192977, CVE-2013-0442: Issue in toolkit thread - S7197546, CVE-2013-0428: (proxy) Reflect about creating reflective proxies - S7200491: Tighten up JTable layout code - S7200500: Launcher better input validation - S7201064: Better dialogue checking - S7201066, CVE-2013-0441: Change modifiers on unused fields - S7201068, CVE-2013-0435: Better handling of UI elements - S7201070: Serialization to conform to protocol - S7201071, CVE-2013-0433: InetSocketAddress serialization issue - S8000210: Improve JarFile code quality - S8000537, CVE-2013-0450: Contextualize RequiredModelMBean class - S8000540, CVE-2013-1475: Improve IIOP type reuse management - S8000631, CVE-2013-1476: Restrict access to class constructor - S8001235, CVE-2013-0434: Improve JAXP HTTP handling - S8001242: Improve RMI HTTP conformance - S8001307: Modify ACC_SUPER behavior - S8001972, CVE-2013-1478: Improve image processing - S8002325, CVE-2013-1480: Improve management of images * Backports - S7010849: 5/5 Extraneous javac source/target options when building sa-jdi The tarball can be downloaded from: * http://icedtea.classpath.org/download/source/icedtea6-1.11.6.tar.gz SHA256 checksum: 1d4efe74bf8902c6682512ddb3cf71620e4fe107d1fb364b71453b551860fcca icedtea6-1.11.6.tar.gz Each tarball is accompanied by a digital signature (available at the above URL + '.sig'). This is produced using my public key. See details below. The following people helped with these releases: * Andrew John Hughes (applying all security patches & backports, release management) * Omair Majid (identification of ordering issues with security patches) We would also like to thank the bug reporters and testers! To get started: $ tar xzf icedtea6-1.11.6.tar.gz Full build requirements and instructions are in INSTALL: $ mkdir icedtea6-build $ cd icedtea6-build $ ../icedtea6-1.11.6/configure [--enable-zero --enable-pulse-java --enable-systemtap ...] $ make Happy hacking! -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130203/b0153aa7/attachment.bin From andrew at icedtea.classpath.org Sun Feb 3 10:36:27 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Sun, 03 Feb 2013 18:36:27 +0000 Subject: /hg/release/icedtea7-forest-2.3: Added tag icedtea-2.3.5 for cha... Message-ID: changeset 02128561d696 in /hg/release/icedtea7-forest-2.3 details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3?cmd=changeset;node=02128561d696 author: andrew date: Sun Feb 03 18:35:09 2013 +0000 Added tag icedtea-2.3.5 for changeset 8bd8e70d4a03 diffstat: .hgtags | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diffs (8 lines): diff -r 8bd8e70d4a03 -r 02128561d696 .hgtags --- a/.hgtags Mon Jan 14 22:24:55 2013 +0000 +++ b/.hgtags Sun Feb 03 18:35:09 2013 +0000 @@ -211,3 +211,4 @@ a3fa5d49d528c32ad5d4b49e7241696a672ffe18 icedtea-2.3.2 acba2d30209d19a87dbc0d2a6e366f09f01a210d icedtea-2.3.3 301e79a966b4627af0113e30f65409baf9ebf1ce icedtea-2.3.4 +8bd8e70d4a032ea3d3642b247dddc0882850ebe0 icedtea-2.3.5 From andrew at icedtea.classpath.org Sun Feb 3 10:36:33 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Sun, 03 Feb 2013 18:36:33 +0000 Subject: /hg/release/icedtea7-forest-2.3/corba: Added tag icedtea-2.3.5 f... Message-ID: changeset 6d7b1e6b004a in /hg/release/icedtea7-forest-2.3/corba details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/corba?cmd=changeset;node=6d7b1e6b004a author: andrew date: Sun Feb 03 18:35:10 2013 +0000 Added tag icedtea-2.3.5 for changeset 5116fe321210 diffstat: .hgtags | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diffs (8 lines): diff -r 5116fe321210 -r 6d7b1e6b004a .hgtags --- a/.hgtags Tue Oct 30 17:06:35 2012 +0000 +++ b/.hgtags Sun Feb 03 18:35:10 2013 +0000 @@ -211,3 +211,4 @@ e9b200124386d2dceba0f2641316e8c6499f9966 icedtea-2.3.2 7fae6a3a68c71b9b13144e92969b8ad625cf9814 icedtea-2.3.3 9a95d714d136b6a22bab1e8365ab3bce7a8b1ddf icedtea-2.3.4 +5116fe321210de8e227d4cde0b5e37673afee385 icedtea-2.3.5 From andrew at icedtea.classpath.org Sun Feb 3 10:36:40 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Sun, 03 Feb 2013 18:36:40 +0000 Subject: /hg/release/icedtea7-forest-2.3/jaxp: Added tag icedtea-2.3.5 fo... Message-ID: changeset dce7523618e4 in /hg/release/icedtea7-forest-2.3/jaxp details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jaxp?cmd=changeset;node=dce7523618e4 author: andrew date: Sun Feb 03 18:35:11 2013 +0000 Added tag icedtea-2.3.5 for changeset 91fcc41a0b4b diffstat: .hgtags | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diffs (8 lines): diff -r 91fcc41a0b4b -r dce7523618e4 .hgtags --- a/.hgtags Mon Oct 29 11:53:57 2012 -0700 +++ b/.hgtags Sun Feb 03 18:35:11 2013 +0000 @@ -211,3 +211,4 @@ 9bd1d8e8b802a8e22637c8a2e0acad9c9cb4a114 icedtea-2.3.2 ee4bd94136ece0fed96b7b8d18f4d99f74fbd326 icedtea-2.3.3 f45296ac69be649f775ac878387e96fd16504b81 icedtea-2.3.4 +91fcc41a0b4b27db954f1bb44b1b6ebe1780b7bb icedtea-2.3.5 From andrew at icedtea.classpath.org Sun Feb 3 10:36:46 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Sun, 03 Feb 2013 18:36:46 +0000 Subject: /hg/release/icedtea7-forest-2.3/jaxws: Added tag icedtea-2.3.5 f... Message-ID: changeset 8064f322e58d in /hg/release/icedtea7-forest-2.3/jaxws details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jaxws?cmd=changeset;node=8064f322e58d author: andrew date: Sun Feb 03 18:35:12 2013 +0000 Added tag icedtea-2.3.5 for changeset 7182233cc27e diffstat: .hgtags | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diffs (8 lines): diff -r 7182233cc27e -r 8064f322e58d .hgtags --- a/.hgtags Mon Jan 14 22:24:58 2013 +0000 +++ b/.hgtags Sun Feb 03 18:35:12 2013 +0000 @@ -211,3 +211,4 @@ 9a744f20cfc52e19f66956e5d406c23910ed4cb4 icedtea-2.3.2 c89c6ac953e7f30780e74b4bc153fee4dd330179 icedtea-2.3.3 03f54ef339144764e218c6548c237e06d54d5ac7 icedtea-2.3.4 +7182233cc27e9f1ee8435dbcf6c3948379ec35b0 icedtea-2.3.5 From andrew at icedtea.classpath.org Sun Feb 3 10:36:52 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Sun, 03 Feb 2013 18:36:52 +0000 Subject: /hg/release/icedtea7-forest-2.3/langtools: Added tag icedtea-2.3... Message-ID: changeset afdfcc0ca555 in /hg/release/icedtea7-forest-2.3/langtools details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/langtools?cmd=changeset;node=afdfcc0ca555 author: andrew date: Sun Feb 03 18:35:13 2013 +0000 Added tag icedtea-2.3.5 for changeset 946195011b30 diffstat: .hgtags | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diffs (8 lines): diff -r 946195011b30 -r afdfcc0ca555 .hgtags --- a/.hgtags Mon Jan 14 22:24:59 2013 +0000 +++ b/.hgtags Sun Feb 03 18:35:13 2013 +0000 @@ -211,3 +211,4 @@ 0cf6181d44db827cb1a341f5936ce43cc489fd08 icedtea-2.3.2 867d5041bee60ea67ee56c5990a82a0215cc4959 icedtea-2.3.3 ec73c6927fb72f1034cde0be9dadb4eaffd6b338 icedtea-2.3.4 +946195011b307a48ad0d9f1aecfb689bba7c5d82 icedtea-2.3.5 From andrew at icedtea.classpath.org Sun Feb 3 10:36:58 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Sun, 03 Feb 2013 18:36:58 +0000 Subject: /hg/release/icedtea7-forest-2.3/hotspot: Added tag icedtea-2.3.5... Message-ID: changeset ad27d7c42279 in /hg/release/icedtea7-forest-2.3/hotspot details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/hotspot?cmd=changeset;node=ad27d7c42279 author: andrew date: Sun Feb 03 18:35:14 2013 +0000 Added tag icedtea-2.3.5 for changeset f2b98ad97b3c diffstat: .hgtags | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diffs (8 lines): diff -r f2b98ad97b3c -r ad27d7c42279 .hgtags --- a/.hgtags Thu Nov 08 17:45:05 2012 -0500 +++ b/.hgtags Sun Feb 03 18:35:14 2013 +0000 @@ -332,3 +332,4 @@ 2a413d946cb1acdcbe1110098f79b7a1f267bf75 icedtea-2.3.2 0885feeea95caa8b92f46234872f0c3839d8850b icedtea-2.3.3 87f0aa7a8f8f0209148ad0746a3486d9cf16ebaa icedtea-2.3.4 +f2b98ad97b3c9d2d9fb98b0dd9b82506a5688e55 icedtea-2.3.5 From andrew at icedtea.classpath.org Sun Feb 3 10:37:06 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Sun, 03 Feb 2013 18:37:06 +0000 Subject: /hg/release/icedtea7-forest-2.3/jdk: Added tag icedtea-2.3.5 for... Message-ID: changeset a16bf9aa6275 in /hg/release/icedtea7-forest-2.3/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/jdk?cmd=changeset;node=a16bf9aa6275 author: andrew date: Sun Feb 03 18:35:18 2013 +0000 Added tag icedtea-2.3.5 for changeset 50e268c1fb1f diffstat: .hgtags | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diffs (8 lines): diff -r 50e268c1fb1f -r a16bf9aa6275 .hgtags --- a/.hgtags Sat Nov 17 18:21:24 2012 +0400 +++ b/.hgtags Sun Feb 03 18:35:18 2013 +0000 @@ -219,3 +219,4 @@ 64ec99488219da2565d3eea0a53ffb4854c87fbe icedtea-2.3.2 6d4f9b2e4a51be218c0d0a1b10cd8469d8ca3cdc icedtea-2.3.3 363064d273675e7ba3417583ee9e4f220bd4e1c9 icedtea-2.3.4 +50e268c1fb1f8a0f0f5b61e70801c58e4b7e547d icedtea-2.3.5 From gitne at excite.co.jp Mon Feb 4 03:25:19 2013 From: gitne at excite.co.jp (=?ISO-2022-JP?B?SmFjb2IgV2lzb3I=?=) Date: Mon, 4 Feb 2013 20:25:19 +0900 Subject: =?ISO-2022-JP?B?UmU6IFJlOiA8aTE4biBkZXY+IE5ld2JpZSBxdWVzdGlvbnM=?= Message-ID: <201302041125.r14BPJgp007123@mail-web03.excite.co.jp> "skolnag at gmail.com" wrote: > > > > --- Regarding the translation; Did you follow any policy or guide while > > translating to cz? I was not sure how close to stay to the en original. I > > tried to stay as close as possible rather then doing a more semanticly > > oriented translation. What is the preferred policy on that? > > > > This is answer from Alexandr (CCed) who created cz transaltion: > > > > " Hello, as far as I know there is no style guide or policy. I tried to > > stay as close to the source > > text as possible. But of course I adapted the sentence structure etc., so > > that it reads naturally in > > Czech and according to context (instruction for users x description of a > > feature, etc.). In some > > cases the meaning wasn't very clear. Then I contacted the software > > developers for clarifying. In > > some cases the meaning turned out to be quite different from the original > > source text, so I > > recommend to ask whenever you are not sure about anything."--- > > > > Hello, > > May be a few more comments, that might be helpful. Generally, if no > specific style guide si provided, it is mostly good to follow Microsoft > style guide, which is de facto standard for IT translations, is very useful > and is mostly used in professional IT translations. The MS style guides can > be downloaded here: > > http://www.microsoft.com/Language/en-US/StyleGuides.aspx I have read those documents on de and pl. They are quite okay, but they are soked, in some cases, with Microsoft's sales policy all too much. I'd say, I agree up to about 90% with the pl document and only 50% with the de document. The main problem with the de document is that though it is trying to improve on the previous German style it fails to do so in a stringent and reasonable way, partly probably because no German-speaking country has an official institution or agency to conserve and/or develop the German language. It touches many legitimate areas of concern, but it also contradicts them with their answers. For example, while the document states that during the last few years even more anglicisms (among them some really bad) have found their way into the language, the authors forgot that it was actually them who had strongly contributed to that trend. The reason for this is that Microsoft's German localizers either have been lazy or had no time to come up with good tra! nslations. Well, probably the later was the case. So, instead of revising the old style they were just trying to apply some minor fixes in some areas and thus made an ever greater mess. They have probably spoken to the wrong people or have been advised by the wrong people, or they just did not want to introduce major changes in their product language because the customers got used to mediocre quality terms and translations. I do not know if they did or did not, but they should have spoken to Bastian Sick or read his books "Der Dativ ist dem Genitiv sein Tod" (loosely translated "The Dative Makes The Genitive Die"). Many German-speakers who care about the language probably know what I am talking about. So after all, the de document is not that much of a help. > With regard to terminology, I mostly followed suggestions from Open-Tran.eu > (http://open-tran.eu/ ; terminology as used in several important open > source projects) and/or Microsoft glossaries ( > http://www.microsoft.com/Language/en-US/Default.aspx) Thank you for these links, they indeed come in handy. Regards, Jacob From adomurad at redhat.com Mon Feb 4 06:40:40 2013 From: adomurad at redhat.com (Adam Domurad) Date: Mon, 04 Feb 2013 09:40:40 -0500 Subject: [rfc][icedtea-web] Renaming of conflict names for case insensitive systems In-Reply-To: <510E5E19.2060308@redhat.com> References: <510A3F0D.10906@redhat.com> <510A82CB.3020608@redhat.com> <510E5E19.2060308@redhat.com> Message-ID: <510FC868.4060701@redhat.com> On 02/03/2013 07:54 AM, Jiri Vanek wrote: > On 01/31/2013 03:42 PM, Adam Domurad wrote: >> On 01/31/2013 04:53 AM, Jiri Vanek wrote: >>> 2013-01-31 Jiri Vanek >>> >>> Renamed conflict file for case insensitive systems >>> * >>> tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2E.html: >>> Renamed to ParallelAppletsTest_1_x_2EE.html >>> * >>> tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2EE.html: >>> new file. >>> * >>> tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java: >>> (testParallelAppletsTest1x2E) adapted to renaming >> >> Looks good. Approved. >> -Adam > > > Argh, one more file name escaped.So renaming now > > Checked by find . | grep -v \.hg | sort | uniq -di > so nothing more should remains > > 2013-02-03 Jiri Vanek > > Another renamed conflict file for case insensitive systems > * > tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1E_x_2s.html > Renamed to ParallelAppletsTest_1_x_2EE.html > * > tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1EE_x_2s.html > new file. > * > tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java: > (testParallelAppletsTest1Ex2s) adapted to renamin Sure, go ahead and push. -Adam From ptisnovs at icedtea.classpath.org Mon Feb 4 08:24:10 2013 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Mon, 04 Feb 2013 16:24:10 +0000 Subject: /hg/gfx-test: Added two new helper methods into ImageFactory class. Message-ID: changeset 6388bd700344 in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=6388bd700344 author: Pavel Tisnovsky date: Mon Feb 04 17:27:13 2013 +0100 Added two new helper methods into ImageFactory class. diffstat: ChangeLog | 5 + src/org/gfxtest/framework/ImageFactory.java | 83 +++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 0 deletions(-) diffs (105 lines): diff -r 9c7ac29d5ebe -r 6388bd700344 ChangeLog --- a/ChangeLog Thu Jan 31 09:56:58 2013 +0100 +++ b/ChangeLog Mon Feb 04 17:27:13 2013 +0100 @@ -1,3 +1,8 @@ +2013-02-04 Pavel Tisnovsky + + * src/org/gfxtest/framework/ImageFactory.java: + Added two new helper methods into ImageFactory class. + 2013-01-31 Pavel Tisnovsky * src/org/gfxtest/testsuites/Paths.java: diff -r 9c7ac29d5ebe -r 6388bd700344 src/org/gfxtest/framework/ImageFactory.java --- a/src/org/gfxtest/framework/ImageFactory.java Thu Jan 31 09:56:58 2013 +0100 +++ b/src/org/gfxtest/framework/ImageFactory.java Mon Feb 04 17:27:13 2013 +0100 @@ -1143,6 +1143,89 @@ // return buffered image containing computed color pattern return image; } + + /** + * Create image containing yellow gradient. + * + * @param width + * width of a buffered image + * @param height + * height of a buffered image + * @param imageType + * buffered image type + * @return buffered image containing checker pattern + */ + public static BufferedImage createHorizontalYellowGradientImage(int width, int height, int imageType) + { + // check for proper image dimensions + if (width <= 0 || height <= 0) + { + return null; + } + + // create new image + BufferedImage image = new BufferedImage(width, height, imageType); + + // for all lines in a raster image + for (int y = 0; y < height; y++) + { + // compute color for each pixel + int rgb = (int) Math.round(y * 256.0 / height); + if (rgb < 0) rgb = 0; + if (rgb > 255) rgb = 255; + int color = (0xff << 24) | (rgb << 16) | (rgb << 8); + // for all columns on a line + for (int x = 0; x < width; x++) + { + image.setRGB(x, y, color); + } + } + + // return buffered image containing computed color pattern + return image; + } + + /** + * Create image containing yellow gradient. + * + * @param width + * width of a buffered image + * @param height + * height of a buffered image + * @param imageType + * buffered image type + * @return buffered image containing checker pattern + */ + public static BufferedImage createVerticalYellowGradientImage(int width, int height, int imageType) + { + // check for proper image dimensions + if (width <= 0 || height <= 0) + { + return null; + } + + // create new image + BufferedImage image = new BufferedImage(width, height, imageType); + + // for all lines in a raster image + for (int y = 0; y < height; y++) + { + // for all columns on a line + for (int x = 0; x < width; x++) + { + // compute color for each pixel + int rgb = (int) Math.round(x * 256.0 / width); + if (rgb < 0) rgb = 0; + if (rgb > 255) rgb = 255; + int color = (0xff << 24) | (rgb << 16) | (rgb << 8); + image.setRGB(x, y, color); + } + } + + // return buffered image containing computed color pattern + return image; + } + /** * Create image containing red to blue gradient. * From ptisnovs at icedtea.classpath.org Mon Feb 4 08:27:28 2013 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Mon, 04 Feb 2013 16:27:28 +0000 Subject: /hg/rhino-tests: Four new tests added into the test suite Compil... Message-ID: changeset 95723cffb439 in /hg/rhino-tests details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=95723cffb439 author: Pavel Tisnovsky date: Mon Feb 04 17:30:29 2013 +0100 Four new tests added into the test suite CompilableClassTest. diffstat: ChangeLog | 5 ++ src/org/RhinoTests/CompilableClassTest.java | 50 +++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 0 deletions(-) diffs (72 lines): diff -r 358cb09b56b9 -r 95723cffb439 ChangeLog --- a/ChangeLog Thu Jan 31 09:52:04 2013 +0100 +++ b/ChangeLog Mon Feb 04 17:30:29 2013 +0100 @@ -1,3 +1,8 @@ +2013-02-04 Pavel Tisnovsky + + * src/org/RhinoTests/CompilableClassTest.java: + Four new tests added into the test suite CompilableClassTest. + 2013-01-31 Pavel Tisnovsky * src/org/RhinoTests/BindingsClassTest.java: diff -r 358cb09b56b9 -r 95723cffb439 src/org/RhinoTests/CompilableClassTest.java --- a/src/org/RhinoTests/CompilableClassTest.java Thu Jan 31 09:52:04 2013 +0100 +++ b/src/org/RhinoTests/CompilableClassTest.java Mon Feb 04 17:30:29 2013 +0100 @@ -560,6 +560,56 @@ } /** + * Test for method javax.script.Compilable.getClass().getClasses() + */ + protected void testGetClasses() { + Class[] cls = this.compilableClass.getClasses(); + assertNotNull(cls, "getClasses() returns null"); + assertEquals(cls.length, 0, "getClasses() returns wrong value!"); + } + + /** + * Test for method javax.script.Compilable.getClass().getDeclaredClasses() + */ + protected void testGetDeclaredClasses() { + Class[] cls = this.compilableClass.getDeclaredClasses(); + assertNotNull(cls, "getDeclaredClasses() returns null"); + assertEquals(cls.length, 0, "getDeclaredClasses() returns wrong value!"); + } + + /** + * Test for method javax.script.Compilable.getClass().getDeclaringClass() + */ + protected void testGetDeclaringClass() { + Class cls = this.compilableClass.getDeclaringClass(); + assertNull(cls, "getDeclaringClass() does not return null"); + } + + /** + * Test for method javax.script.Compilable.getClass().getEnclosingClass() + */ + protected void testGetEnclosingClass() { + Class cls = this.compilableClass.getEnclosingClass(); + assertNull(cls, "getEnclosingClass() does not return null"); + } + + /** + * Test for method javax.script.Compilable.getClass().getEnclosingConstructor() + */ + protected void testGetEnclosingConstructor() { + Constructor cons = this.compilableClass.getEnclosingConstructor(); + assertNull(cons, "getEnclosingConstructor() does not return null"); + } + + /** + * Test for method javax.script.Compilable.getClass().getEnclosingMethod() + */ + protected void testGetEnclosingMethod() { + Method m = this.compilableClass.getEnclosingMethod(); + assertNull(m, "getEnclosingMethod() does not return null"); + } + + /** * Test for instanceof operator applied to a class javax.script.Compilable */ @SuppressWarnings("cast") From andrew at icedtea.classpath.org Mon Feb 4 08:35:23 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Mon, 04 Feb 2013 16:35:23 +0000 Subject: /hg/release/icedtea7-2.3: Bring in the latest security fixes. Message-ID: changeset 04e3b3ccc887 in /hg/release/icedtea7-2.3 details: http://icedtea.classpath.org/hg/release/icedtea7-2.3?cmd=changeset;node=04e3b3ccc887 author: Andrew John Hughes date: Mon Feb 04 16:34:28 2013 +0000 Bring in the latest security fixes. 2013-02-04 Andrew John Hughes * Makefile.am, (CORBA_CHANGESET): Update to IcedTea7 2.3 forest head, bringing in the security fixes. (JAXP_CHANGESET): Likewise. (JAXWS_CHANGESET): Likewise. (JDK_CHANGESET): Likewise. (LANGTOOLS_CHANGESET): Likewise. (OPENJDK_CHANGESET): Likewise. (CORBA_SHA256SUM): Likewise. (JAXP_SHA256SUM): Likewise. (JAXWS_SHA256SUM): Likewise. (JDK_SHA256SUM): Likewise. (LANGTOOLS_SHA256SUM): Likewise. (OPENJDK_SHA256SUM): Likewise. (ICEDTEA_BOOTSTRAP_CLASSES): Depend on java.lang.ClassValue. * hotspot.map: Update HotSpot default to 2.3 forest head. * patches/boot/ecj-diamond.patch, * patches/boot/ecj-multicatch.patch, * patches/boot/ecj-trywithresources.patch: Extend to work against the updated tree. diffstat: ChangeLog | 24 + Makefile.am | 26 +- hotspot.map | 2 +- patches/boot/ecj-diamond.patch | 1062 ++++++++++++++++-------------- patches/boot/ecj-multicatch.patch | 30 + patches/boot/ecj-trywithresources.patch | 197 ++--- 6 files changed, 706 insertions(+), 635 deletions(-) diffs (truncated from 3313 to 500 lines): diff -r e5dd5d152b68 -r 04e3b3ccc887 ChangeLog --- a/ChangeLog Wed Jan 16 01:40:59 2013 +0000 +++ b/ChangeLog Mon Feb 04 16:34:28 2013 +0000 @@ -1,3 +1,27 @@ +2013-02-04 Andrew John Hughes + + * Makefile.am, + (CORBA_CHANGESET): Update to IcedTea7 2.3 forest head, + bringing in the security fixes. + (JAXP_CHANGESET): Likewise. + (JAXWS_CHANGESET): Likewise. + (JDK_CHANGESET): Likewise. + (LANGTOOLS_CHANGESET): Likewise. + (OPENJDK_CHANGESET): Likewise. + (CORBA_SHA256SUM): Likewise. + (JAXP_SHA256SUM): Likewise. + (JAXWS_SHA256SUM): Likewise. + (JDK_SHA256SUM): Likewise. + (LANGTOOLS_SHA256SUM): Likewise. + (OPENJDK_SHA256SUM): Likewise. + (ICEDTEA_BOOTSTRAP_CLASSES): Depend on java.lang.ClassValue. + * hotspot.map: Update HotSpot default to 2.3 forest + head. + * patches/boot/ecj-diamond.patch, + * patches/boot/ecj-multicatch.patch, + * patches/boot/ecj-trywithresources.patch: + Extend to work against the updated tree. + 2013-01-16 Andrew John Hughes * NEWS: Recategorise 7197906 as a backport. diff -r e5dd5d152b68 -r 04e3b3ccc887 Makefile.am --- a/Makefile.am Wed Jan 16 01:40:59 2013 +0000 +++ b/Makefile.am Mon Feb 04 16:34:28 2013 +0000 @@ -4,19 +4,19 @@ JDK_UPDATE_VERSION = 09 COMBINED_VERSION = $(JDK_UPDATE_VERSION)-$(OPENJDK_VERSION) -CORBA_CHANGESET = dc9234e25ab0 -JAXP_CHANGESET = aa3654afea12 -JAXWS_CHANGESET = 7182233cc27e -JDK_CHANGESET = 96d4f04f2b7c -LANGTOOLS_CHANGESET = 946195011b30 -OPENJDK_CHANGESET = 8bd8e70d4a03 +CORBA_CHANGESET = 5116fe321210 +JAXP_CHANGESET = 91fcc41a0b4b +JAXWS_CHANGESET = 8064f322e58d +JDK_CHANGESET = a16bf9aa6275 +LANGTOOLS_CHANGESET = afdfcc0ca555 +OPENJDK_CHANGESET = 02128561d696 -CORBA_SHA256SUM = 911a049e735c1ab0dfa65426ada7a11494d51fec88126d34588b23f06ef7acf8 -JAXP_SHA256SUM = cc9a95c09be36753f9dd5aacd961400deddbdb757f8ea547cd7073f7ab7b87b7 -JAXWS_SHA256SUM = 7e694d90969413972a51ad1202f3c042b1eca92591e43f1f94f4421a6be5c590 -JDK_SHA256SUM = afba9798a4f2407bdf2cd58d0a99d94bb76ae15aec6ad9cfa0375fb255b0032b -LANGTOOLS_SHA256SUM = a9f56fbd58047adc9296800cd9c534375ef052074cd40ebc0da1f7db6ce09144 -OPENJDK_SHA256SUM = 3ea7c4acd4c2f7b91588231427a8685010f8ce7eb0b9610457d6a35bf2afd6bd +CORBA_SHA256SUM = 7ea949e32cff3b901aafb69939731469c88ded2036c7a2ae72b757f3f9517435 +JAXP_SHA256SUM = c92299f6f9b812f2b57f78c699a04f297bc261f51a76b8ff694dea168504805c +JAXWS_SHA256SUM = aed5c1ae9f80d4af02d183c71d46f223e05420f15cd379a98d413e09ad679bd1 +JDK_SHA256SUM = 87531928e9f4bc3c413df1bd09ff990d23ec03872e8df8aa4248389369b540f4 +LANGTOOLS_SHA256SUM = 30473c84f50ffb9db23887d0231fea6c81384d567506a37e392692eafa479c88 +OPENJDK_SHA256SUM = 2da96c984e35a13d64c92ad6670244d506b113a67289adeeaee77b43edb5f267 CACAO_VERSION = a567bcb7f589 CACAO_SHA256SUM = d49f79debc131a5694cae6ab3ba2864e7f3249ee8d9dc09aae8afdd4dc6b09f9 @@ -99,7 +99,7 @@ SOURCEPATH_DIRS = $(abs_top_srcdir)/generated:$(OPENJDK_SOURCEPATH_DIRS) # Sources used from OpenJDK. -ICEDTEA_BOOTSTRAP_CLASSES = +ICEDTEA_BOOTSTRAP_CLASSES = $(SHARE)/java/lang/ClassValue.java #PR43148 - javac fails due to missing java.util.regex.Matcher.quoteReplacement if LACKS_JAVA_UTIL_REGEX_MATCHER_QUOTEREPLACEMENT diff -r e5dd5d152b68 -r 04e3b3ccc887 hotspot.map --- a/hotspot.map Wed Jan 16 01:40:59 2013 +0000 +++ b/hotspot.map Mon Feb 04 16:34:28 2013 +0000 @@ -1,3 +1,3 @@ # version url changeset sha256sum -default http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/hotspot beecf0b9e760 de7a5397a83bb7c7be2458809b576133e8a3b75dc62d62d2f2983b97c220dc4f +default http://icedtea.classpath.org/hg/release/icedtea7-forest-2.3/hotspot ad27d7c42279 cc6c3e631f7b745f7a4bd8ff0a6fd75ccde06e7aa58e0d20d2254a1c98937538 zero http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/hotspot a456d0771ba0 09a64fca0beff0759ef1b461d63ed6a00e43032972781bb3a55e49d8b93f67d0 diff -r e5dd5d152b68 -r 04e3b3ccc887 patches/boot/ecj-diamond.patch --- a/patches/boot/ecj-diamond.patch Wed Jan 16 01:40:59 2013 +0000 +++ b/patches/boot/ecj-diamond.patch Mon Feb 04 16:34:28 2013 +0000 @@ -1,6 +1,6 @@ diff -Nru openjdk-boot.orig/corba/src/share/classes/com/sun/corba/se/impl/encoding/CachedCodeBase.java openjdk-boot/corba/src/share/classes/com/sun/corba/se/impl/encoding/CachedCodeBase.java ---- openjdk-boot.orig/corba/src/share/classes/com/sun/corba/se/impl/encoding/CachedCodeBase.java 2012-07-26 10:38:37.590704662 +0100 -+++ openjdk-boot/corba/src/share/classes/com/sun/corba/se/impl/encoding/CachedCodeBase.java 2012-07-26 10:38:52.562995294 +0100 +--- openjdk-boot.orig/corba/src/share/classes/com/sun/corba/se/impl/encoding/CachedCodeBase.java 2012-07-20 19:13:29.537633988 +0100 ++++ openjdk-boot/corba/src/share/classes/com/sun/corba/se/impl/encoding/CachedCodeBase.java 2013-02-02 15:57:52.018737343 +0000 @@ -58,7 +58,7 @@ private CorbaConnection conn; @@ -11,8 +11,8 @@ public static synchronized void cleanCache( ORB orb ) { synchronized (iorMapLock) { diff -Nru openjdk-boot.orig/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java openjdk-boot/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java ---- openjdk-boot.orig/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java 2012-07-26 10:42:49.783575656 +0100 -+++ openjdk-boot/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java 2012-07-26 10:43:32.556396764 +0100 +--- openjdk-boot.orig/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java 2013-02-02 13:42:15.037347115 +0000 ++++ openjdk-boot/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java 2013-02-02 15:57:52.082738368 +0000 @@ -1316,7 +1316,7 @@ protected void shutdownServants(boolean wait_for_completion) { Set oaset; @@ -23,8 +23,8 @@ for (ObjectAdapterFactory oaf : oaset) diff -Nru openjdk-boot.orig/corba/src/share/classes/com/sun/corba/se/impl/orbutil/threadpool/ThreadPoolImpl.java openjdk-boot/corba/src/share/classes/com/sun/corba/se/impl/orbutil/threadpool/ThreadPoolImpl.java ---- openjdk-boot.orig/corba/src/share/classes/com/sun/corba/se/impl/orbutil/threadpool/ThreadPoolImpl.java 2012-07-26 10:42:30.031195989 +0100 -+++ openjdk-boot/corba/src/share/classes/com/sun/corba/se/impl/orbutil/threadpool/ThreadPoolImpl.java 2012-07-26 10:43:50.748745570 +0100 +--- openjdk-boot.orig/corba/src/share/classes/com/sun/corba/se/impl/orbutil/threadpool/ThreadPoolImpl.java 2012-07-20 19:13:29.621635717 +0100 ++++ openjdk-boot/corba/src/share/classes/com/sun/corba/se/impl/orbutil/threadpool/ThreadPoolImpl.java 2013-02-02 15:57:52.082738368 +0000 @@ -108,7 +108,7 @@ private ThreadGroup threadGroup; @@ -43,9 +43,26 @@ } for (WorkerThread wt : copy) { +diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/beans/decoder/DocumentHandler.java openjdk-boot/jdk/src/share/classes/com/sun/beans/decoder/DocumentHandler.java +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/beans/decoder/DocumentHandler.java 2012-10-11 14:16:40.677525442 +0100 ++++ openjdk-boot/jdk/src/share/classes/com/sun/beans/decoder/DocumentHandler.java 2013-02-02 15:57:52.174739840 +0000 +@@ -62,9 +62,10 @@ + */ + public final class DocumentHandler extends DefaultHandler { + private final AccessControlContext acc = AccessController.getContext(); +- private final Map> handlers = new HashMap<>(); +- private final Map environment = new HashMap<>(); +- private final List objects = new ArrayList<>(); ++ private final Map> handlers = ++ new HashMap>(); ++ private final Map environment = new HashMap(); ++ private final List objects = new ArrayList(); + + private Reference loader; + private ExceptionListener listener; diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/beans/TypeResolver.java openjdk-boot/jdk/src/share/classes/com/sun/beans/TypeResolver.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/beans/TypeResolver.java 2012-07-26 10:32:17.027354391 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/beans/TypeResolver.java 2012-07-26 10:31:04.514176534 +0100 +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/beans/TypeResolver.java 2012-07-20 19:23:35.521421032 +0100 ++++ openjdk-boot/jdk/src/share/classes/com/sun/beans/TypeResolver.java 2013-02-02 15:57:52.082738368 +0000 @@ -239,9 +239,9 @@ } } @@ -59,8 +76,8 @@ /** * Constructs the type resolver for the given actual type. diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/Attribute.java openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Attribute.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/Attribute.java 2012-07-25 18:24:09.000000000 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Attribute.java 2012-07-26 10:21:48.605049307 +0100 +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/Attribute.java 2012-07-20 19:23:35.685424083 +0100 ++++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Attribute.java 2013-02-02 15:57:52.082738368 +0000 @@ -103,9 +103,9 @@ return this.def.compareTo(that.def); } @@ -132,8 +149,8 @@ for (int i = 0; i < layout.length(); i++) { if (layout.charAt(i++) != '[') diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java 2012-07-26 10:21:09.192395302 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java 2012-07-26 10:21:48.625049638 +0100 +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java 2013-02-02 15:37:06.051471139 +0000 ++++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java 2013-02-02 15:57:52.082738368 +0000 @@ -257,7 +257,7 @@ assert(basicCodings[_meta_default] == null); assert(basicCodings[_meta_canon_min] != null); @@ -143,7 +160,7 @@ for (int i = 0; i < basicCodings.length; i++) { Coding c = basicCodings[i]; if (c == null) continue; -@@ -1068,8 +1068,8 @@ +@@ -1067,8 +1067,8 @@ // Bootstrap support for CPRefBands. These are needed to record // intended CP indexes, before the CP has been created. @@ -154,7 +171,7 @@ int encodeRef(Entry e, Index ix) { -@@ -1704,7 +1704,7 @@ +@@ -1705,7 +1705,7 @@ protected int attrClassFileVersionMask; // Mapping from Attribute.Layout to Band[] (layout element bands). @@ -163,7 +180,7 @@ // Well-known attributes: protected final Attribute.Layout attrCodeEmpty; -@@ -1713,16 +1713,16 @@ +@@ -1714,16 +1714,16 @@ protected final Attribute.Layout attrConstantValue; // Mapping from Attribute.Layout to Integer (inverse of attrDefs) @@ -183,7 +200,7 @@ attrIndexLimit[i], (Attribute.Layout)null))); } -@@ -1912,7 +1912,7 @@ +@@ -1913,7 +1913,7 @@ protected List getPredefinedAttrs(int ctype) { assert(attrIndexLimit[ctype] != 0); @@ -192,7 +209,7 @@ // Remove nulls and non-predefs. for (int ai = 0; ai < attrIndexLimit[ctype]; ai++) { if (testBit(attrDefSeen[ctype], 1L< codeMap; @@ -264,8 +281,8 @@ Coding x1 = codeMap.get(x0); if (x1 == null) codeMap.put(x0, x1 = x0); diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java 2012-07-25 18:24:09.000000000 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java 2012-07-26 10:21:48.625049638 +0100 +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java 2013-02-02 13:23:34.763400328 +0000 ++++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java 2013-02-02 15:57:52.082738368 +0000 @@ -915,7 +915,7 @@ public static Index[] partition(Index ix, int[] keys) { @@ -284,7 +301,7 @@ } part.add(cpMap[i]); } -@@ -1133,7 +1133,7 @@ +@@ -1135,7 +1135,7 @@ void completeReferencesIn(Set cpRefs, boolean flattenSigs) { cpRefs.remove(null); for (ListIterator work = @@ -294,9 +311,9 @@ Entry e = work.previous(); work.remove(); // pop stack diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/Driver.java openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Driver.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/Driver.java 2012-07-26 10:21:09.192395302 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Driver.java 2012-07-26 10:21:48.629049705 +0100 -@@ -60,7 +60,7 @@ +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/Driver.java 2013-02-02 15:37:06.051471139 +0000 ++++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Driver.java 2013-02-02 15:57:52.086738431 +0000 +@@ -61,7 +61,7 @@ ResourceBundle.getBundle("com.sun.java.util.jar.pack.DriverResource"); public static void main(String[] ava) throws IOException { @@ -305,7 +322,7 @@ boolean doPack = true; boolean doUnpack = false; -@@ -83,7 +83,7 @@ +@@ -84,7 +84,7 @@ } // Collect engine properties here: @@ -314,7 +331,7 @@ engProps.put(verboseProp, System.getProperty(verboseProp)); String optionMap; -@@ -97,7 +97,7 @@ +@@ -98,7 +98,7 @@ } // Collect argument properties here: @@ -323,7 +340,7 @@ try { for (;;) { String state = parseCommandOptions(av, optionMap, avProps); -@@ -529,7 +529,7 @@ +@@ -533,7 +533,7 @@ String resultString = null; // Convert options string into optLines dictionary. @@ -333,8 +350,8 @@ for (String optline : options.split("\n")) { String[] words = optline.split("\\p{Space}+"); diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/FixedList.java openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/FixedList.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/FixedList.java 2012-07-25 18:24:09.000000000 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/FixedList.java 2012-07-26 10:21:48.629049705 +0100 +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/FixedList.java 2012-07-20 19:23:35.693424229 +0100 ++++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/FixedList.java 2013-02-02 15:57:52.086738431 +0000 @@ -45,7 +45,7 @@ private final ArrayList flist; @@ -345,8 +362,8 @@ for (int i = 0 ; i < capacity ; i++) { flist.add(null); diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/Fixups.java openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Fixups.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/Fixups.java 2012-07-25 18:24:09.000000000 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Fixups.java 2012-07-26 10:21:48.629049705 +0100 +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/Fixups.java 2012-07-20 19:23:35.693424229 +0100 ++++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Fixups.java 2013-02-02 15:57:52.086738431 +0000 @@ -126,11 +126,11 @@ public void setBytes(byte[] newBytes) { if (bytes == newBytes) return; @@ -371,8 +388,8 @@ static final int LOC_SHIFT = 1; diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/Package.java openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Package.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/Package.java 2012-07-26 10:21:09.024392512 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Package.java 2012-07-26 10:21:48.629049705 +0100 +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/Package.java 2013-02-02 15:37:05.975469923 +0000 ++++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Package.java 2013-02-02 15:57:52.086738431 +0000 @@ -112,7 +112,7 @@ public static final Attribute.Layout attrSourceFileSpecial; public static final Map attrDefs; @@ -537,8 +554,8 @@ // Add to the end of ths list: if (!fileSet.contains(cls.file)) diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java 2012-07-26 10:21:09.192395302 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java 2012-07-26 10:21:48.629049705 +0100 +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java 2013-02-02 15:37:06.051471139 +0000 ++++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java 2013-02-02 15:57:52.086738431 +0000 @@ -686,7 +686,7 @@ cp_Signature_classes.expectLength(getIntTotal(numSigClasses)); cp_Signature_classes.readFrom(in); @@ -652,8 +669,8 @@ ClassEntry thisClass = curClass.thisClass; ClassEntry superClass = curClass.superClass; diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java 2012-07-26 10:21:09.196395369 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java 2012-07-26 10:21:48.629049705 +0100 +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java 2013-02-02 15:37:06.051471139 +0000 ++++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java 2013-02-02 15:57:52.086738431 +0000 @@ -116,7 +116,7 @@ int[][] attrCounts; // count attr. occurences @@ -709,8 +726,8 @@ for (Class cls : pkg.classes) { if (!cls.hasInnerClasses()) continue; diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java 2012-07-25 18:24:09.000000000 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java 2012-07-26 10:21:48.629049705 +0100 +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java 2013-02-02 13:14:33.330732979 +0000 ++++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java 2013-02-02 15:57:52.086738431 +0000 @@ -181,8 +181,8 @@ final Map attrDefs; final Map attrCommands; @@ -741,8 +758,8 @@ for (JarEntry je : Collections.list(jf.entries())) { InFile inFile = new InFile(jf, je); diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/PopulationCoding.java openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/PopulationCoding.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/PopulationCoding.java 2012-07-25 18:24:09.000000000 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/PopulationCoding.java 2012-07-26 10:21:48.629049705 +0100 +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/PopulationCoding.java 2012-07-20 19:23:35.697424304 +0100 ++++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/PopulationCoding.java 2013-02-02 15:57:52.086738431 +0000 @@ -309,7 +309,7 @@ // As each new value is added, we assert that the value // was not already in the set. @@ -753,8 +770,8 @@ maxForDebug += fillp; int min = Integer.MIN_VALUE; // farthest from the center diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/PropMap.java openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/PropMap.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/PropMap.java 2012-07-26 10:21:09.196395369 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/PropMap.java 2012-07-26 10:21:48.629049705 +0100 +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/PropMap.java 2013-02-02 15:37:06.055471202 +0000 ++++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/PropMap.java 2013-02-02 15:57:52.086738431 +0000 @@ -47,8 +47,8 @@ */ @@ -776,8 +793,8 @@ while (res.remove(null)); return res; diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/TLGlobals.java openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/TLGlobals.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/TLGlobals.java 2012-07-25 18:24:09.000000000 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/TLGlobals.java 2012-07-26 10:21:48.629049705 +0100 +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/TLGlobals.java 2012-07-20 19:23:35.697424304 +0100 ++++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/TLGlobals.java 2013-02-02 15:57:52.086738431 +0000 @@ -58,12 +58,12 @@ private final Map memberEntries; @@ -798,8 +815,8 @@ } diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java 2012-07-26 10:21:09.196395369 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java 2012-07-26 10:21:48.629049705 +0100 +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java 2013-02-02 15:37:06.055471202 +0000 ++++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java 2013-02-02 15:57:52.086738431 +0000 @@ -232,7 +232,7 @@ props.setProperty(java.util.jar.Pack200.Unpacker.PROGRESS,"50"); pkg.ensureAllClassFiles(); @@ -810,8 +827,8 @@ String name = file.nameString; JarEntry je = new JarEntry(Utils.getJarEntryName(name)); diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/Utils.java openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Utils.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/Utils.java 2012-07-26 10:21:09.196395369 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Utils.java 2012-07-26 10:21:48.629049705 +0100 +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/java/util/jar/pack/Utils.java 2013-02-02 15:37:06.055471202 +0000 ++++ openjdk-boot/jdk/src/share/classes/com/sun/java/util/jar/pack/Utils.java 2013-02-02 15:57:52.086738431 +0000 @@ -132,7 +132,7 @@ // Keep a TLS point to the global data and environment. // This makes it simpler to supply environmental options @@ -822,8 +839,8 @@ // convenience methods to access the TL globals static TLGlobals getTLGlobals() { diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java openjdk-boot/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java 2012-07-25 18:24:09.000000000 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java 2012-07-26 10:21:48.633049772 +0100 +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java 2012-07-20 19:23:36.029430487 +0100 ++++ openjdk-boot/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java 2013-02-02 15:57:52.090738496 +0000 @@ -1284,7 +1284,7 @@ */ public Collection toCollection() throws SQLException { @@ -843,8 +860,8 @@ // create a copy CachedRowSetImpl crsTemp; diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/rowset/JoinRowSetImpl.java openjdk-boot/jdk/src/share/classes/com/sun/rowset/JoinRowSetImpl.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/rowset/JoinRowSetImpl.java 2012-07-25 18:24:09.000000000 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/rowset/JoinRowSetImpl.java 2012-07-26 10:21:48.633049772 +0100 +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/rowset/JoinRowSetImpl.java 2012-07-20 19:23:36.037430638 +0100 ++++ openjdk-boot/jdk/src/share/classes/com/sun/rowset/JoinRowSetImpl.java 2013-02-02 15:57:52.094738561 +0000 @@ -222,7 +222,7 @@ // either of the setter methods have been set. if(boolColId){ @@ -855,8 +872,8 @@ if( (strMatchKey = (cRowset.getMatchColumnNames())[i]) != null) { iMatchKey = cRowset.findColumn(strMatchKey); diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java openjdk-boot/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java 2012-07-25 18:24:09.000000000 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java 2012-07-26 10:21:48.645049971 +0100 +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java 2012-07-20 19:23:36.061431081 +0100 ++++ openjdk-boot/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java 2013-02-02 15:57:52.094738561 +0000 @@ -99,10 +99,10 @@ throws UnsupportedCallbackException { @@ -871,8 +888,8 @@ ConfirmationInfo confirmation = new ConfirmationInfo(); diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java openjdk-boot/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java 2012-07-25 18:24:09.000000000 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java 2012-07-26 10:21:48.645049971 +0100 +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java 2012-07-20 19:23:36.061431081 +0100 ++++ openjdk-boot/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java 2013-02-02 15:57:52.094738561 +0000 @@ -152,7 +152,7 @@ // new configuration @@ -901,8 +918,8 @@ String value; while (peek(";") == false) { diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/security/auth/module/JndiLoginModule.java openjdk-boot/jdk/src/share/classes/com/sun/security/auth/module/JndiLoginModule.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/security/auth/module/JndiLoginModule.java 2012-07-25 18:24:09.000000000 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/security/auth/module/JndiLoginModule.java 2012-07-26 10:21:48.645049971 +0100 +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/security/auth/module/JndiLoginModule.java 2012-07-20 19:23:36.061431081 +0100 ++++ openjdk-boot/jdk/src/share/classes/com/sun/security/auth/module/JndiLoginModule.java 2013-02-02 15:57:52.094738561 +0000 @@ -184,7 +184,7 @@ private UnixNumericUserPrincipal UIDPrincipal; private UnixNumericGroupPrincipal GIDPrincipal; @@ -913,8 +930,8 @@ // initial state private Subject subject; diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java openjdk-boot/jdk/src/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java 2012-07-25 18:24:09.000000000 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java 2012-07-26 10:21:48.645049971 +0100 +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java 2012-07-20 19:23:36.061431081 +0100 ++++ openjdk-boot/jdk/src/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java 2013-02-02 15:57:52.094738561 +0000 @@ -658,7 +658,7 @@ throw new FailedLoginException( "Unable to find X.509 certificate chain in keystore"); @@ -925,8 +942,8 @@ certList.add(fromKeyStore[i]); } diff -Nru openjdk-boot.orig/jdk/src/share/classes/com/sun/security/auth/module/SolarisLoginModule.java openjdk-boot/jdk/src/share/classes/com/sun/security/auth/module/SolarisLoginModule.java ---- openjdk-boot.orig/jdk/src/share/classes/com/sun/security/auth/module/SolarisLoginModule.java 2012-07-25 18:24:09.000000000 +0100 -+++ openjdk-boot/jdk/src/share/classes/com/sun/security/auth/module/SolarisLoginModule.java 2012-07-26 10:21:48.645049971 +0100 +--- openjdk-boot.orig/jdk/src/share/classes/com/sun/security/auth/module/SolarisLoginModule.java 2012-07-20 19:23:36.065431155 +0100 From adomurad at redhat.com Mon Feb 4 10:02:50 2013 From: adomurad at redhat.com (Adam Domurad) Date: Mon, 04 Feb 2013 13:02:50 -0500 Subject: [fyi][icedtea-web] backend and itw-settings for extended applets security In-Reply-To: <510E532C.8040401@redhat.com> References: <510E532C.8040401@redhat.com> Message-ID: <510FF7CA.5030001@redhat.com> On 02/03/2013 07:08 AM, Jiri Vanek wrote: > Whole troubles are described here > http://icedtea.classpath.org/wiki/Extended_Applets_Security rather > then in plain email. > > There is what me and adam have already achieved on this topic, what we > have o achieve and where we are stil not so sure.... > > This patch is containing itw-settings part and backend for > manipulating stored entries.and basic matching. > I noted this just [fyi] because adam ave already walked through the > patch, and so have I across his part. So the patch should be ready for > push unless someone find something malicious on implementation or even > on design. > > J. TYVM for writing out the wiki page. I'm allowed to comment right ? :-) The table is looking quite nice. We can push as is and work from head perhaps ? Needs ChangeLog, though. I have attached a preferred iteration of my test. I have attached a preferred refactoring of LockingFile :-) > diff -r e631770d76ba > netx/net/sourceforge/appletextendedsecurity/AppletExtendedSecurity.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/netx/net/sourceforge/appletextendedsecurity/AppletExtendedSecurity.java > Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,84 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ > + > +package net.sourceforge.appletextendedsecurity; > + > +import javax.naming.ConfigurationException; > +import > net.sourceforge.appletextendedsecurity.impl.UnsignedAppletActionStorageImpl; > +import net.sourceforge.jnlp.config.DeploymentConfiguration; > +import net.sourceforge.jnlp.runtime.JNLPRuntime; > + > + > +public class AppletExtendedSecurity { > + > + private static UnsignedAppletActionStorageImpl globalInstance; > + private static UnsignedAppletActionStorageImpl customInstance; > + > + /** > + * > + * @return storage with global items from /etc/ > + */ > + > + public static UnsignedAppletActionStorage > getUnsignedAppletActionGlobalStorage(){ > + if (globalInstance == null){ > + globalInstance = new > UnsignedAppletActionStorageImpl(DeploymentConfiguration.getAppletTrustGlobalSettingsPath()); > + } > + return globalInstance; > + } > + > + > + /** > + * > + * @return storage with custom items from /home/ > + */ > + public static UnsignedAppletActionStorage > getUnsignedAppletActionCustomStorage(){ > + if (customInstance == null){ > + customInstance = new > UnsignedAppletActionStorageImpl(DeploymentConfiguration.getAppletTrustCustomSettingsPath()); > + } > + return customInstance; > + } > + > + public static AppletSecurityLevel getDefaultSecurityLevel(){ > + return AppletSecurityLevel.getDefault(); > + } > + > + /** > + * > + * @return user-set seurity level or default one if user-set do > not exists > + */ > + public static AppletSecurityLevel getCustomSecurityLevel(){ > + DeploymentConfiguration conf = JNLPRuntime.getConfiguration(); > + if (conf==null){ > + conf = new DeploymentConfiguration(); > + try { > + conf.load(); > + } catch (ConfigurationException ex){ > + ex.printStackTrace(); > + return getDefaultSecurityLevel(); > + } > + } > + String s = > conf.getProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL); > + if (s==null) { > + return getDefaultSecurityLevel(); > + } > + return AppletSecurityLevel.fromString(s); > + } > + > + > + > +} > diff -r e631770d76ba > netx/net/sourceforge/appletextendedsecurity/AppletSecurityLevel.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/netx/net/sourceforge/appletextendedsecurity/AppletSecurityLevel.java > Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,83 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ > + > +package net.sourceforge.appletextendedsecurity; > + > +import net.sourceforge.jnlp.runtime.Translator; > + > +public enum AppletSecurityLevel { > + > + DENY_ALL, DENY_UNSIGNED, ASK_UNSIGNED, ALLOW_UNSIGNED; > + > + public static String allToString() { > + return DENY_ALL.toChars()+" "+DENY_UNSIGNED.toChars()+" > "+ASK_UNSIGNED.toChars()+" "+ALLOW_UNSIGNED.toChars(); > + } > + > + > + > + public String toChars() { > + switch (this) { > + case DENY_ALL: > + return " DENY_ALL"; > + case DENY_UNSIGNED: > + return "DENY_UNSIGNED"; > + case ASK_UNSIGNED: > + return "ASK_UNSIGNED"; > + case ALLOW_UNSIGNED: > + return "ALLOW_UNSIGNED"; > + } > + throw new RuntimeException("Unknown AppletSecurityLevel"); > + } > + > + public String toExplanation() { > + switch (this) { > + case DENY_ALL: > + return > Translator.R("APPEXTSECappletSecurityLevelExtraHighId")+" - > "+Translator.R("APPEXTSECappletSecurityLevelExtraHighExplanation"); > + case DENY_UNSIGNED: > + return > Translator.R("APPEXTSECappletSecurityLevelVeryHighId")+" - > "+Translator.R("APPEXTSECappletSecurityLevelVeryHighExplanation"); > + case ASK_UNSIGNED: > + return > Translator.R("APPEXTSECappletSecurityLevelHighId")+" - > "+Translator.R("APPEXTSECappletSecurityLevelHighExplanation"); > + case ALLOW_UNSIGNED: > + return > Translator.R("APPEXTSECappletSecurityLevelLowId")+" - > "+Translator.R("APPEXTSECappletSecurityLevelLowExplanation"); > + } > + throw new RuntimeException("Unknown AppletSecurityLevel"); > + } > + > + public static AppletSecurityLevel fromString(String s) { > + if (s.trim().equalsIgnoreCase("DENY_ALL")) { > + return AppletSecurityLevel.DENY_ALL; > + } else if (s.trim().equalsIgnoreCase("DENY_UNSIGNED")) { > + return AppletSecurityLevel.DENY_UNSIGNED; > + } else if (s.trim().equalsIgnoreCase("ASK_UNSIGNED")) { > + return AppletSecurityLevel.ASK_UNSIGNED; > + } else if (s.trim().equalsIgnoreCase("ALLOW_UNSIGNED")) { > + return AppletSecurityLevel.ALLOW_UNSIGNED; > + } else { > + throw new RuntimeException("Unknown AppletSecurityLevel > for " + s); > + } > + } > + > + @Override > + public String toString() { > + return toExplanation(); > + } > + > + public static AppletSecurityLevel getDefault(){ > + return ASK_UNSIGNED; > + } > +} > diff -r e631770d76ba > netx/net/sourceforge/appletextendedsecurity/UnsignedAppletAction.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/netx/net/sourceforge/appletextendedsecurity/UnsignedAppletAction.java Fri > Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,73 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ > + > +package net.sourceforge.appletextendedsecurity; > + > +import net.sourceforge.jnlp.runtime.Translator; > + > +public enum UnsignedAppletAction { > + > + ALWAYS, NEVER, YES, NO; > + > + public String toChar() { > + switch (this) { > + case ALWAYS: > + return "A"; > + case NEVER: > + return "N"; > + case YES: > + return "y"; > + case NO: > + return "n"; I don't know anymore if storing yes/no is worth the added confusion of displaying them as options in icedtea-web settings (4 options for what to do with an applet -- 2 of them still requiring confirmation ??) > + } > + throw new RuntimeException("Unknown UnsignedAppletAction"); > + } > + > + public String toExplanation() { > + switch (this) { > + case ALWAYS: > + return > Translator.R("APPEXTSECunsignedAppletActionAlways"); > + case NEVER: > + return > Translator.R("APPEXTSECunsignedAppletActionNever"); > + case YES: > + return Translator.R("APPEXTSECunsignedAppletActionYes"); > + case NO: > + return Translator.R("APPEXTSECunsignedAppletActionNo"); > + } > + throw new RuntimeException("Unknown UnsignedAppletAction"); > + } > + > + public static UnsignedAppletAction fromString(String s) { > + if (s.startsWith("A")) { > + return UnsignedAppletAction.ALWAYS; > + } else if (s.startsWith("N")) { > + return UnsignedAppletAction.NEVER; > + } else if (s.startsWith("y")) { > + return UnsignedAppletAction.YES; > + } else if (s.startsWith("n")) { > + return UnsignedAppletAction.NO; > + } else { > + throw new RuntimeException("Unknown UnsignedAppletAction > for " + s); > + } > + } > + > + @Override > + public String toString() { > + return toChar() + " - " + toExplanation(); Drop this toChar() IMO. > + } > +} > diff -r e631770d76ba > netx/net/sourceforge/appletextendedsecurity/UnsignedAppletActionEntry.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/netx/net/sourceforge/appletextendedsecurity/UnsignedAppletActionEntry.java > Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,169 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ > +package net.sourceforge.appletextendedsecurity; > + > +import java.io.IOException; > +import java.io.Writer; > +import java.util.ArrayList; > +import java.util.Date; > +import java.util.List; > + > +public class UnsignedAppletActionEntry { > + > + > + > + private UnsignedAppletAction unsignedAppletAction; > + private Date timeStamp; > + private UrlRegEx documentBase; > + private UrlRegEx codeBase; > + private String mainClass; > + private List archives; > + > + > + public static UnsignedAppletActionEntry createFromString(String s) { > + String[] split = s.split("\\s+"); > + UnsignedAppletActionEntry nw = new UnsignedAppletActionEntry( > + UnsignedAppletAction.fromString(split[0]), > + new Date(new Long(split[1])), > + new UrlRegEx(split[2]), > + null, > + null, > + null > + ); > + if (split.length>3){ > + nw.setCodeBase(new UrlRegEx(split[3])); > + } Please space this out eg 'if (split.length > 3)' > + if (split.length>4){ > + nw.setMainClass(split[4]); > + } > + if (split.length>5){ > + > nw.setArchives(createArchivesList(s.substring(s.indexOf(split[4])+split[4].length()).trim())); > + } > + return nw; > + } > + > + public UnsignedAppletActionEntry(UnsignedAppletAction > unsignedAppletAction, Date timeStamp, UrlRegEx documentBase, UrlRegEx > codeBase, String mainClass, List archives) { > + this.unsignedAppletAction = unsignedAppletAction; > + this.timeStamp = timeStamp; > + this.documentBase = documentBase; > + this.codeBase = codeBase; > + this.mainClass = mainClass; > + this.archives = archives; > + > + } > + > + > + > + @Override > + public String toString() { > + return unsignedAppletAction.toChar() + > + " " + ((timeStamp == null)?"1":timeStamp.getTime()) + > + " " + ((documentBase == > null)?"":documentBase.getRegEx()) + > + " " + ((codeBase == null)?"":codeBase.getRegEx()) + > + " " + ((mainClass == null)?"":mainClass) + > + " " + createArchivesString(archives); Space this out too. I don't understand though why documentBase or codeBase would ever be null -- isn't a UrlRegEx of '.*' more appropriate ? > + > + } > + > + public void write(Writer bw) throws IOException { > + bw.write(this.toString()); > + } > + > + public Date getTimeStamp() { > + return timeStamp; > + } > + > + public UrlRegEx getDocumentBase() { > + return documentBase; > + } > + > + public void setTimeStamp(Date timeStamp) { > + this.timeStamp = timeStamp; > + } > + > + public void setDocumentBase(UrlRegEx documentBase) { > + this.documentBase = documentBase; > + } > + > + public UnsignedAppletAction getUnsignedAppletAction() { > + return unsignedAppletAction; > + } > + > + public void setUnsignedAppletAction(UnsignedAppletAction > unsignedAppletAction) { > + this.unsignedAppletAction = unsignedAppletAction; > + } > + > + public UrlRegEx getCodeBase() { > + return codeBase; > + } > + > + public void setCodeBase(UrlRegEx codeBase) { > + this.codeBase = codeBase; > + } > + > + public String getMainClass() { > + return mainClass; > + } > + > + public void setMainClass(String mainClass) { > + this.mainClass = mainClass; > + } > + > + public List getArchives() { > + return archives; > + } > + > + public void setArchives(List archives) { > + this.archives = archives; > + } > + > + public static String createArchivesString(List > listOfArchives) { > + if (listOfArchives == null){ > + return ""; > + } > + StringBuilder sb = new StringBuilder(); > + for (int i = 0; i < listOfArchives.size(); i++) { > + String string = listOfArchives.get(i); > + if (string.trim().isEmpty()){ > + continue; > + } > + sb.append(string).append(";"); > + } > + return sb.toString(); > + } > + public static List createArchivesList(String > semicolonedArchives) { > + if (semicolonedArchives == null) return null; > + if (semicolonedArchives.trim().isEmpty()) return null; > + String[] items = semicolonedArchives.trim().split(";"); > + List r = new ArrayList(items.length); > + for (int i = 0; i < items.length; i++) { > + String string = items[i]; > + if (string.trim().isEmpty()){ > + continue; > + } > + r.add(string); > + > + } > + return r; > + > + } > + > + > + > + > +} > diff -r e631770d76ba > netx/net/sourceforge/appletextendedsecurity/UnsignedAppletActionStorage.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/netx/net/sourceforge/appletextendedsecurity/UnsignedAppletActionStorage.java > Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,106 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*//* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ > +package net.sourceforge.appletextendedsecurity; > + > +import java.util.List; > + > +/** > + * > + * @author jvanek Are we allowing authors now ? :-) > + */ > +public interface UnsignedAppletActionStorage { > + > + > + /** > + * This methods iterates through record in > DeploymentConfiguration.getAppletTrustSettingsPath(), > + * and is mathing regexes saved here against params. so > parameters here are NOR tegexes, > + * but are matched against saved regexes > + * > + * Null or empty values are dangerously ignored, user, be aware > of it. > + * eg: > + * match only codeBase will be null someCodeBase null null > + * match only documentBase will be someDocBase null null null > + * match only applet not regarding code or document base will be > null null mainClas archives > + * @param documentBase > + * @param codeBase > + * @param mainClass > + * @param archives > + * @return > + */ > + public UnsignedAppletActionEntry getMatchingItem(String > documentBase, String codeBase, String mainClass, List archives); > + /** > + * Shortcut getMatchingItem(documentBase, null,null,null) > + * @param documentBase > + * @return > + */ > + public UnsignedAppletActionEntry > getMatchingItemByDocumentBase(String documentBase); > + /** > + * Shortcut getMatchingItem(null, codeBase,null,null) > + * @param codeBase > + * @return > + */ > + public UnsignedAppletActionEntry getMatchingItemByCodeBase(String > codeBase); > + /** > + * Shortcut getMatchingItem(documentBase, codeBase,null,null) > + * @param documentBase > + * @param codeBase > + * @return > + */ > + public UnsignedAppletActionEntry getMatchingItemByBases(String > documentBase, String codeBase); > + > + /** > + * Will add new record. Note that regexes are stored for bases > matching. > + * > + * eg UnsignedAppletActionEntry which will dany some applet no > metter of page will be > + * new UnsignedAppletActionEntry(UnsignedAppletAction.NEVER, new > Date(), null, null, someMain, someArchives) > + * > + * eg UnsignedAppletActionEntry which will allow all applets on > page with same codebase will be > + * new UnsignedAppletActionEntry(UnsignedAppletAction.NEVER, new > Date(), ".*", ".*", null, null); > + * > + * @param item > + */ > + public void add(final UnsignedAppletActionEntry item); > + > + /** > + * Will replace (current impl is matching by object's hashcode > + * This is not reloading the list(but still saving after), so > StorageIoEception > + * can be thrown if it was not loaded before. > + * > + * Imho this should be used only to actualise timestamps or > change UnsignedAppletAction > + * @param item > + */ > + public void update(final UnsignedAppletActionEntry item); > + > + > +} > diff -r e631770d76ba > netx/net/sourceforge/appletextendedsecurity/UrlRegEx.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/appletextendedsecurity/UrlRegEx.java Fri > Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,47 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ > + > +package net.sourceforge.appletextendedsecurity; > + > +public class UrlRegEx { > + > + String regEx; > + //cache pattern during each set and init? > + //Pattern p Drop this comment before pushing (implementation is fine as-is). > + > + public UrlRegEx(String s) { > + regEx = s; > + } > + > + @Override > + public String toString() { > + return getRegEx(); > + } > + > + public String getRegEx() { > + return regEx; > + } > + > + public String getFilteredRegEx() { > + return regEx.replaceAll("\\\\Q", "").replaceAll("\\\\E", ""); > + } > + > + public void setRegEx(String regEx) { > + this.regEx = regEx; > + } > +} > diff -r e631770d76ba > netx/net/sourceforge/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/netx/net/sourceforge/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java > Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,220 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ > + > +package net.sourceforge.appletextendedsecurity.impl; > + > +import java.io.BufferedWriter; > +import java.io.File; > +import java.io.IOException; > +import java.util.ArrayList; > +import java.util.Collections; > +import java.util.List; > +import net.sourceforge.appletextendedsecurity.UnsignedAppletActionEntry; > +import > net.sourceforge.appletextendedsecurity.UnsignedAppletActionStorage; > +import net.sourceforge.jnlp.util.lockingfile.LockingReaderWriter; > +import net.sourceforge.jnlp.util.lockingfile.StorageIoException; > + > +public class UnsignedAppletActionStorageImpl extends > LockingReaderWriter implements UnsignedAppletActionStorage{ > + > + protected List items; > + > + public UnsignedAppletActionStorageImpl(String location) { > + this(new File(location)); > + } > + > + public UnsignedAppletActionStorageImpl(File location) { > + super(location); > + } > + > + @Override > + public void writeContents() throws IOException { > + super.writeContents(); > + } > + > + @Override > + public synchronized void writeContentsLocked() throws IOException { > + super.writeContentsLocked(); > + } > + > + > + > + > + > + @Override > + protected void readContents() throws IOException { > + if (items == null) { > + items = new ArrayList(); > + } else { > + items.clear(); > + } > + super.readContents(); > + } > + > + @Override > + protected void readLine(String line) { > + if (line.trim().length() != 0) { > + this.items.add(UnsignedAppletActionEntry.createFromString(line)); > + } > + } > + > + @Override > + public void writeContent(BufferedWriter bw) throws IOException { > + for (UnsignedAppletActionEntry item : items) { > + item.write(bw); > + bw.newLine(); > + } > + } > + > + @Override > + public void add(final UnsignedAppletActionEntry item) { > + doLocked(new Runnable() { > + > + @Override > + public void run() { > + try { > + readContents(); > + items.add(item); > + writeContents(); > + } catch (IOException ex) { > + throw new StorageIoException(ex); > + } > + } > + }); > + } > + > + > + @Override > + public void update(final UnsignedAppletActionEntry item) { > + doLocked(new Runnable() { > + > + @Override > + public void run() { > + try { > + if (items == null){ > + throw new StorageIoException("Storage is not > initialised, can not update"); > + } > + if (!items.contains(item)){ > + throw new StorageIoException("Storage do not > contains item you are updateing. can not update"); > + } > + writeContents(); > + } catch (IOException ex) { > + throw new StorageIoException(ex); > + } > + } > + }); > + } > + > + > + > + @Override > + public UnsignedAppletActionEntry getMatchingItem(String > documentBase, String codeBase, String mainClass, List archives) { > + List result = > getMatchingItems(documentBase, codeBase, mainClass, archives); > + if (result == null || result.isEmpty()) { > + return null; > + } > + //returns first item > + return result.get(0); > + //Or longest match?? > + } > + > + public List getMatchingItems(String > documentBase, String codeBase, String mainClass, List archives ) { > + List result = new ArrayList(); > + lock(); > + try { > + readContents(); > + if (items == null) { > + return result; > + } > + for (UnsignedAppletActionEntry unsignedAppletActionEntry > : items) { > + if > (isMatching(unsignedAppletActionEntry,documentBase,codeBase,mainClass,archives)){ > + result.add(unsignedAppletActionEntry); > + } > + } > + return null; > + } catch (IOException e) { > + throw new StorageIoException(e); > + } finally { > + unlock(); > + return result; > + } > + } > + > + private boolean isMatching(UnsignedAppletActionEntry > unsignedAppletActionEntry, String documentBase, String codeBase, > String mainClass, List archives) { > + boolean result = true; > + if (documentBase != null && !documentBase.trim().isEmpty()) { > + result = result && > documentBase.matches(unsignedAppletActionEntry.getDocumentBase().getRegEx()); > + } > + if (codeBase != null && !codeBase.trim().isEmpty()) { > + result = result && > codeBase.matches(unsignedAppletActionEntry.getCodeBase().getRegEx()); > + } > + if (mainClass != null && !mainClass.trim().isEmpty()) { > + result = result && > mainClass.equals(unsignedAppletActionEntry.getMainClass()); > + } > + > + if (archives != null) { > + result = result && comapreArchives(archives, > unsignedAppletActionEntry.getArchives()); > + } > + return result; > + } > + > + @Override > + public String toString() { > + return getBackingFile()+" "+super.toString(); > + } > + > + private boolean comapreArchives(List archives, > List saved) { > + if (archives.size()!=saved.size()) return false; > + Collections.sort(archives); > + Collections.sort(saved); > + for (int i = 0; i < saved.size(); i++) { > + String string1 = saved.get(i); > + String string2 = archives.get(i); > + //intentional reference compare > + if (string1==string2) { > + continue; > + } > + if (string1 == null || string2 == null){ > + return false; > + } > + if (string1.trim().equals(string2.trim())){ > + continue; > + } > + return false; > + } > + return true; > + } > + > + @Override > + public UnsignedAppletActionEntry > getMatchingItemByDocumentBase(String documentBase) { > + return getMatchingItem(documentBase, null, null, null); > + } > + > + @Override > + public UnsignedAppletActionEntry getMatchingItemByCodeBase(String > codeBase) { > + return getMatchingItem(null, codeBase, null, null); > + } > + > + @Override > + public UnsignedAppletActionEntry getMatchingItemByBases(String > documentBase, String codeBase) { > + return getMatchingItem(documentBase, codeBase, null, null); > + } > + > + > + > + > +} > diff -r e631770d76ba > netx/net/sourceforge/appletextendedsecurity/impl/UnsignedAppletActionStorageOperator.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/netx/net/sourceforge/appletextendedsecurity/impl/UnsignedAppletActionStorageOperator.java > Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,180 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ > + > +package net.sourceforge.appletextendedsecurity.impl; > + > +import java.io.File; > +import java.io.IOException; > +import java.util.Date; > +import net.sourceforge.appletextendedsecurity.UnsignedAppletAction; > +import net.sourceforge.appletextendedsecurity.UnsignedAppletActionEntry; > +import net.sourceforge.appletextendedsecurity.UrlRegEx; > +import net.sourceforge.jnlp.util.lockingfile.StorageIoException; > + > +public class UnsignedAppletActionStorageOperator extends > UnsignedAppletActionStorageImpl { > + > + > + public UnsignedAppletActionStorageOperator(String location) { > + this(new File(location)); > + } > + > + public UnsignedAppletActionStorageOperator(File location) { > + super(location); > + } > + > + public UnsignedAppletActionEntry[] toArray() { > + lock(); > + try { > + readContents(); > + return items.toArray(new > UnsignedAppletActionEntry[items.size()]); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } finally { > + unlock(); > + } > + } > + > + public void clear() { > + doLocked(new Runnable() { > + > + public void run() { > + try { > + items.clear(); > + writeContents(); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } > + } > + }); > + } > + > + public void removeByBehaviour(final UnsignedAppletAction > unsignedAppletAction) { > + doLocked(new Runnable() { > + > + public void run() { > + try { > + readContents(); > + for (int i = 0; i < items.size(); i++) { > + UnsignedAppletActionEntry > unsignedAppletActionEntry = items.get(i); > + if > (unsignedAppletActionEntry.getUnsignedAppletAction() == > unsignedAppletAction) { > + items.remove(i); > + i--; > + } > + > + } > + writeContents(); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } > + } > + }); > + } > + > + private void swap(final int i, final int ii) { > + doLocked(new Runnable() { > + > + public void run() { > + try { > + readContents(); > + UnsignedAppletActionEntry backup = items.get(i); > + items.set(i, items.get(ii)); > + items.set(ii, backup); > + writeContents(); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } > + } > + }); > + > + } > + > + public void moveUp(int selectedRow) { > + if (selectedRow <= 0) { > + return; > + } > + swap(selectedRow, selectedRow - 1); > + } > + > + public void moveDown(int selectedRow) { > + if (selectedRow >= items.size() - 1) { > + return; > + } > + swap(selectedRow, selectedRow + 1); > + } > + > + public void remove(final int item) { > + doLocked(new Runnable() { > + > + public void run() { > + try { > + readContents(); > + items.remove(item); > + writeContents(); > + } catch (IOException ex) { > + throw new StorageIoException(ex); > + } > + } > + }); > + } > + > + public void modify(final UnsignedAppletActionEntry source, final > int columnIndex, final Object aValue) { > + Runnable r = new Runnable() { > + > + public void run() { > + > + try { > + if (!items.contains(source)){ > + throw new StorageIoException("Item to be > modified not found in storage"); > + } > + > + if (columnIndex == 0) { > + source.setUnsignedAppletAction((UnsignedAppletAction) aValue); > + } > + if (columnIndex == 1) { > + source.setTimeStamp((Date) aValue); > + } > + if (columnIndex == 2) { > + source.setDocumentBase(new UrlRegEx((String) > aValue)); > + } > + if (columnIndex == 3) { > + source.setCodeBase(new UrlRegEx((String) > aValue)); > + } > + if (columnIndex == 4) { > + source.setMainClass((String) aValue); > + } > + if (columnIndex == 5) { > + > source.setArchives(UnsignedAppletActionEntry.createArchivesList((String) > aValue)); > + } > + > + writeContents(); > + } catch (IOException ex) { > + throw new StorageIoException(ex); > + } > + } > + }; > + doLocked(r); > + > + } > + > + @Override > + public synchronized void writeContentsLocked() throws IOException { > + super.writeContentsLocked(); > + } > + > + > +} > diff -r e631770d76ba netx/net/sourceforge/jnlp/config/Defaults.java > --- a/netx/net/sourceforge/jnlp/config/Defaults.java Thu Jan 31 > 11:12:35 2013 +0100 > +++ b/netx/net/sourceforge/jnlp/config/Defaults.java Fri Feb 01 > 20:55:48 2013 +0100 > @@ -42,6 +42,7 @@ > import java.io.File; > import java.util.HashMap; > import java.util.Map; > +import net.sourceforge.appletextendedsecurity.AppletSecurityLevel; > > import net.sourceforge.jnlp.ShortcutDesc; > import net.sourceforge.jnlp.runtime.JNLPProxySelector; > @@ -384,6 +385,41 @@ > DeploymentConfiguration.KEY_PLUGIN_JVM_ARGUMENTS, > null, > null > + }, > + //unsigned applet security level > + { Why are you not just using a set of strings with a string validator ? I do not like the idea of having an anonymous class here. > + DeploymentConfiguration.KEY_SECURITY_LEVEL, > + new ValueValidator() { > + > + @Override > + public void validate(Object value) throws > IllegalArgumentException { > + if (value == null) { > + throw new IllegalArgumentException("Value > can't be null"); > + } > + if (value instanceof AppletSecurityLevel) { > + //?? > + return; > + } > + if (!(value instanceof String)) { > + throw new > IllegalArgumentException("Expected was String, was " + value.getClass()); > + } > + try { > + AppletSecurityLevel validated = > AppletSecurityLevel.fromString((String) value); > + if (validated == null) { > + throw new > IllegalArgumentException("Result can't be null, was"); > + } > + //thrown by fromString > + } catch (RuntimeException ex) { > + throw new IllegalArgumentException(ex); > + } > + } > + > + @Override > + public String getPossibleValues() { > + return AppletSecurityLevel.allToString(); > + } > + }, > + null > } > }; > > diff -r e631770d76ba > netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java > --- a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java > Thu Jan 31 11:12:35 2013 +0100 > +++ b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java > Fri Feb 01 20:55:48 2013 +0100 > @@ -51,6 +51,7 @@ > public static final String DEPLOYMENT_DIR = ".icedtea"; > public static final String DEPLOYMENT_CONFIG = "deployment.config"; > public static final String DEPLOYMENT_PROPERTIES = > "deployment.properties"; > + public static final String APPLET_TRUST_SETTINGS = > ".appletTrustSettings"; > > public static final String DEPLOYMENT_COMMENT = "Netx deployment > configuration"; > > @@ -105,6 +106,9 @@ > /** Boolean. Only show security prompts to user if true */ > public static final String KEY_SECURITY_PROMPT_USER = > "deployment.security.askgrantdialog.show"; > > + //enum of AppletSecurityLevel in result > + public static final String KEY_SECURITY_LEVEL = > "deployment.security.level"; > + > public static final String KEY_SECURITY_TRUSTED_POLICY = > "deployment.security.trusted.policy"; > > /** Boolean. Only give > AWTPermission("showWindowWithoutWarningBanner") if true */ > @@ -196,6 +200,17 @@ > load(true); > } > > + public static File getAppletTrustCustomSettingsPath() { > + return new File(System.getProperty("user.home") + > File.separator + DEPLOYMENT_DIR > + + File.separator + APPLET_TRUST_SETTINGS); > + } > + > + public static File getAppletTrustGlobalSettingsPath() { > + return new File(File.separator + "etc" + File.separator + > ".java" + File.separator > + + "deployment" + File.separator + APPLET_TRUST_SETTINGS); > + > + } > + > /** > * Initialize this deployment configuration by reading > configuration files. > * Generally, it will try to continue and ignore errors it finds > (such as file not found). > diff -r e631770d76ba > netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java > --- a/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java Thu > Jan 31 11:12:35 2013 +0100 > +++ b/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java Fri > Feb 01 20:55:48 2013 +0100 > @@ -41,6 +41,7 @@ > import javax.swing.JFrame; > import javax.swing.JLabel; > import javax.swing.JList; > +import javax.swing.JOptionPane; > import javax.swing.JPanel; > import javax.swing.JScrollPane; > import javax.swing.SwingConstants; > @@ -230,7 +231,10 @@ > new SettingsPanel(Translator.R("CPTabNetwork"), > createNetworkSettingsPanel()), > // TODO: This is commented out since this is not > implemented yet > // new SettingsPanel(Translator.R("CPTabRuntimes"), > createRuntimesSettingsPanel()), > - new SettingsPanel(Translator.R("CPTabSecurity"), > createSecuritySettingsPanel()), }; > + new SettingsPanel(Translator.R("CPTabSecurity"), > createSecuritySettingsPanel()), > + //todo refactor to work with tmp file and apply as > asu designed it > + new > SettingsPanel(Translator.R("APPEXTSECControlPanelExtendedAppletSecurityTitle"), > new > UnsignedAppletsTrustingListPanel(DeploymentConfiguration.getAppletTrustGlobalSettingsPath(),DeploymentConfiguration.getAppletTrustCustomSettingsPath(), > this.config) ) > + }; > > // Add panels. > final JPanel settingsPanel = new JPanel(new CardLayout()); > @@ -360,6 +364,7 @@ > config.save(); > } catch (IOException e) { > e.printStackTrace(); > + JOptionPane.showMessageDialog(this, e); > } > } > > diff -r e631770d76ba > netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java > Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,168 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ > + > +package net.sourceforge.jnlp.controlpanel; > + > +import java.util.Date; > +import javax.swing.table.AbstractTableModel; > +import net.sourceforge.appletextendedsecurity.UnsignedAppletAction; > +import net.sourceforge.appletextendedsecurity.UnsignedAppletActionEntry; > +import net.sourceforge.appletextendedsecurity.UrlRegEx; > +import > net.sourceforge.appletextendedsecurity.impl.UnsignedAppletActionStorageOperator; > +import net.sourceforge.jnlp.runtime.Translator; > + > +public class UnsignedAppletActionTableModel extends AbstractTableModel { > + > + final UnsignedAppletActionStorageOperator back; > + private final String[] columns = new > String[]{Translator.R("APPEXTSECguiTableModelTableColumnAction"), > + Translator.R("APPEXTSECguiTableModelTableColumnDateOfAction"), > + Translator.R("APPEXTSECguiTableModelTableColumnDocumentBase"), > + Translator.R("APPEXTSECguiTableModelTableColumnCodeBase"), > + Translator.R("APPEXTSECguiTableModelTableColumnMainClass"), > + Translator.R("APPEXTSECguiTableModelTableColumnArchives")}; > + > + public > UnsignedAppletActionTableModel(UnsignedAppletActionStorageOperator back) { > + this.back = back; > + } > + > + @Override > + public int getRowCount() { > + try { > + return back.toArray().length; > + } catch (Exception ex) { > + throw new RuntimeException(ex); Why is this wrapping needed ? > + } > + } > + > + @Override > + public int getColumnCount() { > + return columns.length; > + } > + > + @Override > + public String getColumnName(int columnIndex) { > + return columns[columnIndex]; > + } > + > + @Override > + public Class getColumnClass(int columnIndex) { > + if (columnIndex == 0) { > + return UnsignedAppletAction.class; > + } > + if (columnIndex == 1) { > + return Date.class; > + } > + if (columnIndex == 2) { > + return UrlRegEx.class; > + } > + if (columnIndex == 3) { > + return UrlRegEx.class; > + } > + if (columnIndex == 3) { > + return String.class; > + } > + if (columnIndex == 3) { > + return String.class; > + } > + return Object.class; > + } > + > + @Override > + public boolean isCellEditable(int rowIndex, int columnIndex) { > + if (back.isReadOnly()){ > + return false; > + } > + if (columnIndex==1) return false; > + if (columnIndex==0) return true; > + if (getValueAt(rowIndex, columnIndex-1)==null || > getValueAt(rowIndex, columnIndex-1).toString().trim().isEmpty()) > return false; > + return true; > + } > + > + @Override > + public Object getValueAt(int rowIndex, int columnIndex) { > + > + UnsignedAppletActionEntry source = back.toArray()[rowIndex]; > + if (columnIndex == 0) { > + return source.getUnsignedAppletAction(); > + } > + if (columnIndex == 1) { > + return source.getTimeStamp(); > + } > + if (columnIndex == 2) { > + return source.getDocumentBase(); > + } > + if (columnIndex == 3) { > + return source.getCodeBase(); > + } > + if (columnIndex == 4) { > + return source.getMainClass(); > + } > + if (columnIndex == 5) { > + return > UnsignedAppletActionEntry.createArchivesString(source.getArchives()); > + } > + return null; > + } > + > + @Override > + public void setValueAt(final Object aValue, final int rowIndex, > final int columnIndex) { > + final UnsignedAppletActionEntry source = > back.toArray()[rowIndex]; > + back.modify(source, columnIndex, aValue); > + > + } > + > + public void addRow() { > + int i = back.toArray().length; > + String s = "\\Qhttp://localhost:80/\\E.*"; > + back.add(new UnsignedAppletActionEntry( > + UnsignedAppletAction.NEVER, > + new Date(), > + new UrlRegEx(s), > + new UrlRegEx(s), > + null, > + null)); > + fireTableRowsInserted(i, i + 1); > + } > + > + public void removeRow(int i) { > + back.remove(i); > + fireTableRowsDeleted(i, i); > + } > + > + public void clear() { > + int i = getRowCount(); > + back.clear(); > + fireTableRowsDeleted(0, i); > + } > + > + void removeByBehaviour(UnsignedAppletAction unsignedAppletAction) { > + int i = getRowCount(); > + back.removeByBehaviour(unsignedAppletAction); > + fireTableRowsDeleted(0, i); > + } > + > + void moveUp(int selectedRow) { > + int i = getRowCount(); > + back.moveUp(selectedRow); > + fireTableRowsUpdated(i-1, i); > + } > + void moveDown(int selectedRow) { > + int i = getRowCount(); > + back.moveDown(selectedRow); > + fireTableRowsUpdated(i, i+1); > + } > +} > diff -r e631770d76ba > netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java > Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,665 @@ > +/* > + Copyright (C) 2013 Red Hat > + > + This program 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 of the License, or > + (at your option) any later version. > + > + This program 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 this program; if not, write to the Free Software > + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > + */ > +package net.sourceforge.jnlp.controlpanel; > + > +import java.awt.BorderLayout; > +import java.io.BufferedWriter; > +import java.io.File; > +import java.io.FileOutputStream; > +import java.io.OutputStreamWriter; > +import java.text.DateFormat; > +import java.util.ArrayList; > +import java.util.Collections; > +import java.util.Date; > +import java.util.List; > +import java.util.regex.Pattern; > +import javax.swing.event.ChangeEvent; > +import javax.swing.event.ListSelectionEvent; > +import net.sourceforge.appletextendedsecurity.UnsignedAppletAction; > +import net.sourceforge.appletextendedsecurity.UrlRegEx; > +import javax.swing.DefaultCellEditor; > +import javax.swing.JComboBox; > +import javax.swing.JFrame; > +import javax.swing.JOptionPane; > +import javax.swing.JPanel; > +import javax.swing.JTable; > +import javax.swing.JTextField; > +import javax.swing.event.ChangeListener; > +import javax.swing.event.ListSelectionListener; > +import javax.swing.table.DefaultTableCellRenderer; > +import javax.swing.table.DefaultTableModel; > +import javax.swing.table.TableCellEditor; > +import javax.swing.table.TableCellRenderer; > +import javax.swing.table.TableModel; > +import net.sourceforge.appletextendedsecurity.UnsignedAppletActionEntry; > +import > net.sourceforge.appletextendedsecurity.impl.UnsignedAppletActionStorageOperator; > +import net.sourceforge.appletextendedsecurity.AppletSecurityLevel; > +import net.sourceforge.jnlp.config.DeploymentConfiguration; > +import net.sourceforge.jnlp.runtime.Translator; > + > +public class UnsignedAppletsTrustingListPanel extends > javax.swing.JPanel { > + > + private javax.swing.JButton jButton1; > + private javax.swing.JButton jButton2; > + private javax.swing.JButton jButton3; > + private javax.swing.JButton jButton4; > + private javax.swing.JButton jButton5; > + private javax.swing.JButton jButton6; > + private javax.swing.JButton jButton7; > + private javax.swing.JButton jButton8; > + private javax.swing.JCheckBox jCheckBox1; > + private javax.swing.JCheckBox jCheckBox2; > + private javax.swing.JComboBox jComboBox1; > + private javax.swing.JComboBox jComboBox2; > + private javax.swing.JLabel jLabel1; > + private javax.swing.JLabel jLabel2; > + private javax.swing.JScrollPane jScrollPane1; > + private javax.swing.JTabbedPane jTabPane1; > + private javax.swing.JTable jTable1; > + private javax.swing.JScrollPane jScrollPane2; > + private javax.swing.JTable jTable2; Numbers are not an acceptable naming convention IMO. Same with the numbered methods. But I think it can be fixed once in HEAD. The functionality is the priority ATM. > + private final UnsignedAppletActionStorageOperator customBackEnd; > + private final UnsignedAppletActionStorageOperator globalBackEnd; > + private final UnsignedAppletActionTableModel customModel; > + private final UnsignedAppletActionTableModel globalModel; > + private final DeploymentConfiguration conf; > + private javax.swing.JTable currentTable; > + private UnsignedAppletActionTableModel currentModel; > + private String lastDoc; > + private String lastCode; > + > + > + /* > + * for testing and playing > + */ > + public static void main(String args[]) { > + final String defaultDir = System.getProperty("user.home") + > "/Desktop/"; > + final String defaultFileName1 = "terrorList1"; > + final String defaultFileName2 = "terrorList2"; > + final String defaultFile1 = defaultDir + defaultFileName1; > + final String defaultFile2 = defaultDir + defaultFileName2; > + java.awt.EventQueue.invokeLater(new Runnable() { > + @Override > + public void run() { > + try { > + JFrame f = new JFrame(); > + f.setSize(700, 300); > + f.setLayout(new BorderLayout()); > + f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); > + DeploymentConfiguration cc = new > DeploymentConfiguration(); > + cc.load(); > + File ff1 = new File(defaultFile1); > + File ff2 = new File(defaultFile2); > + f.add(new UnsignedAppletsTrustingListPanel(ff2, > ff1, cc)); > + f.setVisible(true); > + } catch (Exception ex) { > + ex.printStackTrace(); > + } > + } > + }); > + } > + > + public UnsignedAppletsTrustingListPanel(File globalSettings, File > customSettings, DeploymentConfiguration conf) { > + customBackEnd = new > UnsignedAppletActionStorageOperator(customSettings); > + globalBackEnd = new > UnsignedAppletActionStorageOperator(globalSettings); > + customModel = new UnsignedAppletActionTableModel(customBackEnd); > + globalModel = new UnsignedAppletActionTableModel(globalBackEnd); > + initComponents(); > + this.conf = conf; > + AppletSecurityLevel gs = AppletSecurityLevel.getDefault(); > + String s = > conf.getProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL); > + if (s != null) { > + gs = AppletSecurityLevel.fromString(s); > + } > + jComboBox1.setSelectedItem(gs); > + jTable1.getSelectionModel().addListSelectionListener(new > SingleSelectionListenerImpl(jTable1)); > + jTable2.getSelectionModel().addListSelectionListener(new > SingleSelectionListenerImpl(jTable2)); > + currentTable = jTable1; > + currentModel = customModel; > + setButtons((!currentModel.back.isReadOnly())); > + } > + > + public String > appletItemsToCaption(List ii, String caption) { > + StringBuilder sb = new StringBuilder(); > + for (UnsignedAppletActionEntry i : ii) { > + sb.append(appletItemToCaption(i, caption)).append("\n"); > + } > + return sb.toString(); > + } > + > + public String appletItemToCaption(UnsignedAppletActionEntry i, > String caption) { > + return Translator.R("APPEXTSECguiPanelAppletInfoHederPart1", > caption, i.getDocumentBase().getFilteredRegEx()) > + + "\n (" + > Translator.R("APPEXTSECguiPanelAppletInfoHederPart2", > i.getUnsignedAppletAction(), > DateFormat.getInstance().format(i.getTimeStamp())) > + + "\n " + > Translator.R("APPEXTSECguiTableModelTableColumnDocumentBase") + ": " + > i.getDocumentBase().getFilteredRegEx() > + + "\n " + > Translator.R("APPEXTSECguiTableModelTableColumnCodeBase") + ": " + > i.getCodeBase().getFilteredRegEx() > + + "\n " + > Translator.R("APPEXTSECguiTableModelTableColumnMainClass") + ": " + > ((i.getMainClass() == null) ? "" : i.getMainClass()) > + + "\n " + > Translator.R("APPEXTSECguiTableModelTableColumnArchives") + ": " + > UnsignedAppletActionEntry.createArchivesString(i.getArchives()); > + } > + > + public void removeSelectedFromTable(JTable table) { > + int[] originalIndexes = table.getSelectedRows(); > + List newIndexes = new > ArrayList(originalIndexes.length); > + for (int i = 0; i < originalIndexes.length; i++) { > + //we need to remap values first > + int modelRow = > table.convertRowIndexToModel(originalIndexes[i]); > + newIndexes.add(modelRow); > + } > + //now to sort so we can incrementaly dec safely > + Collections.sort(newIndexes); > + if (jCheckBox1.isSelected()) { > + String s = > Translator.R("APPEXTSECguiPanelConfirmDeletionOf", newIndexes.size()) > + ": \n"; > + UnsignedAppletActionEntry[] items = > currentModel.back.toArray(); > + for (int i = 0; i < newIndexes.size(); i++) { > + Integer integer = newIndexes.get(i); > + s += appletItemToCaption(items[integer], " ") + "\n"; > + } > + int a = JOptionPane.showConfirmDialog(this, s); > + if (a != JOptionPane.OK_OPTION) { > + return; > + } > + } > + int sub = 0; > + for (int i = 0; i < newIndexes.size(); i++) { > + Integer integer = newIndexes.get(i); > + currentModel.removeRow(integer.intValue() + sub); > + sub--; > + } > + } > + > + public void removeAllItemsFromTable(JTable table, > UnsignedAppletActionTableModel model) { > + table.clearSelection(); > + > + if (jCheckBox1.isSelected()) { > + UnsignedAppletActionEntry[] items = model.back.toArray(); > + String s = > Translator.R("APPEXTSECguiPanelConfirmDeletionOf", items.length) + ": \n"; > + for (int i = 0; i < items.length; i++) { > + s += appletItemToCaption(items[i], " ") + "\n"; > + } > + int a = JOptionPane.showConfirmDialog(this, s); > + if (a != JOptionPane.OK_OPTION) { > + return; > + } > + } > + model.clear(); > + } > + > + private void initComponents() { > + > + jScrollPane1 = new javax.swing.JScrollPane(); > + jScrollPane2 = new javax.swing.JScrollPane(); > + jTable1 = createTbale(customModel); > + jTable2 = createTbale(globalModel); > + jButton1 = new javax.swing.JButton(); > + jComboBox1 = new JComboBox(new AppletSecurityLevel[]{ > + AppletSecurityLevel.DENY_ALL, > + AppletSecurityLevel.DENY_UNSIGNED, > + AppletSecurityLevel.ASK_UNSIGNED, > + AppletSecurityLevel.ALLOW_UNSIGNED > + }); > + jComboBox1.setSelectedItem(AppletSecurityLevel.getDefault()); > + jLabel2 = new javax.swing.JLabel(); > + jLabel1 = new javax.swing.JLabel(); > + jComboBox2 = new javax.swing.JComboBox(); > + jButton2 = new javax.swing.JButton(); > + jButton5 = new javax.swing.JButton(); > + jButton3 = new javax.swing.JButton(); > + jButton4 = new javax.swing.JButton(); > + jCheckBox1 = new javax.swing.JCheckBox(); > + jCheckBox2 = new javax.swing.JCheckBox(); > + jButton6 = new javax.swing.JButton(); > + jButton7 = new javax.swing.JButton(); > + jButton8 = new javax.swing.JButton(); > + jTabPane1 = new javax.swing.JTabbedPane(); > + > + jScrollPane1.setViewportView(jTable1); > + > + jScrollPane2.setViewportView(jTable2); > + > + jButton1.setText(Translator.R("APPEXTSECguiPanelHelpButton")); > + jButton1.addActionListener(new java.awt.event.ActionListener() { > + @Override > + public void actionPerformed(java.awt.event.ActionEvent evt) { > + jButton1ActionPerformed(evt); > + } > + }); > + > + jComboBox1.addActionListener(new > java.awt.event.ActionListener() { > + @Override > + public void actionPerformed(java.awt.event.ActionEvent evt) { > + jComboBox1ActionPerformed(evt); > + } > + }); > + > + jLabel2.setText(Translator.R("APPEXTSECguiPanelSecurityLevel")); > + > + > jLabel1.setText(Translator.R("APPEXTSECguiPanelGlobalBehaviourCaption")); > + > + jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new > String[]{ > + Translator.R("APPEXTSECguiPanelDeleteMenuSelected"), > + Translator.R("APPEXTSECguiPanelDeleteMenuAllA"), > + Translator.R("APPEXTSECguiPanelDeleteMenuAllN"), > + Translator.R("APPEXTSECguiPanelDeleteMenuAlly"), > + Translator.R("APPEXTSECguiPanelDeleteMenuAlln"), > + Translator.R("APPEXTSECguiPanelDeleteMenuAllAll")})); > + > + jButton2.setText(Translator.R("APPEXTSECguiPanelDeleteButton")); > + jButton2.addActionListener(new java.awt.event.ActionListener() { > + @Override > + public void actionPerformed(java.awt.event.ActionEvent evt) { > + jButton2ActionPerformed(evt); > + } > + }); > + > + jButton5.setText(Translator.R("APPEXTSECguiPanelTestUrlButton")); > + jButton5.addActionListener(new java.awt.event.ActionListener() { > + @Override > + public void actionPerformed(java.awt.event.ActionEvent evt) { > + jButton5ActionPerformed(evt); > + } > + }); > + > + jButton3.setText(Translator.R("APPEXTSECguiPanelAddRowButton")); > + jButton3.addActionListener(new java.awt.event.ActionListener() { > + @Override > + public void actionPerformed(java.awt.event.ActionEvent evt) { > + jButton3ActionPerformed(evt); > + } > + }); > + > + jButton4.setText(Translator.R("APPEXTSECguiPanelValidateTableButton")); > + jButton4.addActionListener(new java.awt.event.ActionListener() { > + @Override > + public void actionPerformed(java.awt.event.ActionEvent evt) { > + jButton4ActionPerformed(evt); > + } > + }); > + > + jCheckBox1.setSelected(true); > + jCheckBox1.setText(Translator.R("APPEXTSECguiPanelAskeforeActionBox")); > + > + jCheckBox2.setText(Translator.R("APPEXTSECguiPanelShowRegExesBox")); > + jCheckBox2.addActionListener(new > java.awt.event.ActionListener() { > + @Override > + public void actionPerformed(java.awt.event.ActionEvent evt) { > + jCheckBox2ActionPerformed(evt); > + } > + }); > + > + jButton6.setText(Translator.R("APPEXTSECguiPanelInverSelection")); > + jButton6.addActionListener(new java.awt.event.ActionListener() { > + @Override > + public void actionPerformed(java.awt.event.ActionEvent evt) { > + jButton6ActionPerformed(evt); > + } > + }); > + > + jButton7.setText(Translator.R("APPEXTSECguiPanelMoveRowUp")); > + jButton7.setEnabled(false); > + jButton7.addActionListener(new java.awt.event.ActionListener() { > + @Override > + public void actionPerformed(java.awt.event.ActionEvent evt) { > + jButton7ActionPerformed(evt); > + } > + }); > + > + jButton8.setText(Translator.R("APPEXTSECguiPanelMoveRowDown")); > + jButton8.setEnabled(false); > + jButton8.addActionListener(new java.awt.event.ActionListener() { > + @Override > + public void actionPerformed(java.awt.event.ActionEvent evt) { > + jButton8ActionPerformed(evt); > + } > + }); > + > + javax.swing.GroupLayout layout = new > javax.swing.GroupLayout(this); > + this.setLayout(layout); > + layout.setHorizontalGroup( > + > layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, > layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addComponent(jTabPane1, > javax.swing.GroupLayout.Alignment.LEADING, > javax.swing.GroupLayout.DEFAULT_SIZE, 583, > Short.MAX_VALUE).addComponent(jLabel1, > javax.swing.GroupLayout.Alignment.LEADING).addGroup(javax.swing.GroupLayout.Alignment.LEADING, > layout.createSequentialGroup().addComponent(jLabel2).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jComboBox1, > 0, 474, > Short.MAX_VALUE)).addGroup(javax.swing.GroupLayout.Alignment.LEADING, > layout.createSequentialGroup().addComponent(jButton3).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jButton4).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jButton5).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, > 94, > Short.MAX_VALUE).addComponent(jButton8).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jButton7)).addGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addComponent(jButton2).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jComboBox2, > javax.swing.GroupLayout.PREFERRED_SIZE, > javax.swing.GroupLayout.DEFAULT_SIZE, > javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jButton6)).addGroup(layout.createSequentialGroup().addComponent(jCheckBox1).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jCheckBox2))).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, > 93, Short.MAX_VALUE).addComponent(jButton1, > javax.swing.GroupLayout.PREFERRED_SIZE, 108, > javax.swing.GroupLayout.PREFERRED_SIZE))).addContainerGap())); > + layout.setVerticalGroup( > + > layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jLabel1).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jLabel2).addComponent(jComboBox1, > javax.swing.GroupLayout.PREFERRED_SIZE, > javax.swing.GroupLayout.DEFAULT_SIZE, > javax.swing.GroupLayout.PREFERRED_SIZE)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, > false).addComponent(jButton2).addComponent(jComboBox2).addComponent(jButton6, > javax.swing.GroupLayout.DEFAULT_SIZE, > javax.swing.GroupLayout.DEFAULT_SIZE, > Short.MAX_VALUE)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jCheckBox1).addComponent(jCheckBox2))).addComponent(jButton1, > javax.swing.GroupLayout.PREFERRED_SIZE, 53, > javax.swing.GroupLayout.PREFERRED_SIZE)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jTabPane1, > javax.swing.GroupLayout.DEFAULT_SIZE, 161, > Short.MAX_VALUE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jButton3).addComponent(jButton4).addComponent(jButton5).addComponent(jButton7).addComponent(jButton8)).addContainerGap())); > + > + JPanel pane1 = new JPanel(new BorderLayout()); > + JPanel pane2 = new JPanel(new BorderLayout()); > + pane1.add(jScrollPane1); > + pane2.add(jScrollPane2); > + jTabPane1.add(pane1); > + jTabPane1.add(pane2); > + jTabPane1.setTitleAt(0, > Translator.R("APPEXTSECguiPanelCustomDefs")); > + jTabPane1.setTitleAt(1, > Translator.R("APPEXTSECguiPanelGlobalDefs")); > + jTabPane1.setToolTipTextAt(0, > DeploymentConfiguration.getAppletTrustCustomSettingsPath().getAbsolutePath()); > + jTabPane1.setToolTipTextAt(1, > DeploymentConfiguration.getAppletTrustGlobalSettingsPath().getAbsolutePath()); > + jTabPane1.addChangeListener(new ChangeListener() { > + @Override > + public void stateChanged(ChangeEvent e) { > + switch (jTabPane1.getSelectedIndex()) { > + case 0: > + currentModel = customModel; > + currentTable = jTable1; > + break; > + case 1: > + currentModel = globalModel; > + currentTable = jTable2; > + break; > + } > + setButtons((!currentModel.back.isReadOnly())); > + } > + }); > + } > + > + private void jComboBox1ActionPerformed(java.awt.event.ActionEvent > evt) { > + try { > + conf.setProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL, > ((AppletSecurityLevel) jComboBox1.getSelectedItem()).toChars()); > + conf.save(); > + } catch (Exception ex) { > + ex.printStackTrace(); > + JOptionPane.showMessageDialog(this, ex); > + } > + } > + > + private void jButton2ActionPerformed(java.awt.event.ActionEvent > evt) { > + > + if (jComboBox2.getSelectedIndex() == 0) { > + removeSelectedFromTable(currentTable); > + } > + if (jComboBox2.getSelectedIndex() == 1) { > + removeByBehaviour(UnsignedAppletAction.ALWAYS); > + } > + if (jComboBox2.getSelectedIndex() == 2) { > + removeByBehaviour(UnsignedAppletAction.NEVER); > + } > + if (jComboBox2.getSelectedIndex() == 3) { > + removeByBehaviour(UnsignedAppletAction.YES); > + } > + if (jComboBox2.getSelectedIndex() == 4) { > + removeByBehaviour(UnsignedAppletAction.NO); > + } > + if (jComboBox2.getSelectedIndex() == 5) { > + removeAllItemsFromTable(currentTable, customModel); > + } > + } > + > + private void jButton5ActionPerformed(java.awt.event.ActionEvent > evt) { > + > + String s1 = > JOptionPane.showInputDialog(Translator.R("APPEXTSECguiPanelDocTest"), > lastDoc); > + String s2 = > JOptionPane.showInputDialog(Translator.R("APPEXTSECguiPanelCodeTest"), > lastCode); > + lastDoc = s1; > + lastCode = s2; > + try { > + List i = > currentModel.back.getMatchingItems(s1, s2, null, null); > + if (i == null || i.isEmpty()) { > + JOptionPane.showMessageDialog(this, > Translator.R("APPEXTSECguiPanelNoMatch")); > + } else { > + JOptionPane.showMessageDialog(this, > Translator.R("APPEXTSECguiPanelMatchingNote") + "\n" + > appletItemsToCaption(i, Translator.R("APPEXTSECguiPanelMatched") + ": ")); > + } > + } catch (Exception ex) { > + ex.printStackTrace(); > + JOptionPane.showMessageDialog(this, > Translator.R("APPEXTSECguiPanelMatchingError", ex)); > + } > + > + } > + > + private void jButton3ActionPerformed(java.awt.event.ActionEvent > evt) { > + > + currentModel.addRow(); > + } > + > + private void jButton4ActionPerformed(java.awt.event.ActionEvent > evt) { > + > + File f = null; > + try { > + f = File.createTempFile("appletTable", "validation"); > + } catch (Exception ex) { > + ex.printStackTrace(); > + JOptionPane.showMessageDialog(this, > Translator.R("APPEXTSECguiPanelCanNOtValidate", ex.toString())); > + return; > + } > + try { > + currentModel.back.writeContentsLocked(); > + BufferedWriter bw = new BufferedWriter(new > OutputStreamWriter(new FileOutputStream(f), "UTF-8")); > + currentModel.back.writeContent(bw); > + bw.flush(); > + bw.close(); > + UnsignedAppletActionStorageOperator copy = new > UnsignedAppletActionStorageOperator(f); > + UnsignedAppletActionEntry[] items = copy.toArray(); > + for (int i = 0; i < items.length; i++) { > + UnsignedAppletActionEntry unsignedAppletActionEntry = > items[i]; > + if (unsignedAppletActionEntry.getDocumentBase() != > null && > !unsignedAppletActionEntry.getDocumentBase().getRegEx().trim().isEmpty()) > { > + Pattern p = > Pattern.compile(unsignedAppletActionEntry.getDocumentBase().getRegEx()); > + p.matcher("someInput").find(); > + } else { > + throw new > RuntimeException(Translator.R("APPEXTSECguiPanelEmptyDoc")); > + } > + if (unsignedAppletActionEntry.getCodeBase() != null > && !unsignedAppletActionEntry.getCodeBase().getRegEx().trim().isEmpty()) { > + Pattern p = > Pattern.compile(unsignedAppletActionEntry.getCodeBase().getRegEx()); > + p.matcher("someInput").find(); > + } else { > + throw new > RuntimeException(Translator.R("APPEXTSECguiPanelEmptyCode")); > + } > + > UnsignedAppletActionEntry.createArchivesString(UnsignedAppletActionEntry.createArchivesList(UnsignedAppletActionEntry.createArchivesString(unsignedAppletActionEntry.getArchives()))); > + > + } > + JOptionPane.showMessageDialog(this, > Translator.R("APPEXTSECguiPanelTableValid")); > + } catch (Exception ex) { > + ex.printStackTrace(); > + JOptionPane.showMessageDialog(this, > Translator.R("APPEXTSECguiPanelTableInvalid ", ex.toString())); > + } finally { > + f.delete(); > + } > + > + } > + > + private void jCheckBox2ActionPerformed(java.awt.event.ActionEvent > evt) { > + > + reloadTable(); > + } > + > + private void jButton6ActionPerformed(java.awt.event.ActionEvent > evt) { > + int[] selectedIndexs = currentTable.getSelectedRows(); > + currentTable.selectAll(); > + > + for (int i = 0; i < currentTable.getRowCount(); i++) { > + for (int selectedIndex : selectedIndexs) { > + if (selectedIndex == i) { > + currentTable.removeRowSelectionInterval(i, i); > + break; > + } > + } > + } > + } > + > + private void jButton7ActionPerformed(java.awt.event.ActionEvent > evt) { > + int orig = currentTable.getSelectedRow(); > + int i = currentTable.convertRowIndexToModel(orig); > + currentModel.moveUp(i); > + reloadTable(); > + if (orig >= 1) { > + currentTable.getSelectionModel().setSelectionInterval(orig - 1, orig > - 1); > + } > + } > + > + private void jButton8ActionPerformed(java.awt.event.ActionEvent > evt) { > + int orig = currentTable.getSelectedRow(); > + int i = currentTable.convertRowIndexToModel(orig); > + currentModel.moveDown(i); > + reloadTable(); > + if (orig < currentModel.getRowCount()) { > + currentTable.getSelectionModel().setSelectionInterval(orig + 1, orig > + 1); > + } > + } > + > + private void jButton1ActionPerformed(java.awt.event.ActionEvent > evt) { > + } > + > + private void setButtons(boolean b) { > + jButton2.setEnabled(b); > + jButton3.setEnabled(b); > + jButton6.setEnabled(b); > + jButton7.setEnabled(b); > + jButton8.setEnabled(b); > + } > + > + private JTable createTbale(final TableModel model) { > + JTable jt = new JTable() { > + @Override > + public TableCellEditor getCellEditor(int row, int column) { > + if (column == 0) { > + return new DefaultCellEditor(new JComboBox(new > UnsignedAppletAction[]{UnsignedAppletAction.ALWAYS, > UnsignedAppletAction.NEVER, UnsignedAppletAction.YES, > UnsignedAppletAction.NO})); > + } > + if (column == 2) { > + return new DefaultCellEditor(new > MyTextField((UrlRegEx) (model.getValueAt(row, column)))); > + } > + if (column == 3) { > + return new DefaultCellEditor(new > MyTextField((UrlRegEx) (model.getValueAt(row, column)))); > + } > + return super.getCellEditor(row, column); > + } > + > + @Override > + public TableCellRenderer getCellRenderer(int row, int > column) { > + if (column == 1) { > + return new > UrlRegexCellRenderer.MyDateCellRenderer((Date) (model.getValueAt(row, > column))); > + } > + if (column == 2) { > + if (!jCheckBox2.isSelected()) { > + return new UrlRegexCellRenderer((UrlRegEx) > (model.getValueAt(row, column))); > + } > + } > + if (column == 3) { > + if (!jCheckBox2.isSelected()) { > + return new UrlRegexCellRenderer((UrlRegEx) > (model.getValueAt(row, column))); > + } > + } > + return super.getCellRenderer(row, column); > + } > + }; > + jt.setRowHeight(jt.getRowHeight() + jt.getRowHeight() / 2); > + jt.setModel(model); > + return jt; > + > + } > + > + private void reloadTable() { > + currentTable.setModel(new DefaultTableModel()); > + currentTable.setModel(currentModel); > + > + } > + > + private void removeByBehaviour(UnsignedAppletAction > unsignedAppletAction) { > + UnsignedAppletActionEntry[] items = currentModel.back.toArray(); > + if (jCheckBox1.isSelected()) { > + List toBeDeleted = new > ArrayList(); > + for (int i = 0; i < items.length; i++) { > + UnsignedAppletActionEntry unsignedAppletActionEntry = > items[i]; > + if > (unsignedAppletActionEntry.getUnsignedAppletAction() == > unsignedAppletAction) { > + toBeDeleted.add(unsignedAppletActionEntry); > + } > + > + } > + String s = > Translator.R("APPEXTSECguiPanelConfirmDeletionOf", > toBeDeleted.size())+": \n"; > + for (int i = 0; i < toBeDeleted.size(); i++) { > + s += appletItemToCaption(toBeDeleted.get(i), " ") + "\n"; > + } > + int a = JOptionPane.showConfirmDialog(this, s); > + if (a != JOptionPane.OK_OPTION) { > + return; > + } > + } > + currentModel.removeByBehaviour(unsignedAppletAction); > + } > + > + public static final class MyTextField extends JTextField { > + > + private final UrlRegEx keeper; > + > + private MyTextField(UrlRegEx urlRegEx) { > + if (urlRegEx == null) { > + keeper = new UrlRegEx(""); > + } else { > + this.keeper = urlRegEx; > + } > + setText(keeper.getFilteredRegEx()); > + } > + > + @Override > + public void setText(String t) { > + super.setText(keeper.getRegEx()); > + } > + } > + > + public static final class UrlRegexCellRenderer extends > DefaultTableCellRenderer { > + > + private final UrlRegEx keeper; > + > + private UrlRegexCellRenderer(UrlRegEx urlRegEx) { > + if (urlRegEx == null) { > + keeper = new UrlRegEx(""); > + } else { > + this.keeper = urlRegEx; > + } > + setText(keeper.getFilteredRegEx()); > + } > + > + @Override > + public void setText(String t) { > + if (keeper == null) { > + super.setText(""); > + } else { > + super.setText(keeper.getFilteredRegEx()); > + } > + } > + > + public static final class MyDateCellRenderer extends > DefaultTableCellRenderer { > + > + private final Date keeper; > + > + private MyDateCellRenderer(Date d) { > + this.keeper = d; > + setText(DateFormat.getInstance().format(d)); > + } > + > + @Override > + public void setText(String t) { > + if (keeper == null) { > + super.setText(""); > + } else { > + super.setText(DateFormat.getInstance().format(keeper)); > + } > + } > + } > + } > + > + private class SingleSelectionListenerImpl implements > ListSelectionListener { > + > + private final JTable table; > + > + public SingleSelectionListenerImpl(JTable table) { > + this.table = table; > + } > + > + @Override > + public void valueChanged(ListSelectionEvent e) { > + if (table.getSelectedRows().length == 1) { > + jButton7.setEnabled(true); > + jButton8.setEnabled(true); > + } else { > + jButton7.setEnabled(false); > + jButton8.setEnabled(false); > + } > + } > + } > +} > diff -r e631770d76ba > netx/net/sourceforge/jnlp/resources/Messages.properties > --- a/netx/net/sourceforge/jnlp/resources/Messages.properties Thu Jan > 31 11:12:35 2013 +0100 > +++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Fri Feb > 01 20:55:48 2013 +0100 > @@ -474,3 +474,57 @@ > SPLASHerrorInInformation = Error during loading of information > element, verify source rather > SPLASHmissingInformation = Information element is missing, verify > source rather > SPLASHchainWas = This is the list of exceptions that occurred > launching your applet. Please note, those exceptions can be from > multiple applets. For a good bug report, be sure to run only one applet. > + > +APPEXTSECappletSecurityLevelExtraHighId=Extra High Security IMO Extra High Security is better here as simply 'Disable Applets'. It is a bit odd to say you're securing Java by turning it off. > +APPEXTSECappletSecurityLevelVeryHighId=Very High Security > +APPEXTSECappletSecurityLevelHighId=High Security > +APPEXTSECappletSecurityLevelLowId=Low Security > +APPEXTSECappletSecurityLevelExtraHighExplanation=No applet will be run > +APPEXTSECappletSecurityLevelVeryHighExplanation=No unsigned applets > will be run > +APPEXTSECappletSecurityLevelHighExplanation=User will be prompted for > each unsigned applet > +APPEXTSECappletSecurityLevelLowExplanation=All, even untrusted, > applets will be run > +APPEXTSECunsignedAppletActionAlways=Always trust this applet(s) > +APPEXTSECunsignedAppletActionNever=Never trust this applet(s) > +APPEXTSECunsignedAppletActionYes=This applet was visited and allowed > +APPEXTSECunsignedAppletActionNo=This applet was visited and denied > +APPEXTSECControlPanelExtendedAppletSecurityTitle=Extended applet security > +APPEXTSECguiTableModelTableColumnAction=Action > +APPEXTSECguiTableModelTableColumnDateOfAction=Date of action > +APPEXTSECguiTableModelTableColumnDocumentBase=Document-base > +APPEXTSECguiTableModelTableColumnCodeBase=Code-base > +APPEXTSECguiTableModelTableColumnMainClass=Main class > +APPEXTSECguiTableModelTableColumnArchives=Archives > +APPEXTSECguiPanelAppletInfoHederPart1={0} {1} > +APPEXTSECguiPanelAppletInfoHederPart2={0} from {1} > +APPEXTSECguiPanelConfirmDeletionOf=Are you sure you want to delete > following {0} items > +APPEXTSECguiPanelHelpButton=Help > +APPEXTSECguiPanelSecurityLevel=Security Level > +APPEXTSECguiPanelGlobalBehaviourCaption=Settings of global behaviour > for applets > +APPEXTSECguiPanelDeleteMenuSelected=selected > +APPEXTSECguiPanelDeleteMenuAllA=all allowed (A) > +APPEXTSECguiPanelDeleteMenuAllN=all forbidden (N) > +APPEXTSECguiPanelDeleteMenuAlly=all approved (y) > +APPEXTSECguiPanelDeleteMenuAlln=all disaprooved (n) > +APPEXTSECguiPanelDeleteMenuAllAll=absolute all > +APPEXTSECguiPanelDeleteButton=Delete > +APPEXTSECguiPanelTestUrlButton=Test url > +APPEXTSECguiPanelAddRowButton=Add new row > +APPEXTSECguiPanelValidateTableButton=Validate table > +APPEXTSECguiPanelAskeforeActionBox=Ask me before action > +APPEXTSECguiPanelShowRegExesBox=Show full regular expressions > +APPEXTSECguiPanelInverSelection=Invert selection > +APPEXTSECguiPanelMoveRowUp=Move row up > +APPEXTSECguiPanelMoveRowDown=Move row down > +APPEXTSECguiPanelCustomDefs=Custom definitions > +APPEXTSECguiPanelGlobalDefs=Global definitions > +APPEXTSECguiPanelDocTest=Type document base URL > +APPEXTSECguiPanelCodeTest=Type code base URL > +APPEXTSECguiPanelNoMatch=Nothing matched > +APPEXTSECguiPanelMatchingNote=Please note, that only first matched > result will be considered as result. > +APPEXTSECguiPanelMatched=Matched > +APPEXTSECguiPanelMatchingError=Error during matching: {0} > +APPEXTSECguiPanelCanNotValidate=Can not validate, can not create tmp > file - {0} > +APPEXTSECguiPanelEmptyDoc=All document-bases must be full > +APPEXTSECguiPanelEmptyCode=All code-bases must be full > +APPEXTSECguiPanelTableValid=Table looks valid > +APPEXTSECguiPanelTableInvalid=Invalid with following error: {0} > \ No newline at end of file > diff -r e631770d76ba > netx/net/sourceforge/jnlp/util/lockingfile/LockingFile.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/jnlp/util/lockingfile/LockingFile.java Fri > Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,156 @@ > +/* > +Copyright (C) 2013 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.util.lockingfile; > + > +import java.nio.channels.FileChannel; > + > +import java.io.RandomAccessFile; > + > +import java.io.File; > +import java.io.IOException; > +import java.nio.channels.FileLock; > +import java.util.Map; > +import java.util.WeakHashMap; > +import java.util.concurrent.locks.ReentrantLock; > + > +/* > + * Process & thread locked access to a file. Creates file if it does > not already exist. > + */ > +public class LockingFile { > + > + // The file for access > + private RandomAccessFile randomAccessFile; > + private FileChannel fileChannel; > + private File file; > + > + // A file lock will protect against locks for multiple > + // processes, while a thread lock is still needed within a single > JVM. > + > + private FileLock processLock = null; > + private ReentrantLock threadLock = new ReentrantLock(); > + private boolean readOnly; > + > + private LockingFile(File file) { > + this.file = file; > + try{ > + //just try to ctreate > + this.file.createNewFile(); > + }catch(Exception ex){ > + //intentionaly silent > + } > + if (!this.file.isFile() && file.getParentFile()!=null && > !file.getParentFile().canWrite() ){ > + readOnly=true; > + } else{ > + this.readOnly = !file.canWrite(); > + if (!readOnly && file.getParentFile()!=null && > !file.getParentFile().canWrite()){ > + readOnly=true; > + } > + } > + } > + > + public boolean isReadOnly() { > + return readOnly; > + } > + > + > + > + // Provide shared access to LockedFile's via weak map > + static private final Map instanceCache = new > WeakHashMap(); > + > + /** > + * Get a LockingFile for a given File. > + * Ensures that we share the same instance for all threads > + * @param file the file to lock > + * @return a LockingFile instance > + */ > + synchronized public static LockingFile getInstance(File file) { > + if (!instanceCache.containsKey(file)) { > + instanceCache.put(file, new LockingFile(file)); > + } > + > + return instanceCache.get(file); > + } > + > + /** > + * Get the file being locked. > + * > + * @return the file > + */ > + public File getFile() { > + return file; > + } > + > + /** > + * Lock access to the file. Lock is reentrant. > + */ > + public void lock() throws IOException { > + // Create if does not already exist, cannot lock non-existing > file > + if (!readOnly){ > + this.file.createNewFile(); > + } > + > + this.threadLock.lock(); > + String rw="rws"; > + if (isReadOnly()){ > + rw="r"; > + } > + if (file.exists()){ > + this.randomAccessFile = new RandomAccessFile(this.file, rw); > + this.fileChannel = randomAccessFile.getChannel(); > + } > + > + if (!isReadOnly()) this.processLock = this.fileChannel.lock(); > + } > + > + /** > + * Unlock access to the file. Lock is reentrant. > + */ > + public void unlock() throws IOException { > + boolean releaseProcessLock = (this.threadLock.getHoldCount() > == 1); > + try { > + if (releaseProcessLock && this.processLock != null) { > + this.processLock.release(); > + this.randomAccessFile.close(); > + this.fileChannel.close(); > + } > + } finally { > + this.processLock = null; > + } > + this.threadLock.unlock(); > + } > +} > \ No newline at end of file > diff -r e631770d76ba > netx/net/sourceforge/jnlp/util/lockingfile/LockingReaderWriter.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/netx/net/sourceforge/jnlp/util/lockingfile/LockingReaderWriter.java > Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,201 @@ > +/* > +Copyright (C) 2013 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.util.lockingfile; > + > +import java.io.BufferedWriter; > + > +import java.io.BufferedReader; > +import java.io.File; > +import java.io.FileInputStream; > +import java.io.FileOutputStream; > +import java.io.IOException; > +import java.io.InputStreamReader; > +import java.io.OutputStreamWriter; > + > +/** > + * Process-locked string storage backed by a file. > + * Each string is stored on its own line. > + * Any new-lines must be encoded somehow if they are to be stored. > + */ > +public abstract class LockingReaderWriter { > + > + private LockingFile lockedFile; > + > + /** > + * Create locking file-backed storage. > + * @param file the storage file > + */ > + public LockingReaderWriter(File file) { > + this.lockedFile = LockingFile.getInstance(file); > + } > + > + /** > + * Get the underlying file. > + * Any access to this file should use lock() & unlock(). > + * > + * @return the file > + */ > + public File getBackingFile() { > + return this.lockedFile.getFile(); > + } > + > + public boolean isReadOnly() { > + return this.lockedFile.isReadOnly(); > + } > + > + /** > + * Lock the underlying storage. Lock is reentrant. > + */ > + public void lock() { > + try { > + lockedFile.lock(); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } > + } > + > + /** > + * Unlock the underlying storage. Lock is reentrant. > + */ > + public void unlock() { > + try { > + lockedFile.unlock(); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } > + } > + > + /** > + * Writes stored contents to file. Assumes lock is held. > + * @throws IOException > + */ > + protected void writeContents() throws IOException { > + if (!getBackingFile().isFile()){ > + return; > + } > + if (isReadOnly()){ > + return; > + } This silent failure is not acceptable IMO! It ignores the intent of the method completely, and it was causing me a lot of confusion when I was playing with the code. We ought to error-out here. > + BufferedWriter writer = null; > + try { > + writer = new BufferedWriter(new OutputStreamWriter( > + new FileOutputStream(getBackingFile()), "UTF-8")); > + writeContent(writer); > + writer.flush(); > + } finally { > + if (writer != null) { > + writer.close(); > + } > + } > + } > + > + protected abstract void writeContent(BufferedWriter writer) > throws IOException; > + > + /** > + * Reads contents from file. Assumes lock is held. > + * @throws IOException > + */ > + protected void readContents() throws IOException { > + if (!getBackingFile().isFile()){ > + return; > + } Same here, we shouldn't be backed by an invalid file in the first place. Note that I believe this will cause problems with how you are currently handling non-existant global configurations -- but that needs a more robust solution than this anyway. > + BufferedReader reader = null; > + try { > + reader = new BufferedReader(new InputStreamReader( > + new FileInputStream(getBackingFile()), "UTF-8")); > + > + while (true) { > + String line = reader.readLine(); > + if (line == null) { > + break; > + } > + readLine(line); > + } > + } finally { > + if (reader != null) { > + reader.close(); > + } > + } > + } > + > + /** > + * Reads contents from file. creating is lock . > + * @throws IOException > + */ > + protected synchronized void readContentsLocked() throws IOException { > + doLocked(new Runnable() { > + > + @Override > + public void run() { > + try { > + readContents(); > + } catch (IOException ex) { > + throw new StorageIoException(ex); > + } > + } > + }); > + } > + > + /** > + * Reads contents from file. creating is lock . > + * @throws IOException > + */ > + protected synchronized void writeContentsLocked() throws > IOException { > + doLocked(new Runnable() { > + > + public void run() { > + try { > + writeContents(); > + } catch (IOException ex) { > + throw new StorageIoException(ex); > + } > + } > + }); > + > + } > + > + protected void doLocked(Runnable r) { > + lock(); > + try { > + r.run(); > + } finally { > + unlock(); > + } > + } > + > + protected abstract void readLine(String line); > +} > diff -r e631770d76ba > netx/net/sourceforge/jnlp/util/lockingfile/StorageIoException.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/netx/net/sourceforge/jnlp/util/lockingfile/StorageIoException.java > Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,22 @@ > +package net.sourceforge.jnlp.util.lockingfile; > + > +/** > + * Thrown when an exception occurs using the storage (namely IOException) (May as well say 'occurs while using a LockingReaderWriter', seeing as this class is now coupled with it.) > + */ > +public class StorageIoException extends RuntimeException { > + > + LockingReaderWriter outer; > + > + public StorageIoException(Exception e) { > + super(e); > + } > + > + public StorageIoException(String e) { > + super(e); > + } > + > + public StorageIoException(Exception e, LockingReaderWriter outer) { > + super(e); > + this.outer = outer; > + } > +} > diff -r e631770d76ba > tests/netx/unit/net/sourceforge/appletextendedsecurity/impl/UnsignedAppletActionStorageImplTest.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/tests/netx/unit/net/sourceforge/appletextendedsecurity/impl/UnsignedAppletActionStorageImplTest.java > Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,97 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ > + > +package net.sourceforge.appletextendedsecurity.impl; > + > +import net.sourceforge.appletextendedsecurity.UnsignedAppletActionEntry; > +import java.io.File; > +import java.io.IOException; > +import java.util.Arrays; > +import net.sourceforge.jnlp.ServerAccess; > +import org.junit.Assert; > +import org.junit.BeforeClass; > +import org.junit.Test; > + > +public class UnsignedAppletActionStorageImplTest { > + > + private static File f1; > + private static File f2; > + private static File f3; > + private static File f4; > + > + @BeforeClass > + public static void preapreTestFiles() throws IOException { > + f1 = File.createTempFile("itwMatching", "testFile1"); > + f2 = File.createTempFile("itwMatching", "testFile2"); > + f3 = File.createTempFile("itwMatching", "testFile3"); > + f4 = File.createTempFile("itwMatching", "testFile4"); > + ServerAccess.saveFile("A 123456 .* .* main jar1;jar2", f1); > + ServerAccess.saveFile("A 123456 .* \\Qbla\\E main jar1;jar2", > f2); > + } > + > + @Test > + public void allMatchingDocAndCode() { > + UnsignedAppletActionStorageImpl i1 = new > UnsignedAppletActionStorageImpl(f1); > + UnsignedAppletActionEntry r1 = i1.getMatchingItem("bla", > "blaBla", "main", Arrays.asList(new String[]{"jar1", "jar2"})); > + Assert.assertNotNull("r1 should be found", r1); > + UnsignedAppletActionEntry r3 = i1.getMatchingItem("blah", > "blaBla", "main", Arrays.asList(new String[]{"jar2", "jar1"})); > + Assert.assertNotNull("r3 should be found", r1); > + UnsignedAppletActionEntry r2 = i1.getMatchingItem("bla", > "blaBlam", "wrong_main", Arrays.asList(new String[]{"jar1", "jar2"})); > + Assert.assertNull("r2 should NOT be found", r2); > + UnsignedAppletActionEntry r4 = i1.getMatchingItem("blha", > "blaBlam", "main", Arrays.asList(new String[]{"jar2", "wrong_jar"})); > + Assert.assertNull("r4 should NOT be found", r4); > + UnsignedAppletActionEntry r5 = i1.getMatchingItem("blaBla", > "blaBlaBla", "main", Arrays.asList(new String[]{"jar2"})); > + Assert.assertNull("r5 should NOT be found", r5); > + > + } > + > + @Test > + public void allMatchingDocAndStrictCode() { > + UnsignedAppletActionStorageImpl i1 = new > UnsignedAppletActionStorageImpl(f2); > + UnsignedAppletActionEntry r1 = i1.getMatchingItem("whatever", > "bla", "main", Arrays.asList(new String[]{"jar1", "jar2"})); > + Assert.assertNotNull("r1 should be found", r1); > + UnsignedAppletActionEntry r3 = i1.getMatchingItem("whatever", > null, "main", Arrays.asList(new String[]{"jar2", "jar1"})); > + Assert.assertNotNull("r3 should be found", r1); > + UnsignedAppletActionEntry r2 = i1.getMatchingItem("bla", > "blaBlam", "main", Arrays.asList(new String[]{"jar1", "jar2"})); > + Assert.assertNull("r2 should NOT be found", r2); > + UnsignedAppletActionEntry r4 = i1.getMatchingItem(null, > "blaBlam", null, null); > + Assert.assertNull("r4 should NOT be found", r4); > + > + } > + > + @Test > + public void allMatchingDocAndCodeWithNulls() { > + UnsignedAppletActionStorageImpl i1 = new > UnsignedAppletActionStorageImpl(f1); > + UnsignedAppletActionEntry r1 = i1.getMatchingItem("bla", > "blaBla", null, null); > + Assert.assertNotNull("r1 should be found", r1); > + UnsignedAppletActionEntry r3 = i1.getMatchingItem("bla", > "whatever", "", null); > + Assert.assertNotNull("r3 should be found", r1); > + UnsignedAppletActionEntry r2 = i1.getMatchingItem("bla", > "blaBla", null, Arrays.asList(new String[]{"jar2", "jar1"})); > + Assert.assertNotNull("r2 should be found", r2); > + UnsignedAppletActionEntry r4 = i1.getMatchingItem("bla", > "blaBla", "main", null); > + Assert.assertNotNull("r4 should be found", r4); > + UnsignedAppletActionEntry r5 = i1.getMatchingItem("", > "blaBla", "main", Arrays.asList(new String[]{"jar2", "jar1"})); > + Assert.assertNotNull("r5 should be found", r5); > + UnsignedAppletActionEntry r6 = i1.getMatchingItem(null, null, > "main", Arrays.asList(new String[]{"jar2", "jar1"})); > + Assert.assertNotNull("r6 should be found", r6); > + UnsignedAppletActionEntry r7 = i1.getMatchingItem(null, null, > "main", Arrays.asList(new String[]{"jar2", "jar11"})); > + Assert.assertNull("r7 should NOT be found", r7); > + > + > + } > +} > diff -r e631770d76ba > tests/netx/unit/net/sourceforge/jnlp/util/lockingfile/LockingStringListStorageTest.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/tests/netx/unit/net/sourceforge/jnlp/util/lockingfile/LockingStringListStorageTest.java > Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,385 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ > + > +package net.sourceforge.jnlp.util.lockingfile; > + > +import static org.junit.Assert.assertFalse; > +import static org.junit.Assert.assertTrue; > +import org.junit.Before; > +import java.io.BufferedWriter; > +import java.io.File; > +import java.io.IOException; > +import java.util.ArrayList; > +import java.util.List; > +import org.junit.Assert; > +import org.junit.Test; > + > + > + > +public class LockingStringListStorageTest { > + > +/** > + * Process-locked string storage backed by a file. > + * Each string is stored on its own line. > + * Any new-lines must be encoded somehow if they are to be stored. > + */ > +public static class LockingStringListStorage extends > LockingReaderWriter { > + > + private List cachedContents = new ArrayList(); > + > + //To sutisfy testengine, void constructor and dummy testmethod > + public LockingStringListStorage() throws IOException { > + this(createTmpBackend()); > + } > + > + @Test > + public void lockingStringListStorageCanBeInstantiated(){ > + Assert.assertNotNull(this); > + } > + > + > + private static File createTmpBackend() throws IOException{ > + File f = File.createTempFile("forTests","emptyConstructor"); > + f.deleteOnExit(); > + return f; > + } > + > + > + /** > + * Create locking file-backed storage. > + * @param file the storage file > + */ > + public LockingStringListStorage(File file) { > + super(file); > + } > + > + /** > + * Get the underlying string list cache. Should lock > + * before using. > + * @return the cache > + */ > + final protected List getCachedContents() { > + return cachedContents; > + } > + > + @Override > + public void writeContent(BufferedWriter writer) throws IOException { > + for (String string : cachedContents) { > + writer.write(string); > + writer.newLine(); > + } > + } > + > + @Override > + protected void readLine(String line) { > + this.cachedContents.add(line); > + } > + > + @Override > + protected void readContents() throws IOException { > + cachedContents.clear(); > + super.readContents(); > + } > + > + /* > + * Atomic container abstraction methods. These all allow the > file-backed > + * string list to be treated as a convenient in-memory object. > + */ > + /** > + * Appends the specified line to the end of the storage. > + * > + * @param line the line to add > + */ > + synchronized public void add(final String line) { > + doLocked(new Runnable() { > + > + public void run() { > + try { > + readContents(); > + cachedContents.add(line); > + writeContents(); > + } catch (IOException ex) { > + throw new StorageIoException(ex); > + } > + } > + }); > + } > + > + /** > + * Returns an array containing all of the lines in the storage. > + * > + * @return an array of the stored strings > + */ > + synchronized public String[] toArray() { > + lock(); > + try { > + readContents(); > + return cachedContents.toArray(new String[]{}); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } finally { > + unlock(); > + } > + } > + > + /** > + * Returns amount of lines in the storage. > + * > + * @return amount of stored strings > + */ > + synchronized public int size() { > + lock(); > + try { > + readContents(); > + return cachedContents.size(); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } finally { > + unlock(); > + } > + } > + > + /** > + * Returns 'i'th line > + * > + * @return the line > + */ > + synchronized public String get(int i) { > + lock(); > + try { > + readContents(); > + return cachedContents.get(i); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } finally { > + unlock(); > + } > + } > + > + /** > + * Set the 'i'th line > + * > + * @param line the new line > + */ > + synchronized public String set(int i, String line) { > + lock(); > + try { > + readContents(); > + return cachedContents.set(i, line); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } finally { > + unlock(); > + } > + } > + > + /** > + * Returns a copied list containing all of the lines in the storage. > + * > + * @return a list of the stored strings > + */ > + synchronized public List toList() { > + lock(); > + try { > + readContents(); > + return new ArrayList(cachedContents); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } finally { > + unlock(); > + } > + } > + > + /** > + * Returns true if the storage contains the specified > element. > + * > + * @param line > + * @return true if the storage contains the line > + */ > + synchronized public boolean contains(String line) { > + lock(); > + try { > + readContents(); > + return cachedContents.contains(line); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } finally { > + unlock(); > + } > + } > + > + /** > + * Empty the storage. > + */ > + synchronized public void clear() { > + lock(); > + try { > + cachedContents.clear(); > + writeContents(); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } finally { > + unlock(); > + } > + } > + > + /** > + * Removes the first occurrence of the specified element from > this list, > + * if it is present (optional operation). If this list does not > contain > + * the element, it is unchanged. > + * > + * @param line string to be removed from this list, if present > + * @return true if the storage contained the line > + */ > + synchronized public boolean remove(String line) { > + boolean didRemove; > + > + lock(); > + try { > + readContents(); > + didRemove = cachedContents.remove(line); > + writeContents(); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } finally { > + unlock(); > + } > + > + return didRemove; > + } > +} > + > + > + private static File storagefile; > + > + private static LockingStringListStorage newInstance() { > + return new LockingStringListStorage(storagefile); > + } > + > + @Before > + public void setUp() throws IOException { > + storagefile = File.createTempFile("foo", "bar"); > + } > + > + @Test > + public void testSimpleActions() throws IOException { > + LockingStringListStorage storage = newInstance(); > + > + storage.add("teststring"); > + assertTrue(storage.contains("teststring")); > + storage.remove("teststring"); > + assertFalse(storage.contains("teststring")); > + } > + > + @Test > + public void testInterleavedActions() throws IOException { > + LockingStringListStorage storage1 = newInstance(); > + LockingStringListStorage storage2 = newInstance(); > + > + storage1.add("teststring"); > + assertTrue(storage2.contains("teststring")); > + storage2.remove("teststring"); > + assertFalse(storage1.contains("teststring")); > + } > + > + static class TestThread extends Thread { > + String testString; > + int iterations; > + Throwable error = null; > + > + TestThread(String testString, int iterations) { > + this.testString = testString; > + this.iterations = iterations; > + } > + > + @Override > + public void run() { > + try { > + LockingStringListStorage storage = newInstance(); > + for (int i = 0; i < iterations; i++) { > + assertTrue(storage.contains(this.testString)); > + storage.add(this.testString); > + storage.remove(this.testString); > + assertTrue(storage.contains(this.testString)); > + } > + } catch (Throwable error) { > + error.printStackTrace(); > + this.error = error; > + } > + } > + } > + > + private void concurrentReadWrites(int threadAmount, int iterations, > + String testString) throws InterruptedException { > + LockingStringListStorage storage = newInstance(); > + > + storage.add(testString); > + > + List testThreads = new ArrayList(); > + > + for (int i = 0; i < threadAmount; i++) { > + TestThread thread = new TestThread(testString, iterations); > + testThreads.add(thread); > + thread.start(); > + } > + > + for (int i = 0; i < threadAmount; i++) { > + testThreads.get(i).join(); > + } > + > + assertTrue(storage.contains(testString)); > + storage.remove(testString); > + > + // So long as number adds == number writes, we should be left > with > + // nothing at end. > + assertFalse(storage.contains(testString)); > + } > + > + // Long testing string, the contents are not important > + private String makeLongTestString() { > + StringBuilder sb = new StringBuilder(); > + for (int i = 0; i < 1000; i++) { > + sb.append(Integer.toString(i)); > + } > + return sb.toString(); > + } > + > + @Test > + public void testManyReadWrite() throws Exception { > + int oneThread = 1; > + String shortString = "teststring"; > + > + // This was causing 'too many open files' because > FileUtils#getFileLock > + // leaks file descriptors. No longer used. > + concurrentReadWrites(oneThread, 500 /* iterations */, > + shortString); > + } > + > + @Test > + public void testManyThreads() throws Exception { > + int threadAmount = 25; > + String shortString = "teststring"; > + String longString = makeLongTestString(); > + > + concurrentReadWrites(threadAmount, 10 /* per-thread > iterations */, > + shortString); > + concurrentReadWrites(threadAmount, 2 /* per-thread iterations */, > + longString); > + } > + > +} In conclusion, nits are nits, but I really want to see this in HEAD :-)) Great work on the icedtea-web-settings parts. Happy hacking, -Adam -------------- next part -------------- A non-text attachment was scrubbed... Name: LockingReaderWriterTest.java Type: text/x-java Size: 7399 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130204/bab82ac8/LockingReaderWriterTest.java -------------- next part -------------- A non-text attachment was scrubbed... Name: LockingFile.java Type: text/x-java Size: 4538 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130204/bab82ac8/LockingFile.java From bugzilla-daemon at icedtea.classpath.org Mon Feb 4 12:25:50 2013 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 04 Feb 2013 20:25:50 +0000 Subject: [Bug 1296] New: [regression] Zero is broken in 6-1.12 Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1296 Bug ID: 1296 Summary: [regression] Zero is broken in 6-1.12 Classification: Unclassified Product: IcedTea Version: 6-1.12.0 Hardware: x86_64 OS: Linux Status: NEW Severity: major Priority: P3 Component: Zero Assignee: chphilli at redhat.com Reporter: doko at ubuntu.com CC: unassigned at icedtea.classpath.org Starting with 1.12.0, Zero builds are at least broken with a two stage bootstrap on all non-x86 architectures. https://buildd.debian.org/status/package.php?p=openjdk-6 builds terminating at the end of the stage1 hotspot build with: touch stamps/add-tzdata-support-ecj.stamp if [ -e /build/buildd-openjdk-6_6b27-1.12-1-powerpc-7Fy2nk/openjdk-6-6b27-1.12/build/openjdk.build-ecj/j2sdk-image/bin/java ] ; then \ /build/buildd-openjdk-6_6b27-1.12-1-powerpc-7Fy2nk/openjdk-6-6b27-1.12/build/openjdk.build-ecj/j2sdk-image/bin/java -Xshare:dump ; \ fi Loading classes to share ... # # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (os_linux_zero.cpp:270), pid=11031, tid=1075496080 # fatal error: caught unhandled signal 11 # # JRE version: 6.0_27-b27 # Java VM: OpenJDK Zero VM (20.0-b12 interpreted mode linux-ppc ) # Derivative: IcedTea6 1.12.0 # Distribution: Debian GNU/Linux 7.0 (wheezy), package 6b27-1.12-1 # An error report file with more information is saved as: # /build/buildd-openjdk-6_6b27-1.12-1-powerpc-7Fy2nk/openjdk-6-6b27-1.12/build/hs_err_pid11031.log # # If you would like to submit a bug report, please include # instructions how to reproduce the bug and visit: # http://icedtea.classpath.org/bugzilla # /bin/bash: line 2: 11031 Aborted /build/buildd-openjdk-6_6b27-1.12-1-powerpc-7Fy2nk/openjdk-6-6b27-1.12/build/openjdk.build-ecj/j2sdk-image/bin/java -Xshare:dump make[1]: *** [stamps/add-archive-ecj.stamp] Error 134 make[1]: Leaving directory `/build/buildd-openjdk-6_6b27-1.12-1-powerpc-7Fy2nk/openjdk-6-6b27-1.12/build' -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130204/af1d3afb/attachment.html From gitne at excite.co.jp Mon Feb 4 12:27:26 2013 From: gitne at excite.co.jp (=?ISO-2022-JP?B?SmFjb2IgV2lzb3I=?=) Date: Tue, 5 Feb 2013 05:27:26 +0900 Subject: =?ISO-2022-JP?B?UmVxdWVzdCBmb3IgcmV2aWV3IG9uIEdlcm1hbiBsb2NhbGl6YXRpb25zIGZvciBpY2VkdGVhLXdlYg==?= Message-ID: <201302042027.r14KRQVE005459@mail-web02.excite.co.jp> Hi! Please review the attached files. I have left the original English messages as comments for comparison and added my comments and/or questions where I was unsure. Regards, Jacob -------------- next part -------------- A non-text attachment was scrubbed... Name: Messages_de_AT.properties Type: application/octet-stream Size: 58664 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130205/464e3756/ISO-2022-JPBTWVzc2FnZXNfZGVfQVQucHJvcGVydGllcw.properties -------------- next part -------------- A non-text attachment was scrubbed... Name: Messages_de_CH.properties Type: application/octet-stream Size: 58664 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130205/464e3756/ISO-2022-JPBTWVzc2FnZXNfZGVfQ0gucHJvcGVydGllcw.properties -------------- next part -------------- A non-text attachment was scrubbed... Name: Messages_de_BE.properties Type: application/octet-stream Size: 58664 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130205/464e3756/ISO-2022-JPBTWVzc2FnZXNfZGVfQkUucHJvcGVydGllcw.properties -------------- next part -------------- A non-text attachment was scrubbed... Name: Messages_de_DE.properties Type: application/octet-stream Size: 58664 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130205/464e3756/ISO-2022-JPBTWVzc2FnZXNfZGVfREUucHJvcGVydGllcw.properties From adomurad at redhat.com Mon Feb 4 13:38:36 2013 From: adomurad at redhat.com (Adam Domurad) Date: Mon, 04 Feb 2013 16:38:36 -0500 Subject: [fyi][icedtea-web] backend and itw-settings for extended applets security In-Reply-To: <510FF7CA.5030001@redhat.com> References: <510E532C.8040401@redhat.com> <510FF7CA.5030001@redhat.com> Message-ID: <51102A5C.9020003@redhat.com> On 02/04/2013 01:02 PM, Adam Domurad wrote: > On 02/03/2013 07:08 AM, Jiri Vanek wrote: >> Whole troubles are described here >> http://icedtea.classpath.org/wiki/Extended_Applets_Security rather >> then in plain email. >> >> There is what me and adam have already achieved on this topic, what >> we have o achieve and where we are stil not so sure.... >> >> This patch is containing itw-settings part and backend for >> manipulating stored entries.and basic matching. >> I noted this just [fyi] because adam ave already walked through the >> patch, and so have I across his part. So the patch should be ready >> for push unless someone find something malicious on implementation or >> even on design. >> >> J. > > TYVM for writing out the wiki page. > > I'm allowed to comment right ? :-) > The table is looking quite nice. > > We can push as is and work from head perhaps ? Needs ChangeLog, though. > > I have attached a preferred iteration of my test. > I have attached a preferred refactoring of LockingFile :-) > >> diff -r e631770d76ba >> netx/net/sourceforge/appletextendedsecurity/AppletExtendedSecurity.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ >> b/netx/net/sourceforge/appletextendedsecurity/AppletExtendedSecurity.java >> Fri Feb 01 20:55:48 2013 +0100 >> @@ -0,0 +1,84 @@ >> +/* >> +Copyright (C) 2013 Red Hat >> + >> +This program 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 of the License, or >> +(at your option) any later version. >> + >> +This program 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 this program; if not, write to the Free Software >> +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA >> +*/ >> + >> +package net.sourceforge.appletextendedsecurity; >> + >> +import javax.naming.ConfigurationException; >> +import >> net.sourceforge.appletextendedsecurity.impl.UnsignedAppletActionStorageImpl; >> +import net.sourceforge.jnlp.config.DeploymentConfiguration; >> +import net.sourceforge.jnlp.runtime.JNLPRuntime; >> + >> + >> +public class AppletExtendedSecurity { >> + >> + private static UnsignedAppletActionStorageImpl globalInstance; >> + private static UnsignedAppletActionStorageImpl customInstance; >> + >> + /** >> + * >> + * @return storage with global items from /etc/ >> + */ >> + >> + public static UnsignedAppletActionStorage >> getUnsignedAppletActionGlobalStorage(){ >> + if (globalInstance == null){ >> + globalInstance = new >> UnsignedAppletActionStorageImpl(DeploymentConfiguration.getAppletTrustGlobalSettingsPath()); >> + } >> + return globalInstance; >> + } >> + >> + >> + /** >> + * >> + * @return storage with custom items from /home/ >> + */ >> + public static UnsignedAppletActionStorage >> getUnsignedAppletActionCustomStorage(){ >> + if (customInstance == null){ >> + customInstance = new >> UnsignedAppletActionStorageImpl(DeploymentConfiguration.getAppletTrustCustomSettingsPath()); >> + } >> + return customInstance; >> + } >> + >> + public static AppletSecurityLevel getDefaultSecurityLevel(){ >> + return AppletSecurityLevel.getDefault(); >> + } >> + >> + /** >> + * >> + * @return user-set seurity level or default one if user-set do >> not exists >> + */ >> + public static AppletSecurityLevel getCustomSecurityLevel(){ >> + DeploymentConfiguration conf = JNLPRuntime.getConfiguration(); >> + if (conf==null){ >> + conf = new DeploymentConfiguration(); >> + try { >> + conf.load(); >> + } catch (ConfigurationException ex){ >> + ex.printStackTrace(); >> + return getDefaultSecurityLevel(); >> + } >> + } >> + String s = >> conf.getProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL); >> + if (s==null) { >> + return getDefaultSecurityLevel(); >> + } >> + return AppletSecurityLevel.fromString(s); >> + } >> + >> + >> + >> +} >> diff -r e631770d76ba >> netx/net/sourceforge/appletextendedsecurity/AppletSecurityLevel.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ >> b/netx/net/sourceforge/appletextendedsecurity/AppletSecurityLevel.java Fri >> Feb 01 20:55:48 2013 +0100 >> @@ -0,0 +1,83 @@ >> +/* >> +Copyright (C) 2013 Red Hat >> + >> +This program 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 of the License, or >> +(at your option) any later version. >> + >> +This program 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 this program; if not, write to the Free Software >> +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA >> +*/ >> + >> +package net.sourceforge.appletextendedsecurity; >> + >> +import net.sourceforge.jnlp.runtime.Translator; >> + >> +public enum AppletSecurityLevel { >> + >> + DENY_ALL, DENY_UNSIGNED, ASK_UNSIGNED, ALLOW_UNSIGNED; >> + >> + public static String allToString() { >> + return DENY_ALL.toChars()+" "+DENY_UNSIGNED.toChars()+" >> "+ASK_UNSIGNED.toChars()+" "+ALLOW_UNSIGNED.toChars(); >> + } >> + >> + >> + >> + public String toChars() { >> + switch (this) { >> + case DENY_ALL: >> + return " DENY_ALL"; >> + case DENY_UNSIGNED: >> + return "DENY_UNSIGNED"; >> + case ASK_UNSIGNED: >> + return "ASK_UNSIGNED"; >> + case ALLOW_UNSIGNED: >> + return "ALLOW_UNSIGNED"; >> + } >> + throw new RuntimeException("Unknown AppletSecurityLevel"); >> + } >> + >> + public String toExplanation() { >> + switch (this) { >> + case DENY_ALL: >> + return >> Translator.R("APPEXTSECappletSecurityLevelExtraHighId")+" - >> "+Translator.R("APPEXTSECappletSecurityLevelExtraHighExplanation"); >> + case DENY_UNSIGNED: >> + return >> Translator.R("APPEXTSECappletSecurityLevelVeryHighId")+" - >> "+Translator.R("APPEXTSECappletSecurityLevelVeryHighExplanation"); >> + case ASK_UNSIGNED: >> + return >> Translator.R("APPEXTSECappletSecurityLevelHighId")+" - >> "+Translator.R("APPEXTSECappletSecurityLevelHighExplanation"); >> + case ALLOW_UNSIGNED: >> + return >> Translator.R("APPEXTSECappletSecurityLevelLowId")+" - >> "+Translator.R("APPEXTSECappletSecurityLevelLowExplanation"); >> + } >> + throw new RuntimeException("Unknown AppletSecurityLevel"); >> + } >> + >> + public static AppletSecurityLevel fromString(String s) { >> + if (s.trim().equalsIgnoreCase("DENY_ALL")) { >> + return AppletSecurityLevel.DENY_ALL; >> + } else if (s.trim().equalsIgnoreCase("DENY_UNSIGNED")) { >> + return AppletSecurityLevel.DENY_UNSIGNED; >> + } else if (s.trim().equalsIgnoreCase("ASK_UNSIGNED")) { >> + return AppletSecurityLevel.ASK_UNSIGNED; >> + } else if (s.trim().equalsIgnoreCase("ALLOW_UNSIGNED")) { >> + return AppletSecurityLevel.ALLOW_UNSIGNED; >> + } else { >> + throw new RuntimeException("Unknown AppletSecurityLevel >> for " + s); >> + } >> + } >> + >> + @Override >> + public String toString() { >> + return toExplanation(); >> + } >> + >> + public static AppletSecurityLevel getDefault(){ >> + return ASK_UNSIGNED; >> + } >> +} >> diff -r e631770d76ba >> netx/net/sourceforge/appletextendedsecurity/UnsignedAppletAction.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ >> b/netx/net/sourceforge/appletextendedsecurity/UnsignedAppletAction.java >> Fri Feb 01 20:55:48 2013 +0100 >> @@ -0,0 +1,73 @@ >> +/* >> +Copyright (C) 2013 Red Hat >> + >> +This program 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 of the License, or >> +(at your option) any later version. >> + >> +This program 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 this program; if not, write to the Free Software >> +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA >> +*/ >> + >> +package net.sourceforge.appletextendedsecurity; >> + >> +import net.sourceforge.jnlp.runtime.Translator; >> + >> +public enum UnsignedAppletAction { >> + >> + ALWAYS, NEVER, YES, NO; >> + >> + public String toChar() { >> + switch (this) { >> + case ALWAYS: >> + return "A"; >> + case NEVER: >> + return "N"; >> + case YES: >> + return "y"; >> + case NO: >> + return "n"; > > I don't know anymore if storing yes/no is worth the added confusion of > displaying them as options in icedtea-web settings (4 options for what > to do with an applet -- 2 of them still requiring confirmation ??) > >> + } >> + throw new RuntimeException("Unknown UnsignedAppletAction"); >> + } >> + >> + public String toExplanation() { >> + switch (this) { >> + case ALWAYS: >> + return >> Translator.R("APPEXTSECunsignedAppletActionAlways"); >> + case NEVER: >> + return >> Translator.R("APPEXTSECunsignedAppletActionNever"); >> + case YES: >> + return >> Translator.R("APPEXTSECunsignedAppletActionYes"); >> + case NO: >> + return Translator.R("APPEXTSECunsignedAppletActionNo"); >> + } >> + throw new RuntimeException("Unknown UnsignedAppletAction"); >> + } >> + >> + public static UnsignedAppletAction fromString(String s) { >> + if (s.startsWith("A")) { >> + return UnsignedAppletAction.ALWAYS; >> + } else if (s.startsWith("N")) { >> + return UnsignedAppletAction.NEVER; >> + } else if (s.startsWith("y")) { >> + return UnsignedAppletAction.YES; >> + } else if (s.startsWith("n")) { >> + return UnsignedAppletAction.NO; >> + } else { >> + throw new RuntimeException("Unknown UnsignedAppletAction >> for " + s); >> + } >> + } >> + >> + @Override >> + public String toString() { >> + return toChar() + " - " + toExplanation(); > > Drop this toChar() IMO. > >> + } >> +} >> diff -r e631770d76ba >> netx/net/sourceforge/appletextendedsecurity/UnsignedAppletActionEntry.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ >> b/netx/net/sourceforge/appletextendedsecurity/UnsignedAppletActionEntry.java >> Fri Feb 01 20:55:48 2013 +0100 >> @@ -0,0 +1,169 @@ >> +/* >> +Copyright (C) 2013 Red Hat >> + >> +This program 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 of the License, or >> +(at your option) any later version. >> + >> +This program 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 this program; if not, write to the Free Software >> +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA >> +*/ >> +package net.sourceforge.appletextendedsecurity; >> + >> +import java.io.IOException; >> +import java.io.Writer; >> +import java.util.ArrayList; >> +import java.util.Date; >> +import java.util.List; >> + >> +public class UnsignedAppletActionEntry { >> + >> + >> + >> + private UnsignedAppletAction unsignedAppletAction; >> + private Date timeStamp; >> + private UrlRegEx documentBase; >> + private UrlRegEx codeBase; >> + private String mainClass; >> + private List archives; >> + >> + >> + public static UnsignedAppletActionEntry createFromString(String >> s) { >> + String[] split = s.split("\\s+"); >> + UnsignedAppletActionEntry nw = new UnsignedAppletActionEntry( >> + UnsignedAppletAction.fromString(split[0]), >> + new Date(new Long(split[1])), >> + new UrlRegEx(split[2]), >> + null, >> + null, >> + null >> + ); >> + if (split.length>3){ >> + nw.setCodeBase(new UrlRegEx(split[3])); >> + } > > Please space this out eg 'if (split.length > 3)' > >> + if (split.length>4){ >> + nw.setMainClass(split[4]); >> + } >> + if (split.length>5){ >> + >> nw.setArchives(createArchivesList(s.substring(s.indexOf(split[4])+split[4].length()).trim())); >> + } >> + return nw; >> + } >> + >> + public UnsignedAppletActionEntry(UnsignedAppletAction >> unsignedAppletAction, Date timeStamp, UrlRegEx documentBase, UrlRegEx >> codeBase, String mainClass, List archives) { >> + this.unsignedAppletAction = unsignedAppletAction; >> + this.timeStamp = timeStamp; >> + this.documentBase = documentBase; >> + this.codeBase = codeBase; >> + this.mainClass = mainClass; >> + this.archives = archives; >> + >> + } >> + >> + >> + >> + @Override >> + public String toString() { >> + return unsignedAppletAction.toChar() + >> + " " + ((timeStamp == null)?"1":timeStamp.getTime()) + >> + " " + ((documentBase == >> null)?"":documentBase.getRegEx()) + >> + " " + ((codeBase == null)?"":codeBase.getRegEx()) + >> + " " + ((mainClass == null)?"":mainClass) + >> + " " + createArchivesString(archives); > > Space this out too. I don't understand though why documentBase or > codeBase would ever be null -- isn't a UrlRegEx of '.*' more > appropriate ? > >> + >> + } >> + >> + public void write(Writer bw) throws IOException { >> + bw.write(this.toString()); >> + } >> + >> + public Date getTimeStamp() { >> + return timeStamp; >> + } >> + >> + public UrlRegEx getDocumentBase() { >> + return documentBase; >> + } >> + >> + public void setTimeStamp(Date timeStamp) { >> + this.timeStamp = timeStamp; >> + } >> + >> + public void setDocumentBase(UrlRegEx documentBase) { >> + this.documentBase = documentBase; >> + } >> + >> + public UnsignedAppletAction getUnsignedAppletAction() { >> + return unsignedAppletAction; >> + } >> + >> + public void setUnsignedAppletAction(UnsignedAppletAction >> unsignedAppletAction) { >> + this.unsignedAppletAction = unsignedAppletAction; >> + } >> + >> + public UrlRegEx getCodeBase() { >> + return codeBase; >> + } >> + >> + public void setCodeBase(UrlRegEx codeBase) { >> + this.codeBase = codeBase; >> + } >> + >> + public String getMainClass() { >> + return mainClass; >> + } >> + >> + public void setMainClass(String mainClass) { >> + this.mainClass = mainClass; >> + } >> + >> + public List getArchives() { >> + return archives; >> + } >> + >> + public void setArchives(List archives) { >> + this.archives = archives; >> + } >> + >> + public static String createArchivesString(List >> listOfArchives) { >> + if (listOfArchives == null){ >> + return ""; >> + } >> + StringBuilder sb = new StringBuilder(); >> + for (int i = 0; i < listOfArchives.size(); i++) { >> + String string = listOfArchives.get(i); >> + if (string.trim().isEmpty()){ >> + continue; >> + } >> + sb.append(string).append(";"); >> + } >> + return sb.toString(); >> + } >> + public static List createArchivesList(String >> semicolonedArchives) { >> + if (semicolonedArchives == null) return null; >> + if (semicolonedArchives.trim().isEmpty()) return null; >> + String[] items = semicolonedArchives.trim().split(";"); >> + List r = new ArrayList(items.length); >> + for (int i = 0; i < items.length; i++) { >> + String string = items[i]; >> + if (string.trim().isEmpty()){ >> + continue; >> + } >> + r.add(string); >> + >> + } >> + return r; >> + >> + } >> + >> + >> + >> + >> +} >> diff -r e631770d76ba >> netx/net/sourceforge/appletextendedsecurity/UnsignedAppletActionStorage.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ >> b/netx/net/sourceforge/appletextendedsecurity/UnsignedAppletActionStorage.java >> Fri Feb 01 20:55:48 2013 +0100 >> @@ -0,0 +1,106 @@ >> +/* >> +Copyright (C) 2013 Red Hat >> + >> +This program 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 of the License, or >> +(at your option) any later version. >> + >> +This program 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 this program; if not, write to the Free Software >> +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA >> +*//* >> +Copyright (C) 2013 Red Hat >> + >> +This program 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 of the License, or >> +(at your option) any later version. >> + >> +This program 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 this program; if not, write to the Free Software >> +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA >> +*/ >> +package net.sourceforge.appletextendedsecurity; >> + >> +import java.util.List; >> + >> +/** >> + * >> + * @author jvanek > > Are we allowing authors now ? :-) > >> + */ >> +public interface UnsignedAppletActionStorage { >> + >> + >> + /** >> + * This methods iterates through record in >> DeploymentConfiguration.getAppletTrustSettingsPath(), >> + * and is mathing regexes saved here against params. so >> parameters here are NOR tegexes, >> + * but are matched against saved regexes >> + * >> + * Null or empty values are dangerously ignored, user, be aware >> of it. >> + * eg: >> + * match only codeBase will be null someCodeBase null null >> + * match only documentBase will be someDocBase null null null >> + * match only applet not regarding code or document base will be >> null null mainClas archives >> + * @param documentBase >> + * @param codeBase >> + * @param mainClass >> + * @param archives >> + * @return >> + */ >> + public UnsignedAppletActionEntry getMatchingItem(String >> documentBase, String codeBase, String mainClass, List archives); >> + /** >> + * Shortcut getMatchingItem(documentBase, null,null,null) >> + * @param documentBase >> + * @return >> + */ >> + public UnsignedAppletActionEntry >> getMatchingItemByDocumentBase(String documentBase); >> + /** >> + * Shortcut getMatchingItem(null, codeBase,null,null) >> + * @param codeBase >> + * @return >> + */ >> + public UnsignedAppletActionEntry >> getMatchingItemByCodeBase(String codeBase); >> + /** >> + * Shortcut getMatchingItem(documentBase, codeBase,null,null) >> + * @param documentBase >> + * @param codeBase >> + * @return >> + */ >> + public UnsignedAppletActionEntry getMatchingItemByBases(String >> documentBase, String codeBase); >> + >> + /** >> + * Will add new record. Note that regexes are stored for bases >> matching. >> + * >> + * eg UnsignedAppletActionEntry which will dany some applet no >> metter of page will be >> + * new UnsignedAppletActionEntry(UnsignedAppletAction.NEVER, new >> Date(), null, null, someMain, someArchives) >> + * >> + * eg UnsignedAppletActionEntry which will allow all applets on >> page with same codebase will be >> + * new UnsignedAppletActionEntry(UnsignedAppletAction.NEVER, new >> Date(), ".*", ".*", null, null); >> + * >> + * @param item >> + */ >> + public void add(final UnsignedAppletActionEntry item); >> + >> + /** >> + * Will replace (current impl is matching by object's hashcode >> + * This is not reloading the list(but still saving after), so >> StorageIoEception >> + * can be thrown if it was not loaded before. >> + * >> + * Imho this should be used only to actualise timestamps or >> change UnsignedAppletAction >> + * @param item >> + */ >> + public void update(final UnsignedAppletActionEntry item); >> + >> + >> +} >> diff -r e631770d76ba >> netx/net/sourceforge/appletextendedsecurity/UrlRegEx.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/netx/net/sourceforge/appletextendedsecurity/UrlRegEx.java Fri >> Feb 01 20:55:48 2013 +0100 >> @@ -0,0 +1,47 @@ >> +/* >> +Copyright (C) 2013 Red Hat >> + >> +This program 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 of the License, or >> +(at your option) any later version. >> + >> +This program 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 this program; if not, write to the Free Software >> +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA >> +*/ >> + >> +package net.sourceforge.appletextendedsecurity; >> + >> +public class UrlRegEx { >> + >> + String regEx; >> + //cache pattern during each set and init? >> + //Pattern p > > Drop this comment before pushing (implementation is fine as-is). > >> + >> + public UrlRegEx(String s) { >> + regEx = s; >> + } >> + >> + @Override >> + public String toString() { >> + return getRegEx(); >> + } >> + >> + public String getRegEx() { >> + return regEx; >> + } >> + >> + public String getFilteredRegEx() { >> + return regEx.replaceAll("\\\\Q", "").replaceAll("\\\\E", ""); >> + } >> + >> + public void setRegEx(String regEx) { >> + this.regEx = regEx; >> + } >> +} >> diff -r e631770d76ba >> netx/net/sourceforge/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ >> b/netx/net/sourceforge/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java >> Fri Feb 01 20:55:48 2013 +0100 >> @@ -0,0 +1,220 @@ >> +/* >> +Copyright (C) 2013 Red Hat >> + >> +This program 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 of the License, or >> +(at your option) any later version. >> + >> +This program 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 this program; if not, write to the Free Software >> +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA >> +*/ >> + >> +package net.sourceforge.appletextendedsecurity.impl; >> + >> +import java.io.BufferedWriter; >> +import java.io.File; >> +import java.io.IOException; >> +import java.util.ArrayList; >> +import java.util.Collections; >> +import java.util.List; >> +import >> net.sourceforge.appletextendedsecurity.UnsignedAppletActionEntry; >> +import >> net.sourceforge.appletextendedsecurity.UnsignedAppletActionStorage; >> +import net.sourceforge.jnlp.util.lockingfile.LockingReaderWriter; >> +import net.sourceforge.jnlp.util.lockingfile.StorageIoException; >> + >> +public class UnsignedAppletActionStorageImpl extends >> LockingReaderWriter implements UnsignedAppletActionStorage{ >> + >> + protected List items; >> + >> + public UnsignedAppletActionStorageImpl(String location) { >> + this(new File(location)); >> + } >> + >> + public UnsignedAppletActionStorageImpl(File location) { >> + super(location); >> + } >> + >> + @Override >> + public void writeContents() throws IOException { >> + super.writeContents(); >> + } >> + >> + @Override >> + public synchronized void writeContentsLocked() throws IOException { >> + super.writeContentsLocked(); >> + } >> + >> + >> + >> + >> + >> + @Override >> + protected void readContents() throws IOException { >> + if (items == null) { >> + items = new ArrayList(); >> + } else { >> + items.clear(); >> + } >> + super.readContents(); >> + } >> + >> + @Override >> + protected void readLine(String line) { >> + if (line.trim().length() != 0) { >> + this.items.add(UnsignedAppletActionEntry.createFromString(line)); >> + } >> + } >> + >> + @Override >> + public void writeContent(BufferedWriter bw) throws IOException { >> + for (UnsignedAppletActionEntry item : items) { >> + item.write(bw); >> + bw.newLine(); >> + } >> + } >> + >> + @Override >> + public void add(final UnsignedAppletActionEntry item) { >> + doLocked(new Runnable() { >> + >> + @Override >> + public void run() { >> + try { >> + readContents(); >> + items.add(item); >> + writeContents(); >> + } catch (IOException ex) { >> + throw new StorageIoException(ex); >> + } >> + } >> + }); >> + } >> + >> + >> + @Override >> + public void update(final UnsignedAppletActionEntry item) { >> + doLocked(new Runnable() { >> + >> + @Override >> + public void run() { >> + try { >> + if (items == null){ >> + throw new StorageIoException("Storage is not >> initialised, can not update"); >> + } >> + if (!items.contains(item)){ >> + throw new StorageIoException("Storage do not >> contains item you are updateing. can not update"); >> + } >> + writeContents(); >> + } catch (IOException ex) { >> + throw new StorageIoException(ex); >> + } >> + } >> + }); >> + } >> + >> + >> + >> + @Override >> + public UnsignedAppletActionEntry getMatchingItem(String >> documentBase, String codeBase, String mainClass, List >> archives) { >> + List result = >> getMatchingItems(documentBase, codeBase, mainClass, archives); >> + if (result == null || result.isEmpty()) { >> + return null; >> + } >> + //returns first item >> + return result.get(0); >> + //Or longest match?? >> + } >> + >> + public List getMatchingItems(String >> documentBase, String codeBase, String mainClass, List >> archives ) { >> + List result = new ArrayList(); >> + lock(); >> + try { >> + readContents(); >> + if (items == null) { >> + return result; >> + } >> + for (UnsignedAppletActionEntry unsignedAppletActionEntry >> : items) { >> + if >> (isMatching(unsignedAppletActionEntry,documentBase,codeBase,mainClass,archives)){ >> + result.add(unsignedAppletActionEntry); >> + } >> + } >> + return null; >> + } catch (IOException e) { >> + throw new StorageIoException(e); >> + } finally { >> + unlock(); >> + return result; >> + } >> + } >> + >> + private boolean isMatching(UnsignedAppletActionEntry >> unsignedAppletActionEntry, String documentBase, String codeBase, >> String mainClass, List archives) { >> + boolean result = true; >> + if (documentBase != null && !documentBase.trim().isEmpty()) { >> + result = result && >> documentBase.matches(unsignedAppletActionEntry.getDocumentBase().getRegEx()); >> + } >> + if (codeBase != null && !codeBase.trim().isEmpty()) { >> + result = result && >> codeBase.matches(unsignedAppletActionEntry.getCodeBase().getRegEx()); >> + } >> + if (mainClass != null && !mainClass.trim().isEmpty()) { >> + result = result && >> mainClass.equals(unsignedAppletActionEntry.getMainClass()); >> + } >> + >> + if (archives != null) { >> + result = result && comapreArchives(archives, >> unsignedAppletActionEntry.getArchives()); >> + } >> + return result; >> + } >> + >> + @Override >> + public String toString() { >> + return getBackingFile()+" "+super.toString(); >> + } >> + >> + private boolean comapreArchives(List archives, >> List saved) { >> + if (archives.size()!=saved.size()) return false; >> + Collections.sort(archives); >> + Collections.sort(saved); >> + for (int i = 0; i < saved.size(); i++) { >> + String string1 = saved.get(i); >> + String string2 = archives.get(i); >> + //intentional reference compare >> + if (string1==string2) { >> + continue; >> + } >> + if (string1 == null || string2 == null){ >> + return false; >> + } >> + if (string1.trim().equals(string2.trim())){ >> + continue; >> + } >> + return false; >> + } >> + return true; >> + } >> + >> + @Override >> + public UnsignedAppletActionEntry >> getMatchingItemByDocumentBase(String documentBase) { >> + return getMatchingItem(documentBase, null, null, null); >> + } >> + >> + @Override >> + public UnsignedAppletActionEntry >> getMatchingItemByCodeBase(String codeBase) { >> + return getMatchingItem(null, codeBase, null, null); >> + } >> + >> + @Override >> + public UnsignedAppletActionEntry getMatchingItemByBases(String >> documentBase, String codeBase) { >> + return getMatchingItem(documentBase, codeBase, null, null); >> + } >> + >> + >> + >> + >> +} >> diff -r e631770d76ba >> netx/net/sourceforge/appletextendedsecurity/impl/UnsignedAppletActionStorageOperator.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ >> b/netx/net/sourceforge/appletextendedsecurity/impl/UnsignedAppletActionStorageOperator.java >> Fri Feb 01 20:55:48 2013 +0100 >> @@ -0,0 +1,180 @@ >> +/* >> +Copyright (C) 2013 Red Hat >> + >> +This program 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 of the License, or >> +(at your option) any later version. >> + >> +This program 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 this program; if not, write to the Free Software >> +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA >> +*/ >> + >> +package net.sourceforge.appletextendedsecurity.impl; >> + >> +import java.io.File; >> +import java.io.IOException; >> +import java.util.Date; >> +import net.sourceforge.appletextendedsecurity.UnsignedAppletAction; >> +import >> net.sourceforge.appletextendedsecurity.UnsignedAppletActionEntry; >> +import net.sourceforge.appletextendedsecurity.UrlRegEx; >> +import net.sourceforge.jnlp.util.lockingfile.StorageIoException; >> + >> +public class UnsignedAppletActionStorageOperator extends >> UnsignedAppletActionStorageImpl { >> + >> + >> + public UnsignedAppletActionStorageOperator(String location) { >> + this(new File(location)); >> + } >> + >> + public UnsignedAppletActionStorageOperator(File location) { >> + super(location); >> + } >> + >> + public UnsignedAppletActionEntry[] toArray() { >> + lock(); >> + try { >> + readContents(); >> + return items.toArray(new >> UnsignedAppletActionEntry[items.size()]); >> + } catch (IOException e) { >> + throw new StorageIoException(e); >> + } finally { >> + unlock(); >> + } >> + } >> + >> + public void clear() { >> + doLocked(new Runnable() { >> + >> + public void run() { >> + try { >> + items.clear(); >> + writeContents(); >> + } catch (IOException e) { >> + throw new StorageIoException(e); >> + } >> + } >> + }); >> + } >> + >> + public void removeByBehaviour(final UnsignedAppletAction >> unsignedAppletAction) { >> + doLocked(new Runnable() { >> + >> + public void run() { >> + try { >> + readContents(); >> + for (int i = 0; i < items.size(); i++) { >> + UnsignedAppletActionEntry >> unsignedAppletActionEntry = items.get(i); >> + if >> (unsignedAppletActionEntry.getUnsignedAppletAction() == >> unsignedAppletAction) { >> + items.remove(i); >> + i--; >> + } >> + >> + } >> + writeContents(); >> + } catch (IOException e) { >> + throw new StorageIoException(e); >> + } >> + } >> + }); >> + } >> + >> + private void swap(final int i, final int ii) { >> + doLocked(new Runnable() { >> + >> + public void run() { >> + try { >> + readContents(); >> + UnsignedAppletActionEntry backup = items.get(i); >> + items.set(i, items.get(ii)); >> + items.set(ii, backup); >> + writeContents(); >> + } catch (IOException e) { >> + throw new StorageIoException(e); >> + } >> + } >> + }); >> + >> + } >> + >> + public void moveUp(int selectedRow) { >> + if (selectedRow <= 0) { >> + return; >> + } >> + swap(selectedRow, selectedRow - 1); >> + } >> + >> + public void moveDown(int selectedRow) { >> + if (selectedRow >= items.size() - 1) { >> + return; >> + } >> + swap(selectedRow, selectedRow + 1); >> + } >> + >> + public void remove(final int item) { >> + doLocked(new Runnable() { >> + >> + public void run() { >> + try { >> + readContents(); >> + items.remove(item); >> + writeContents(); >> + } catch (IOException ex) { >> + throw new StorageIoException(ex); >> + } >> + } >> + }); >> + } >> + >> + public void modify(final UnsignedAppletActionEntry source, final >> int columnIndex, final Object aValue) { >> + Runnable r = new Runnable() { >> + >> + public void run() { >> + >> + try { >> + if (!items.contains(source)){ >> + throw new StorageIoException("Item to be >> modified not found in storage"); >> + } >> + >> + if (columnIndex == 0) { >> + source.setUnsignedAppletAction((UnsignedAppletAction) aValue); >> + } >> + if (columnIndex == 1) { >> + source.setTimeStamp((Date) aValue); >> + } >> + if (columnIndex == 2) { >> + source.setDocumentBase(new UrlRegEx((String) >> aValue)); >> + } >> + if (columnIndex == 3) { >> + source.setCodeBase(new UrlRegEx((String) >> aValue)); >> + } >> + if (columnIndex == 4) { >> + source.setMainClass((String) aValue); >> + } >> + if (columnIndex == 5) { >> + >> source.setArchives(UnsignedAppletActionEntry.createArchivesList((String) >> aValue)); >> + } >> + >> + writeContents(); >> + } catch (IOException ex) { >> + throw new StorageIoException(ex); >> + } >> + } >> + }; >> + doLocked(r); >> + >> + } >> + >> + @Override >> + public synchronized void writeContentsLocked() throws IOException { >> + super.writeContentsLocked(); >> + } >> + >> + >> +} >> diff -r e631770d76ba netx/net/sourceforge/jnlp/config/Defaults.java >> --- a/netx/net/sourceforge/jnlp/config/Defaults.java Thu Jan 31 >> 11:12:35 2013 +0100 >> +++ b/netx/net/sourceforge/jnlp/config/Defaults.java Fri Feb 01 >> 20:55:48 2013 +0100 >> @@ -42,6 +42,7 @@ >> import java.io.File; >> import java.util.HashMap; >> import java.util.Map; >> +import net.sourceforge.appletextendedsecurity.AppletSecurityLevel; >> >> import net.sourceforge.jnlp.ShortcutDesc; >> import net.sourceforge.jnlp.runtime.JNLPProxySelector; >> @@ -384,6 +385,41 @@ >> DeploymentConfiguration.KEY_PLUGIN_JVM_ARGUMENTS, >> null, >> null >> + }, >> + //unsigned applet security level >> + { > > Why are you not just using a set of strings with a string validator ? > I do not like the idea of having an anonymous class here. > >> + DeploymentConfiguration.KEY_SECURITY_LEVEL, >> + new ValueValidator() { >> + >> + @Override >> + public void validate(Object value) throws >> IllegalArgumentException { >> + if (value == null) { >> + throw new >> IllegalArgumentException("Value can't be null"); >> + } >> + if (value instanceof AppletSecurityLevel) { >> + //?? >> + return; >> + } >> + if (!(value instanceof String)) { >> + throw new >> IllegalArgumentException("Expected was String, was " + >> value.getClass()); >> + } >> + try { >> + AppletSecurityLevel validated = >> AppletSecurityLevel.fromString((String) value); >> + if (validated == null) { >> + throw new >> IllegalArgumentException("Result can't be null, was"); >> + } >> + //thrown by fromString >> + } catch (RuntimeException ex) { >> + throw new IllegalArgumentException(ex); >> + } >> + } >> + >> + @Override >> + public String getPossibleValues() { >> + return AppletSecurityLevel.allToString(); >> + } >> + }, >> + null >> } >> }; >> >> diff -r e631770d76ba >> netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java >> --- a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java >> Thu Jan 31 11:12:35 2013 +0100 >> +++ b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java >> Fri Feb 01 20:55:48 2013 +0100 >> @@ -51,6 +51,7 @@ >> public static final String DEPLOYMENT_DIR = ".icedtea"; >> public static final String DEPLOYMENT_CONFIG = "deployment.config"; >> public static final String DEPLOYMENT_PROPERTIES = >> "deployment.properties"; >> + public static final String APPLET_TRUST_SETTINGS = >> ".appletTrustSettings"; >> >> public static final String DEPLOYMENT_COMMENT = "Netx deployment >> configuration"; >> >> @@ -105,6 +106,9 @@ >> /** Boolean. Only show security prompts to user if true */ >> public static final String KEY_SECURITY_PROMPT_USER = >> "deployment.security.askgrantdialog.show"; >> >> + //enum of AppletSecurityLevel in result >> + public static final String KEY_SECURITY_LEVEL = >> "deployment.security.level"; >> + >> public static final String KEY_SECURITY_TRUSTED_POLICY = >> "deployment.security.trusted.policy"; >> >> /** Boolean. Only give >> AWTPermission("showWindowWithoutWarningBanner") if true */ >> @@ -196,6 +200,17 @@ >> load(true); >> } >> >> + public static File getAppletTrustCustomSettingsPath() { >> + return new File(System.getProperty("user.home") + >> File.separator + DEPLOYMENT_DIR >> + + File.separator + APPLET_TRUST_SETTINGS); >> + } >> + >> + public static File getAppletTrustGlobalSettingsPath() { >> + return new File(File.separator + "etc" + File.separator + >> ".java" + File.separator >> + + "deployment" + File.separator + >> APPLET_TRUST_SETTINGS); >> + >> + } >> + >> /** >> * Initialize this deployment configuration by reading >> configuration files. >> * Generally, it will try to continue and ignore errors it finds >> (such as file not found). >> diff -r e631770d76ba >> netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java >> --- a/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java Thu >> Jan 31 11:12:35 2013 +0100 >> +++ b/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java Fri >> Feb 01 20:55:48 2013 +0100 >> @@ -41,6 +41,7 @@ >> import javax.swing.JFrame; >> import javax.swing.JLabel; >> import javax.swing.JList; >> +import javax.swing.JOptionPane; >> import javax.swing.JPanel; >> import javax.swing.JScrollPane; >> import javax.swing.SwingConstants; >> @@ -230,7 +231,10 @@ >> new SettingsPanel(Translator.R("CPTabNetwork"), >> createNetworkSettingsPanel()), >> // TODO: This is commented out since this is not >> implemented yet >> // new SettingsPanel(Translator.R("CPTabRuntimes"), >> createRuntimesSettingsPanel()), >> - new SettingsPanel(Translator.R("CPTabSecurity"), >> createSecuritySettingsPanel()), }; >> + new SettingsPanel(Translator.R("CPTabSecurity"), >> createSecuritySettingsPanel()), >> + //todo refactor to work with tmp file and apply as >> asu designed it >> + new >> SettingsPanel(Translator.R("APPEXTSECControlPanelExtendedAppletSecurityTitle"), >> new >> UnsignedAppletsTrustingListPanel(DeploymentConfiguration.getAppletTrustGlobalSettingsPath(),DeploymentConfiguration.getAppletTrustCustomSettingsPath(), >> this.config) ) >> + }; >> >> // Add panels. >> final JPanel settingsPanel = new JPanel(new CardLayout()); >> @@ -360,6 +364,7 @@ >> config.save(); >> } catch (IOException e) { >> e.printStackTrace(); >> + JOptionPane.showMessageDialog(this, e); >> } >> } >> >> diff -r e631770d76ba >> netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ >> b/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java >> Fri Feb 01 20:55:48 2013 +0100 >> @@ -0,0 +1,168 @@ >> +/* >> +Copyright (C) 2013 Red Hat >> + >> +This program 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 of the License, or >> +(at your option) any later version. >> + >> +This program 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 this program; if not, write to the Free Software >> +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA >> +*/ >> + >> +package net.sourceforge.jnlp.controlpanel; >> + >> +import java.util.Date; >> +import javax.swing.table.AbstractTableModel; >> +import net.sourceforge.appletextendedsecurity.UnsignedAppletAction; >> +import >> net.sourceforge.appletextendedsecurity.UnsignedAppletActionEntry; >> +import net.sourceforge.appletextendedsecurity.UrlRegEx; >> +import >> net.sourceforge.appletextendedsecurity.impl.UnsignedAppletActionStorageOperator; >> +import net.sourceforge.jnlp.runtime.Translator; >> + >> +public class UnsignedAppletActionTableModel extends >> AbstractTableModel { >> + >> + final UnsignedAppletActionStorageOperator back; >> + private final String[] columns = new >> String[]{Translator.R("APPEXTSECguiTableModelTableColumnAction"), >> + Translator.R("APPEXTSECguiTableModelTableColumnDateOfAction"), >> + Translator.R("APPEXTSECguiTableModelTableColumnDocumentBase"), >> + Translator.R("APPEXTSECguiTableModelTableColumnCodeBase"), >> + Translator.R("APPEXTSECguiTableModelTableColumnMainClass"), >> + Translator.R("APPEXTSECguiTableModelTableColumnArchives")}; >> + >> + public >> UnsignedAppletActionTableModel(UnsignedAppletActionStorageOperator >> back) { >> + this.back = back; >> + } >> + >> + @Override >> + public int getRowCount() { >> + try { >> + return back.toArray().length; >> + } catch (Exception ex) { >> + throw new RuntimeException(ex); > > Why is this wrapping needed ? > >> + } >> + } >> + >> + @Override >> + public int getColumnCount() { >> + return columns.length; >> + } >> + >> + @Override >> + public String getColumnName(int columnIndex) { >> + return columns[columnIndex]; >> + } >> + >> + @Override >> + public Class getColumnClass(int columnIndex) { >> + if (columnIndex == 0) { >> + return UnsignedAppletAction.class; >> + } >> + if (columnIndex == 1) { >> + return Date.class; >> + } >> + if (columnIndex == 2) { >> + return UrlRegEx.class; >> + } >> + if (columnIndex == 3) { >> + return UrlRegEx.class; >> + } >> + if (columnIndex == 3) { >> + return String.class; >> + } >> + if (columnIndex == 3) { >> + return String.class; >> + } >> + return Object.class; >> + } >> + >> + @Override >> + public boolean isCellEditable(int rowIndex, int columnIndex) { >> + if (back.isReadOnly()){ >> + return false; >> + } >> + if (columnIndex==1) return false; >> + if (columnIndex==0) return true; >> + if (getValueAt(rowIndex, columnIndex-1)==null || >> getValueAt(rowIndex, columnIndex-1).toString().trim().isEmpty()) >> return false; >> + return true; >> + } >> + >> + @Override >> + public Object getValueAt(int rowIndex, int columnIndex) { >> + >> + UnsignedAppletActionEntry source = back.toArray()[rowIndex]; >> + if (columnIndex == 0) { >> + return source.getUnsignedAppletAction(); >> + } >> + if (columnIndex == 1) { >> + return source.getTimeStamp(); >> + } >> + if (columnIndex == 2) { >> + return source.getDocumentBase(); >> + } >> + if (columnIndex == 3) { >> + return source.getCodeBase(); >> + } >> + if (columnIndex == 4) { >> + return source.getMainClass(); >> + } >> + if (columnIndex == 5) { >> + return >> UnsignedAppletActionEntry.createArchivesString(source.getArchives()); >> + } >> + return null; >> + } >> + >> + @Override >> + public void setValueAt(final Object aValue, final int rowIndex, >> final int columnIndex) { >> + final UnsignedAppletActionEntry source = >> back.toArray()[rowIndex]; >> + back.modify(source, columnIndex, aValue); >> + >> + } >> + >> + public void addRow() { >> + int i = back.toArray().length; >> + String s = "\\Qhttp://localhost:80/\\E.*"; >> + back.add(new UnsignedAppletActionEntry( >> + UnsignedAppletAction.NEVER, >> + new Date(), >> + new UrlRegEx(s), >> + new UrlRegEx(s), >> + null, >> + null)); >> + fireTableRowsInserted(i, i + 1); >> + } >> + >> + public void removeRow(int i) { >> + back.remove(i); >> + fireTableRowsDeleted(i, i); >> + } >> + >> + public void clear() { >> + int i = getRowCount(); >> + back.clear(); >> + fireTableRowsDeleted(0, i); >> + } >> + >> + void removeByBehaviour(UnsignedAppletAction unsignedAppletAction) { >> + int i = getRowCount(); >> + back.removeByBehaviour(unsignedAppletAction); >> + fireTableRowsDeleted(0, i); >> + } >> + >> + void moveUp(int selectedRow) { >> + int i = getRowCount(); >> + back.moveUp(selectedRow); >> + fireTableRowsUpdated(i-1, i); >> + } >> + void moveDown(int selectedRow) { >> + int i = getRowCount(); >> + back.moveDown(selectedRow); >> + fireTableRowsUpdated(i, i+1); >> + } >> +} >> diff -r e631770d76ba >> netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ >> b/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java >> Fri Feb 01 20:55:48 2013 +0100 >> @@ -0,0 +1,665 @@ >> +/* >> + Copyright (C) 2013 Red Hat >> + >> + This program 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 of the License, or >> + (at your option) any later version. >> + >> + This program 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 this program; if not, write to the Free Software >> + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 >> USA >> + */ >> +package net.sourceforge.jnlp.controlpanel; >> + >> +import java.awt.BorderLayout; >> +import java.io.BufferedWriter; >> +import java.io.File; >> +import java.io.FileOutputStream; >> +import java.io.OutputStreamWriter; >> +import java.text.DateFormat; >> +import java.util.ArrayList; >> +import java.util.Collections; >> +import java.util.Date; >> +import java.util.List; >> +import java.util.regex.Pattern; >> +import javax.swing.event.ChangeEvent; >> +import javax.swing.event.ListSelectionEvent; >> +import net.sourceforge.appletextendedsecurity.UnsignedAppletAction; >> +import net.sourceforge.appletextendedsecurity.UrlRegEx; >> +import javax.swing.DefaultCellEditor; >> +import javax.swing.JComboBox; >> +import javax.swing.JFrame; >> +import javax.swing.JOptionPane; >> +import javax.swing.JPanel; >> +import javax.swing.JTable; >> +import javax.swing.JTextField; >> +import javax.swing.event.ChangeListener; >> +import javax.swing.event.ListSelectionListener; >> +import javax.swing.table.DefaultTableCellRenderer; >> +import javax.swing.table.DefaultTableModel; >> +import javax.swing.table.TableCellEditor; >> +import javax.swing.table.TableCellRenderer; >> +import javax.swing.table.TableModel; >> +import >> net.sourceforge.appletextendedsecurity.UnsignedAppletActionEntry; >> +import >> net.sourceforge.appletextendedsecurity.impl.UnsignedAppletActionStorageOperator; >> +import net.sourceforge.appletextendedsecurity.AppletSecurityLevel; >> +import net.sourceforge.jnlp.config.DeploymentConfiguration; >> +import net.sourceforge.jnlp.runtime.Translator; >> + >> +public class UnsignedAppletsTrustingListPanel extends >> javax.swing.JPanel { >> + >> + private javax.swing.JButton jButton1; >> + private javax.swing.JButton jButton2; >> + private javax.swing.JButton jButton3; >> + private javax.swing.JButton jButton4; >> + private javax.swing.JButton jButton5; >> + private javax.swing.JButton jButton6; >> + private javax.swing.JButton jButton7; >> + private javax.swing.JButton jButton8; >> + private javax.swing.JCheckBox jCheckBox1; >> + private javax.swing.JCheckBox jCheckBox2; >> + private javax.swing.JComboBox jComboBox1; >> + private javax.swing.JComboBox jComboBox2; >> + private javax.swing.JLabel jLabel1; >> + private javax.swing.JLabel jLabel2; >> + private javax.swing.JScrollPane jScrollPane1; >> + private javax.swing.JTabbedPane jTabPane1; >> + private javax.swing.JTable jTable1; >> + private javax.swing.JScrollPane jScrollPane2; >> + private javax.swing.JTable jTable2; > > Numbers are not an acceptable naming convention IMO. Same with the > numbered methods. But I think it can be fixed once in HEAD. The > functionality is the priority ATM. > >> + private final UnsignedAppletActionStorageOperator customBackEnd; >> + private final UnsignedAppletActionStorageOperator globalBackEnd; >> + private final UnsignedAppletActionTableModel customModel; >> + private final UnsignedAppletActionTableModel globalModel; >> + private final DeploymentConfiguration conf; >> + private javax.swing.JTable currentTable; >> + private UnsignedAppletActionTableModel currentModel; >> + private String lastDoc; >> + private String lastCode; >> + >> + >> + /* >> + * for testing and playing >> + */ >> + public static void main(String args[]) { >> + final String defaultDir = System.getProperty("user.home") + >> "/Desktop/"; >> + final String defaultFileName1 = "terrorList1"; >> + final String defaultFileName2 = "terrorList2"; >> + final String defaultFile1 = defaultDir + defaultFileName1; >> + final String defaultFile2 = defaultDir + defaultFileName2; >> + java.awt.EventQueue.invokeLater(new Runnable() { >> + @Override >> + public void run() { >> + try { >> + JFrame f = new JFrame(); >> + f.setSize(700, 300); >> + f.setLayout(new BorderLayout()); >> + f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); >> + DeploymentConfiguration cc = new >> DeploymentConfiguration(); >> + cc.load(); >> + File ff1 = new File(defaultFile1); >> + File ff2 = new File(defaultFile2); >> + f.add(new UnsignedAppletsTrustingListPanel(ff2, >> ff1, cc)); >> + f.setVisible(true); >> + } catch (Exception ex) { >> + ex.printStackTrace(); >> + } >> + } >> + }); >> + } >> + >> + public UnsignedAppletsTrustingListPanel(File globalSettings, >> File customSettings, DeploymentConfiguration conf) { >> + customBackEnd = new >> UnsignedAppletActionStorageOperator(customSettings); >> + globalBackEnd = new >> UnsignedAppletActionStorageOperator(globalSettings); >> + customModel = new >> UnsignedAppletActionTableModel(customBackEnd); >> + globalModel = new >> UnsignedAppletActionTableModel(globalBackEnd); >> + initComponents(); >> + this.conf = conf; >> + AppletSecurityLevel gs = AppletSecurityLevel.getDefault(); >> + String s = >> conf.getProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL); >> + if (s != null) { >> + gs = AppletSecurityLevel.fromString(s); >> + } >> + jComboBox1.setSelectedItem(gs); >> + jTable1.getSelectionModel().addListSelectionListener(new >> SingleSelectionListenerImpl(jTable1)); >> + jTable2.getSelectionModel().addListSelectionListener(new >> SingleSelectionListenerImpl(jTable2)); >> + currentTable = jTable1; >> + currentModel = customModel; >> + setButtons((!currentModel.back.isReadOnly())); >> + } >> + >> + public String >> appletItemsToCaption(List ii, String >> caption) { >> + StringBuilder sb = new StringBuilder(); >> + for (UnsignedAppletActionEntry i : ii) { >> + sb.append(appletItemToCaption(i, caption)).append("\n"); >> + } >> + return sb.toString(); >> + } >> + >> + public String appletItemToCaption(UnsignedAppletActionEntry i, >> String caption) { >> + return Translator.R("APPEXTSECguiPanelAppletInfoHederPart1", >> caption, i.getDocumentBase().getFilteredRegEx()) >> + + "\n (" + >> Translator.R("APPEXTSECguiPanelAppletInfoHederPart2", >> i.getUnsignedAppletAction(), >> DateFormat.getInstance().format(i.getTimeStamp())) >> + + "\n " + >> Translator.R("APPEXTSECguiTableModelTableColumnDocumentBase") + ": " >> + i.getDocumentBase().getFilteredRegEx() >> + + "\n " + >> Translator.R("APPEXTSECguiTableModelTableColumnCodeBase") + ": " + >> i.getCodeBase().getFilteredRegEx() >> + + "\n " + >> Translator.R("APPEXTSECguiTableModelTableColumnMainClass") + ": " + >> ((i.getMainClass() == null) ? "" : i.getMainClass()) >> + + "\n " + >> Translator.R("APPEXTSECguiTableModelTableColumnArchives") + ": " + >> UnsignedAppletActionEntry.createArchivesString(i.getArchives()); >> + } >> + >> + public void removeSelectedFromTable(JTable table) { >> + int[] originalIndexes = table.getSelectedRows(); >> + List newIndexes = new >> ArrayList(originalIndexes.length); >> + for (int i = 0; i < originalIndexes.length; i++) { >> + //we need to remap values first >> + int modelRow = >> table.convertRowIndexToModel(originalIndexes[i]); >> + newIndexes.add(modelRow); >> + } >> + //now to sort so we can incrementaly dec safely >> + Collections.sort(newIndexes); >> + if (jCheckBox1.isSelected()) { >> + String s = >> Translator.R("APPEXTSECguiPanelConfirmDeletionOf", newIndexes.size()) >> + ": \n"; >> + UnsignedAppletActionEntry[] items = >> currentModel.back.toArray(); >> + for (int i = 0; i < newIndexes.size(); i++) { >> + Integer integer = newIndexes.get(i); >> + s += appletItemToCaption(items[integer], " ") + "\n"; >> + } >> + int a = JOptionPane.showConfirmDialog(this, s); >> + if (a != JOptionPane.OK_OPTION) { >> + return; >> + } >> + } >> + int sub = 0; >> + for (int i = 0; i < newIndexes.size(); i++) { >> + Integer integer = newIndexes.get(i); >> + currentModel.removeRow(integer.intValue() + sub); >> + sub--; >> + } >> + } >> + >> + public void removeAllItemsFromTable(JTable table, >> UnsignedAppletActionTableModel model) { >> + table.clearSelection(); >> + >> + if (jCheckBox1.isSelected()) { >> + UnsignedAppletActionEntry[] items = model.back.toArray(); >> + String s = >> Translator.R("APPEXTSECguiPanelConfirmDeletionOf", items.length) + ": >> \n"; >> + for (int i = 0; i < items.length; i++) { >> + s += appletItemToCaption(items[i], " ") + "\n"; >> + } >> + int a = JOptionPane.showConfirmDialog(this, s); >> + if (a != JOptionPane.OK_OPTION) { >> + return; >> + } >> + } >> + model.clear(); >> + } >> + >> + private void initComponents() { >> + >> + jScrollPane1 = new javax.swing.JScrollPane(); >> + jScrollPane2 = new javax.swing.JScrollPane(); >> + jTable1 = createTbale(customModel); >> + jTable2 = createTbale(globalModel); >> + jButton1 = new javax.swing.JButton(); >> + jComboBox1 = new JComboBox(new AppletSecurityLevel[]{ >> + AppletSecurityLevel.DENY_ALL, >> + AppletSecurityLevel.DENY_UNSIGNED, >> + AppletSecurityLevel.ASK_UNSIGNED, >> + AppletSecurityLevel.ALLOW_UNSIGNED >> + }); >> + jComboBox1.setSelectedItem(AppletSecurityLevel.getDefault()); >> + jLabel2 = new javax.swing.JLabel(); >> + jLabel1 = new javax.swing.JLabel(); >> + jComboBox2 = new javax.swing.JComboBox(); >> + jButton2 = new javax.swing.JButton(); >> + jButton5 = new javax.swing.JButton(); >> + jButton3 = new javax.swing.JButton(); >> + jButton4 = new javax.swing.JButton(); >> + jCheckBox1 = new javax.swing.JCheckBox(); >> + jCheckBox2 = new javax.swing.JCheckBox(); >> + jButton6 = new javax.swing.JButton(); >> + jButton7 = new javax.swing.JButton(); >> + jButton8 = new javax.swing.JButton(); >> + jTabPane1 = new javax.swing.JTabbedPane(); >> + >> + jScrollPane1.setViewportView(jTable1); >> + >> + jScrollPane2.setViewportView(jTable2); >> + >> + jButton1.setText(Translator.R("APPEXTSECguiPanelHelpButton")); >> + jButton1.addActionListener(new >> java.awt.event.ActionListener() { >> + @Override >> + public void actionPerformed(java.awt.event.ActionEvent >> evt) { >> + jButton1ActionPerformed(evt); >> + } >> + }); >> + >> + jComboBox1.addActionListener(new >> java.awt.event.ActionListener() { >> + @Override >> + public void actionPerformed(java.awt.event.ActionEvent >> evt) { >> + jComboBox1ActionPerformed(evt); >> + } >> + }); >> + >> + jLabel2.setText(Translator.R("APPEXTSECguiPanelSecurityLevel")); >> + >> + >> jLabel1.setText(Translator.R("APPEXTSECguiPanelGlobalBehaviourCaption")); >> + >> + jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new >> String[]{ >> + Translator.R("APPEXTSECguiPanelDeleteMenuSelected"), >> + Translator.R("APPEXTSECguiPanelDeleteMenuAllA"), >> + Translator.R("APPEXTSECguiPanelDeleteMenuAllN"), >> + Translator.R("APPEXTSECguiPanelDeleteMenuAlly"), >> + Translator.R("APPEXTSECguiPanelDeleteMenuAlln"), >> + Translator.R("APPEXTSECguiPanelDeleteMenuAllAll")})); >> + >> + jButton2.setText(Translator.R("APPEXTSECguiPanelDeleteButton")); >> + jButton2.addActionListener(new >> java.awt.event.ActionListener() { >> + @Override >> + public void actionPerformed(java.awt.event.ActionEvent >> evt) { >> + jButton2ActionPerformed(evt); >> + } >> + }); >> + >> + jButton5.setText(Translator.R("APPEXTSECguiPanelTestUrlButton")); >> + jButton5.addActionListener(new >> java.awt.event.ActionListener() { >> + @Override >> + public void actionPerformed(java.awt.event.ActionEvent >> evt) { >> + jButton5ActionPerformed(evt); >> + } >> + }); >> + >> + jButton3.setText(Translator.R("APPEXTSECguiPanelAddRowButton")); >> + jButton3.addActionListener(new >> java.awt.event.ActionListener() { >> + @Override >> + public void actionPerformed(java.awt.event.ActionEvent >> evt) { >> + jButton3ActionPerformed(evt); >> + } >> + }); >> + >> + >> jButton4.setText(Translator.R("APPEXTSECguiPanelValidateTableButton")); >> + jButton4.addActionListener(new >> java.awt.event.ActionListener() { >> + @Override >> + public void actionPerformed(java.awt.event.ActionEvent >> evt) { >> + jButton4ActionPerformed(evt); >> + } >> + }); >> + >> + jCheckBox1.setSelected(true); >> + >> jCheckBox1.setText(Translator.R("APPEXTSECguiPanelAskeforeActionBox")); >> + >> + jCheckBox2.setText(Translator.R("APPEXTSECguiPanelShowRegExesBox")); >> + jCheckBox2.addActionListener(new >> java.awt.event.ActionListener() { >> + @Override >> + public void actionPerformed(java.awt.event.ActionEvent >> evt) { >> + jCheckBox2ActionPerformed(evt); >> + } >> + }); >> + >> + jButton6.setText(Translator.R("APPEXTSECguiPanelInverSelection")); >> + jButton6.addActionListener(new >> java.awt.event.ActionListener() { >> + @Override >> + public void actionPerformed(java.awt.event.ActionEvent >> evt) { >> + jButton6ActionPerformed(evt); >> + } >> + }); >> + >> + jButton7.setText(Translator.R("APPEXTSECguiPanelMoveRowUp")); >> + jButton7.setEnabled(false); >> + jButton7.addActionListener(new >> java.awt.event.ActionListener() { >> + @Override >> + public void actionPerformed(java.awt.event.ActionEvent >> evt) { >> + jButton7ActionPerformed(evt); >> + } >> + }); >> + >> + jButton8.setText(Translator.R("APPEXTSECguiPanelMoveRowDown")); >> + jButton8.setEnabled(false); >> + jButton8.addActionListener(new >> java.awt.event.ActionListener() { >> + @Override >> + public void actionPerformed(java.awt.event.ActionEvent >> evt) { >> + jButton8ActionPerformed(evt); >> + } >> + }); >> + >> + javax.swing.GroupLayout layout = new >> javax.swing.GroupLayout(this); >> + this.setLayout(layout); >> + layout.setHorizontalGroup( >> + >> layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, >> layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addComponent(jTabPane1, >> javax.swing.GroupLayout.Alignment.LEADING, >> javax.swing.GroupLayout.DEFAULT_SIZE, 583, >> Short.MAX_VALUE).addComponent(jLabel1, >> javax.swing.GroupLayout.Alignment.LEADING).addGroup(javax.swing.GroupLayout.Alignment.LEADING, >> layout.createSequentialGroup().addComponent(jLabel2).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jComboBox1, >> 0, 474, >> Short.MAX_VALUE)).addGroup(javax.swing.GroupLayout.Alignment.LEADING, >> layout.createSequentialGroup().addComponent(jButton3).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jButton4).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jButton5).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, >> 94, >> Short.MAX_VALUE).addComponent(jButton8).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jButton7)).addGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addComponent(jButton2).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jComboBox2, >> javax.swing.GroupLayout.PREFERRED_SIZE, >> javax.swing.GroupLayout.DEFAULT_SIZE, >> javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jButton6)).addGroup(layout.createSequentialGroup().addComponent(jCheckBox1).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jCheckBox2))).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, >> 93, Short.MAX_VALUE).addComponent(jButton1, >> javax.swing.GroupLayout.PREFERRED_SIZE, 108, >> javax.swing.GroupLayout.PREFERRED_SIZE))).addContainerGap())); >> + layout.setVerticalGroup( >> + >> layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jLabel1).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jLabel2).addComponent(jComboBox1, >> javax.swing.GroupLayout.PREFERRED_SIZE, >> javax.swing.GroupLayout.DEFAULT_SIZE, >> javax.swing.GroupLayout.PREFERRED_SIZE)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, >> false).addComponent(jButton2).addComponent(jComboBox2).addComponent(jButton6, >> javax.swing.GroupLayout.DEFAULT_SIZE, >> javax.swing.GroupLayout.DEFAULT_SIZE, >> Short.MAX_VALUE)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jCheckBox1).addComponent(jCheckBox2))).addComponent(jButton1, >> javax.swing.GroupLayout.PREFERRED_SIZE, 53, >> javax.swing.GroupLayout.PREFERRED_SIZE)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jTabPane1, >> javax.swing.GroupLayout.DEFAULT_SIZE, 161, >> Short.MAX_VALUE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jButton3).addComponent(jButton4).addComponent(jButton5).addComponent(jButton7).addComponent(jButton8)).addContainerGap())); >> + >> + JPanel pane1 = new JPanel(new BorderLayout()); >> + JPanel pane2 = new JPanel(new BorderLayout()); >> + pane1.add(jScrollPane1); >> + pane2.add(jScrollPane2); >> + jTabPane1.add(pane1); >> + jTabPane1.add(pane2); >> + jTabPane1.setTitleAt(0, >> Translator.R("APPEXTSECguiPanelCustomDefs")); >> + jTabPane1.setTitleAt(1, >> Translator.R("APPEXTSECguiPanelGlobalDefs")); >> + jTabPane1.setToolTipTextAt(0, >> DeploymentConfiguration.getAppletTrustCustomSettingsPath().getAbsolutePath()); >> + jTabPane1.setToolTipTextAt(1, >> DeploymentConfiguration.getAppletTrustGlobalSettingsPath().getAbsolutePath()); >> + jTabPane1.addChangeListener(new ChangeListener() { >> + @Override >> + public void stateChanged(ChangeEvent e) { >> + switch (jTabPane1.getSelectedIndex()) { >> + case 0: >> + currentModel = customModel; >> + currentTable = jTable1; >> + break; >> + case 1: >> + currentModel = globalModel; >> + currentTable = jTable2; >> + break; >> + } >> + setButtons((!currentModel.back.isReadOnly())); >> + } >> + }); >> + } >> + >> + private void >> jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) { >> + try { >> + conf.setProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL, >> ((AppletSecurityLevel) jComboBox1.getSelectedItem()).toChars()); >> + conf.save(); >> + } catch (Exception ex) { >> + ex.printStackTrace(); >> + JOptionPane.showMessageDialog(this, ex); >> + } >> + } >> + >> + private void jButton2ActionPerformed(java.awt.event.ActionEvent >> evt) { >> + >> + if (jComboBox2.getSelectedIndex() == 0) { >> + removeSelectedFromTable(currentTable); >> + } >> + if (jComboBox2.getSelectedIndex() == 1) { >> + removeByBehaviour(UnsignedAppletAction.ALWAYS); >> + } >> + if (jComboBox2.getSelectedIndex() == 2) { >> + removeByBehaviour(UnsignedAppletAction.NEVER); >> + } >> + if (jComboBox2.getSelectedIndex() == 3) { >> + removeByBehaviour(UnsignedAppletAction.YES); >> + } >> + if (jComboBox2.getSelectedIndex() == 4) { >> + removeByBehaviour(UnsignedAppletAction.NO); >> + } >> + if (jComboBox2.getSelectedIndex() == 5) { >> + removeAllItemsFromTable(currentTable, customModel); >> + } >> + } >> + >> + private void jButton5ActionPerformed(java.awt.event.ActionEvent >> evt) { >> + >> + String s1 = >> JOptionPane.showInputDialog(Translator.R("APPEXTSECguiPanelDocTest"), >> lastDoc); >> + String s2 = >> JOptionPane.showInputDialog(Translator.R("APPEXTSECguiPanelCodeTest"), lastCode); >> >> + lastDoc = s1; >> + lastCode = s2; >> + try { >> + List i = >> currentModel.back.getMatchingItems(s1, s2, null, null); >> + if (i == null || i.isEmpty()) { >> + JOptionPane.showMessageDialog(this, >> Translator.R("APPEXTSECguiPanelNoMatch")); >> + } else { >> + JOptionPane.showMessageDialog(this, >> Translator.R("APPEXTSECguiPanelMatchingNote") + "\n" + >> appletItemsToCaption(i, Translator.R("APPEXTSECguiPanelMatched") + ": >> ")); >> + } >> + } catch (Exception ex) { >> + ex.printStackTrace(); >> + JOptionPane.showMessageDialog(this, >> Translator.R("APPEXTSECguiPanelMatchingError", ex)); >> + } >> + >> + } >> + >> + private void jButton3ActionPerformed(java.awt.event.ActionEvent >> evt) { >> + >> + currentModel.addRow(); >> + } >> + >> + private void jButton4ActionPerformed(java.awt.event.ActionEvent >> evt) { >> + >> + File f = null; >> + try { >> + f = File.createTempFile("appletTable", "validation"); >> + } catch (Exception ex) { >> + ex.printStackTrace(); >> + JOptionPane.showMessageDialog(this, >> Translator.R("APPEXTSECguiPanelCanNOtValidate", ex.toString())); >> + return; >> + } >> + try { >> + currentModel.back.writeContentsLocked(); >> + BufferedWriter bw = new BufferedWriter(new >> OutputStreamWriter(new FileOutputStream(f), "UTF-8")); >> + currentModel.back.writeContent(bw); >> + bw.flush(); >> + bw.close(); >> + UnsignedAppletActionStorageOperator copy = new >> UnsignedAppletActionStorageOperator(f); >> + UnsignedAppletActionEntry[] items = copy.toArray(); >> + for (int i = 0; i < items.length; i++) { >> + UnsignedAppletActionEntry unsignedAppletActionEntry >> = items[i]; >> + if (unsignedAppletActionEntry.getDocumentBase() != >> null && >> !unsignedAppletActionEntry.getDocumentBase().getRegEx().trim().isEmpty()) >> { >> + Pattern p = >> Pattern.compile(unsignedAppletActionEntry.getDocumentBase().getRegEx()); >> + p.matcher("someInput").find(); >> + } else { >> + throw new >> RuntimeException(Translator.R("APPEXTSECguiPanelEmptyDoc")); >> + } >> + if (unsignedAppletActionEntry.getCodeBase() != null >> && >> !unsignedAppletActionEntry.getCodeBase().getRegEx().trim().isEmpty()) { >> + Pattern p = >> Pattern.compile(unsignedAppletActionEntry.getCodeBase().getRegEx()); >> + p.matcher("someInput").find(); >> + } else { >> + throw new >> RuntimeException(Translator.R("APPEXTSECguiPanelEmptyCode")); >> + } >> + >> UnsignedAppletActionEntry.createArchivesString(UnsignedAppletActionEntry.createArchivesList(UnsignedAppletActionEntry.createArchivesString(unsignedAppletActionEntry.getArchives()))); >> + >> + } >> + JOptionPane.showMessageDialog(this, >> Translator.R("APPEXTSECguiPanelTableValid")); >> + } catch (Exception ex) { >> + ex.printStackTrace(); >> + JOptionPane.showMessageDialog(this, >> Translator.R("APPEXTSECguiPanelTableInvalid ", ex.toString())); >> + } finally { >> + f.delete(); >> + } >> + >> + } >> + >> + private void >> jCheckBox2ActionPerformed(java.awt.event.ActionEvent evt) { >> + >> + reloadTable(); >> + } >> + >> + private void jButton6ActionPerformed(java.awt.event.ActionEvent >> evt) { >> + int[] selectedIndexs = currentTable.getSelectedRows(); >> + currentTable.selectAll(); >> + >> + for (int i = 0; i < currentTable.getRowCount(); i++) { >> + for (int selectedIndex : selectedIndexs) { >> + if (selectedIndex == i) { >> + currentTable.removeRowSelectionInterval(i, i); >> + break; >> + } >> + } >> + } >> + } >> + >> + private void jButton7ActionPerformed(java.awt.event.ActionEvent >> evt) { >> + int orig = currentTable.getSelectedRow(); >> + int i = currentTable.convertRowIndexToModel(orig); >> + currentModel.moveUp(i); >> + reloadTable(); >> + if (orig >= 1) { >> + currentTable.getSelectionModel().setSelectionInterval(orig - 1, >> orig - 1); >> + } >> + } >> + >> + private void jButton8ActionPerformed(java.awt.event.ActionEvent >> evt) { >> + int orig = currentTable.getSelectedRow(); >> + int i = currentTable.convertRowIndexToModel(orig); >> + currentModel.moveDown(i); >> + reloadTable(); >> + if (orig < currentModel.getRowCount()) { >> + currentTable.getSelectionModel().setSelectionInterval(orig + 1, >> orig + 1); >> + } >> + } >> + >> + private void jButton1ActionPerformed(java.awt.event.ActionEvent >> evt) { >> + } >> + >> + private void setButtons(boolean b) { >> + jButton2.setEnabled(b); >> + jButton3.setEnabled(b); >> + jButton6.setEnabled(b); >> + jButton7.setEnabled(b); >> + jButton8.setEnabled(b); >> + } >> + >> + private JTable createTbale(final TableModel model) { >> + JTable jt = new JTable() { >> + @Override >> + public TableCellEditor getCellEditor(int row, int column) { >> + if (column == 0) { >> + return new DefaultCellEditor(new JComboBox(new >> UnsignedAppletAction[]{UnsignedAppletAction.ALWAYS, >> UnsignedAppletAction.NEVER, UnsignedAppletAction.YES, >> UnsignedAppletAction.NO})); >> + } >> + if (column == 2) { >> + return new DefaultCellEditor(new >> MyTextField((UrlRegEx) (model.getValueAt(row, column)))); >> + } >> + if (column == 3) { >> + return new DefaultCellEditor(new >> MyTextField((UrlRegEx) (model.getValueAt(row, column)))); >> + } >> + return super.getCellEditor(row, column); >> + } >> + >> + @Override >> + public TableCellRenderer getCellRenderer(int row, int >> column) { >> + if (column == 1) { >> + return new >> UrlRegexCellRenderer.MyDateCellRenderer((Date) (model.getValueAt(row, >> column))); >> + } >> + if (column == 2) { >> + if (!jCheckBox2.isSelected()) { >> + return new UrlRegexCellRenderer((UrlRegEx) >> (model.getValueAt(row, column))); >> + } >> + } >> + if (column == 3) { >> + if (!jCheckBox2.isSelected()) { >> + return new UrlRegexCellRenderer((UrlRegEx) >> (model.getValueAt(row, column))); >> + } >> + } >> + return super.getCellRenderer(row, column); >> + } >> + }; >> + jt.setRowHeight(jt.getRowHeight() + jt.getRowHeight() / 2); >> + jt.setModel(model); >> + return jt; >> + >> + } >> + >> + private void reloadTable() { >> + currentTable.setModel(new DefaultTableModel()); >> + currentTable.setModel(currentModel); >> + >> + } >> + >> + private void removeByBehaviour(UnsignedAppletAction >> unsignedAppletAction) { >> + UnsignedAppletActionEntry[] items = >> currentModel.back.toArray(); >> + if (jCheckBox1.isSelected()) { >> + List toBeDeleted = new >> ArrayList(); >> + for (int i = 0; i < items.length; i++) { >> + UnsignedAppletActionEntry unsignedAppletActionEntry >> = items[i]; >> + if >> (unsignedAppletActionEntry.getUnsignedAppletAction() == >> unsignedAppletAction) { >> + toBeDeleted.add(unsignedAppletActionEntry); >> + } >> + >> + } >> + String s = >> Translator.R("APPEXTSECguiPanelConfirmDeletionOf", >> toBeDeleted.size())+": \n"; >> + for (int i = 0; i < toBeDeleted.size(); i++) { >> + s += appletItemToCaption(toBeDeleted.get(i), " ") + >> "\n"; >> + } >> + int a = JOptionPane.showConfirmDialog(this, s); >> + if (a != JOptionPane.OK_OPTION) { >> + return; >> + } >> + } >> + currentModel.removeByBehaviour(unsignedAppletAction); >> + } >> + >> + public static final class MyTextField extends JTextField { >> + >> + private final UrlRegEx keeper; >> + >> + private MyTextField(UrlRegEx urlRegEx) { >> + if (urlRegEx == null) { >> + keeper = new UrlRegEx(""); >> + } else { >> + this.keeper = urlRegEx; >> + } >> + setText(keeper.getFilteredRegEx()); >> + } >> + >> + @Override >> + public void setText(String t) { >> + super.setText(keeper.getRegEx()); >> + } >> + } >> + >> + public static final class UrlRegexCellRenderer extends >> DefaultTableCellRenderer { >> + >> + private final UrlRegEx keeper; >> + >> + private UrlRegexCellRenderer(UrlRegEx urlRegEx) { >> + if (urlRegEx == null) { >> + keeper = new UrlRegEx(""); >> + } else { >> + this.keeper = urlRegEx; >> + } >> + setText(keeper.getFilteredRegEx()); >> + } >> + >> + @Override >> + public void setText(String t) { >> + if (keeper == null) { >> + super.setText(""); >> + } else { >> + super.setText(keeper.getFilteredRegEx()); >> + } >> + } >> + >> + public static final class MyDateCellRenderer extends >> DefaultTableCellRenderer { >> + >> + private final Date keeper; >> + >> + private MyDateCellRenderer(Date d) { >> + this.keeper = d; >> + setText(DateFormat.getInstance().format(d)); >> + } >> + >> + @Override >> + public void setText(String t) { >> + if (keeper == null) { >> + super.setText(""); >> + } else { >> + super.setText(DateFormat.getInstance().format(keeper)); >> + } >> + } >> + } >> + } >> + >> + private class SingleSelectionListenerImpl implements >> ListSelectionListener { >> + >> + private final JTable table; >> + >> + public SingleSelectionListenerImpl(JTable table) { >> + this.table = table; >> + } >> + >> + @Override >> + public void valueChanged(ListSelectionEvent e) { >> + if (table.getSelectedRows().length == 1) { >> + jButton7.setEnabled(true); >> + jButton8.setEnabled(true); >> + } else { >> + jButton7.setEnabled(false); >> + jButton8.setEnabled(false); >> + } >> + } >> + } >> +} >> diff -r e631770d76ba >> netx/net/sourceforge/jnlp/resources/Messages.properties >> --- a/netx/net/sourceforge/jnlp/resources/Messages.properties Thu Jan >> 31 11:12:35 2013 +0100 >> +++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Fri Feb >> 01 20:55:48 2013 +0100 >> @@ -474,3 +474,57 @@ >> SPLASHerrorInInformation = Error during loading of information >> element, verify source rather >> SPLASHmissingInformation = Information element is missing, verify >> source rather >> SPLASHchainWas = This is the list of exceptions that occurred >> launching your applet. Please note, those exceptions can be from >> multiple applets. For a good bug report, be sure to run only one applet. >> + >> +APPEXTSECappletSecurityLevelExtraHighId=Extra High Security > > IMO Extra High Security is better here as simply 'Disable Applets'. It > is a bit odd to say you're securing Java by turning it off. > >> +APPEXTSECappletSecurityLevelVeryHighId=Very High Security >> +APPEXTSECappletSecurityLevelHighId=High Security >> +APPEXTSECappletSecurityLevelLowId=Low Security >> +APPEXTSECappletSecurityLevelExtraHighExplanation=No applet will be run >> +APPEXTSECappletSecurityLevelVeryHighExplanation=No unsigned applets >> will be run >> +APPEXTSECappletSecurityLevelHighExplanation=User will be prompted >> for each unsigned applet >> +APPEXTSECappletSecurityLevelLowExplanation=All, even untrusted, >> applets will be run >> +APPEXTSECunsignedAppletActionAlways=Always trust this applet(s) >> +APPEXTSECunsignedAppletActionNever=Never trust this applet(s) >> +APPEXTSECunsignedAppletActionYes=This applet was visited and allowed >> +APPEXTSECunsignedAppletActionNo=This applet was visited and denied >> +APPEXTSECControlPanelExtendedAppletSecurityTitle=Extended applet >> security >> +APPEXTSECguiTableModelTableColumnAction=Action >> +APPEXTSECguiTableModelTableColumnDateOfAction=Date of action >> +APPEXTSECguiTableModelTableColumnDocumentBase=Document-base >> +APPEXTSECguiTableModelTableColumnCodeBase=Code-base >> +APPEXTSECguiTableModelTableColumnMainClass=Main class >> +APPEXTSECguiTableModelTableColumnArchives=Archives >> +APPEXTSECguiPanelAppletInfoHederPart1={0} {1} >> +APPEXTSECguiPanelAppletInfoHederPart2={0} from {1} >> +APPEXTSECguiPanelConfirmDeletionOf=Are you sure you want to delete >> following {0} items >> +APPEXTSECguiPanelHelpButton=Help >> +APPEXTSECguiPanelSecurityLevel=Security Level >> +APPEXTSECguiPanelGlobalBehaviourCaption=Settings of global behaviour >> for applets >> +APPEXTSECguiPanelDeleteMenuSelected=selected >> +APPEXTSECguiPanelDeleteMenuAllA=all allowed (A) >> +APPEXTSECguiPanelDeleteMenuAllN=all forbidden (N) >> +APPEXTSECguiPanelDeleteMenuAlly=all approved (y) >> +APPEXTSECguiPanelDeleteMenuAlln=all disaprooved (n) >> +APPEXTSECguiPanelDeleteMenuAllAll=absolute all >> +APPEXTSECguiPanelDeleteButton=Delete >> +APPEXTSECguiPanelTestUrlButton=Test url >> +APPEXTSECguiPanelAddRowButton=Add new row >> +APPEXTSECguiPanelValidateTableButton=Validate table >> +APPEXTSECguiPanelAskeforeActionBox=Ask me before action >> +APPEXTSECguiPanelShowRegExesBox=Show full regular expressions >> +APPEXTSECguiPanelInverSelection=Invert selection >> +APPEXTSECguiPanelMoveRowUp=Move row up >> +APPEXTSECguiPanelMoveRowDown=Move row down >> +APPEXTSECguiPanelCustomDefs=Custom definitions >> +APPEXTSECguiPanelGlobalDefs=Global definitions >> +APPEXTSECguiPanelDocTest=Type document base URL >> +APPEXTSECguiPanelCodeTest=Type code base URL >> +APPEXTSECguiPanelNoMatch=Nothing matched >> +APPEXTSECguiPanelMatchingNote=Please note, that only first matched >> result will be considered as result. >> +APPEXTSECguiPanelMatched=Matched >> +APPEXTSECguiPanelMatchingError=Error during matching: {0} >> +APPEXTSECguiPanelCanNotValidate=Can not validate, can not create tmp >> file - {0} >> +APPEXTSECguiPanelEmptyDoc=All document-bases must be full >> +APPEXTSECguiPanelEmptyCode=All code-bases must be full >> +APPEXTSECguiPanelTableValid=Table looks valid >> +APPEXTSECguiPanelTableInvalid=Invalid with following error: {0} >> \ No newline at end of file >> diff -r e631770d76ba >> netx/net/sourceforge/jnlp/util/lockingfile/LockingFile.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/netx/net/sourceforge/jnlp/util/lockingfile/LockingFile.java Fri >> Feb 01 20:55:48 2013 +0100 >> @@ -0,0 +1,156 @@ >> +/* >> +Copyright (C) 2013 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.util.lockingfile; >> + >> +import java.nio.channels.FileChannel; >> + >> +import java.io.RandomAccessFile; >> + >> +import java.io.File; >> +import java.io.IOException; >> +import java.nio.channels.FileLock; >> +import java.util.Map; >> +import java.util.WeakHashMap; >> +import java.util.concurrent.locks.ReentrantLock; >> + >> +/* >> + * Process & thread locked access to a file. Creates file if it does >> not already exist. >> + */ >> +public class LockingFile { >> + >> + // The file for access >> + private RandomAccessFile randomAccessFile; >> + private FileChannel fileChannel; >> + private File file; >> + >> + // A file lock will protect against locks for multiple >> + // processes, while a thread lock is still needed within a >> single JVM. >> + >> + private FileLock processLock = null; >> + private ReentrantLock threadLock = new ReentrantLock(); >> + private boolean readOnly; >> + >> + private LockingFile(File file) { >> + this.file = file; >> + try{ >> + //just try to ctreate >> + this.file.createNewFile(); >> + }catch(Exception ex){ >> + //intentionaly silent >> + } >> + if (!this.file.isFile() && file.getParentFile()!=null && >> !file.getParentFile().canWrite() ){ >> + readOnly=true; >> + } else{ >> + this.readOnly = !file.canWrite(); >> + if (!readOnly && file.getParentFile()!=null && >> !file.getParentFile().canWrite()){ >> + readOnly=true; >> + } >> + } >> + } >> + >> + public boolean isReadOnly() { >> + return readOnly; >> + } >> + >> + >> + >> + // Provide shared access to LockedFile's via weak map >> + static private final Map instanceCache = new >> WeakHashMap(); >> + >> + /** >> + * Get a LockingFile for a given File. >> + * Ensures that we share the same instance for all threads >> + * @param file the file to lock >> + * @return a LockingFile instance >> + */ >> + synchronized public static LockingFile getInstance(File file) { >> + if (!instanceCache.containsKey(file)) { >> + instanceCache.put(file, new LockingFile(file)); >> + } >> + >> + return instanceCache.get(file); >> + } >> + >> + /** >> + * Get the file being locked. >> + * >> + * @return the file >> + */ >> + public File getFile() { >> + return file; >> + } >> + >> + /** >> + * Lock access to the file. Lock is reentrant. >> + */ >> + public void lock() throws IOException { >> + // Create if does not already exist, cannot lock >> non-existing file >> + if (!readOnly){ >> + this.file.createNewFile(); >> + } >> + >> + this.threadLock.lock(); >> + String rw="rws"; >> + if (isReadOnly()){ >> + rw="r"; >> + } >> + if (file.exists()){ >> + this.randomAccessFile = new RandomAccessFile(this.file, rw); >> + this.fileChannel = randomAccessFile.getChannel(); >> + } >> + >> + if (!isReadOnly()) this.processLock = this.fileChannel.lock(); >> + } >> + >> + /** >> + * Unlock access to the file. Lock is reentrant. >> + */ >> + public void unlock() throws IOException { >> + boolean releaseProcessLock = (this.threadLock.getHoldCount() >> == 1); >> + try { >> + if (releaseProcessLock && this.processLock != null) { >> + this.processLock.release(); >> + this.randomAccessFile.close(); >> + this.fileChannel.close(); >> + } >> + } finally { >> + this.processLock = null; >> + } >> + this.threadLock.unlock(); >> + } >> +} >> \ No newline at end of file >> diff -r e631770d76ba >> netx/net/sourceforge/jnlp/util/lockingfile/LockingReaderWriter.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ >> b/netx/net/sourceforge/jnlp/util/lockingfile/LockingReaderWriter.java >> Fri Feb 01 20:55:48 2013 +0100 >> @@ -0,0 +1,201 @@ >> +/* >> +Copyright (C) 2013 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.util.lockingfile; >> + >> +import java.io.BufferedWriter; >> + >> +import java.io.BufferedReader; >> +import java.io.File; >> +import java.io.FileInputStream; >> +import java.io.FileOutputStream; >> +import java.io.IOException; >> +import java.io.InputStreamReader; >> +import java.io.OutputStreamWriter; >> + >> +/** >> + * Process-locked string storage backed by a file. >> + * Each string is stored on its own line. >> + * Any new-lines must be encoded somehow if they are to be stored. >> + */ >> +public abstract class LockingReaderWriter { >> + >> + private LockingFile lockedFile; >> + >> + /** >> + * Create locking file-backed storage. >> + * @param file the storage file >> + */ >> + public LockingReaderWriter(File file) { >> + this.lockedFile = LockingFile.getInstance(file); >> + } >> + >> + /** >> + * Get the underlying file. >> + * Any access to this file should use lock() & unlock(). >> + * >> + * @return the file >> + */ >> + public File getBackingFile() { >> + return this.lockedFile.getFile(); >> + } >> + >> + public boolean isReadOnly() { >> + return this.lockedFile.isReadOnly(); >> + } >> + >> + /** >> + * Lock the underlying storage. Lock is reentrant. >> + */ >> + public void lock() { >> + try { >> + lockedFile.lock(); >> + } catch (IOException e) { >> + throw new StorageIoException(e); >> + } >> + } >> + >> + /** >> + * Unlock the underlying storage. Lock is reentrant. >> + */ >> + public void unlock() { >> + try { >> + lockedFile.unlock(); >> + } catch (IOException e) { >> + throw new StorageIoException(e); >> + } >> + } >> + >> + /** >> + * Writes stored contents to file. Assumes lock is held. >> + * @throws IOException >> + */ >> + protected void writeContents() throws IOException { >> + if (!getBackingFile().isFile()){ >> + return; >> + } >> + if (isReadOnly()){ >> + return; >> + } > > This silent failure is not acceptable IMO! It ignores the intent of > the method completely, and it was causing me a lot of confusion when I > was playing with the code. We ought to error-out here. > >> + BufferedWriter writer = null; >> + try { >> + writer = new BufferedWriter(new OutputStreamWriter( >> + new FileOutputStream(getBackingFile()), "UTF-8")); >> + writeContent(writer); >> + writer.flush(); >> + } finally { >> + if (writer != null) { >> + writer.close(); >> + } >> + } >> + } >> + >> + protected abstract void writeContent(BufferedWriter writer) >> throws IOException; >> + >> + /** >> + * Reads contents from file. Assumes lock is held. >> + * @throws IOException >> + */ >> + protected void readContents() throws IOException { >> + if (!getBackingFile().isFile()){ >> + return; >> + } > > Same here, we shouldn't be backed by an invalid file in the first place. > Note that I believe this will cause problems with how you are > currently handling non-existant global configurations -- but that > needs a more robust solution than this anyway. > >> + BufferedReader reader = null; >> + try { >> + reader = new BufferedReader(new InputStreamReader( >> + new FileInputStream(getBackingFile()), "UTF-8")); >> + >> + while (true) { >> + String line = reader.readLine(); >> + if (line == null) { >> + break; >> + } >> + readLine(line); >> + } >> + } finally { >> + if (reader != null) { >> + reader.close(); >> + } >> + } >> + } >> + >> + /** >> + * Reads contents from file. creating is lock . >> + * @throws IOException >> + */ >> + protected synchronized void readContentsLocked() throws >> IOException { >> + doLocked(new Runnable() { >> + >> + @Override >> + public void run() { >> + try { >> + readContents(); >> + } catch (IOException ex) { >> + throw new StorageIoException(ex); >> + } >> + } >> + }); >> + } >> + >> + /** >> + * Reads contents from file. creating is lock . >> + * @throws IOException >> + */ >> + protected synchronized void writeContentsLocked() throws >> IOException { >> + doLocked(new Runnable() { >> + >> + public void run() { >> + try { >> + writeContents(); >> + } catch (IOException ex) { >> + throw new StorageIoException(ex); >> + } >> + } >> + }); >> + >> + } >> + >> + protected void doLocked(Runnable r) { >> + lock(); >> + try { >> + r.run(); >> + } finally { >> + unlock(); >> + } >> + } >> + >> + protected abstract void readLine(String line); >> +} >> diff -r e631770d76ba >> netx/net/sourceforge/jnlp/util/lockingfile/StorageIoException.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ >> b/netx/net/sourceforge/jnlp/util/lockingfile/StorageIoException.java >> Fri Feb 01 20:55:48 2013 +0100 >> @@ -0,0 +1,22 @@ >> +package net.sourceforge.jnlp.util.lockingfile; >> + >> +/** >> + * Thrown when an exception occurs using the storage (namely >> IOException) > > (May as well say 'occurs while using a LockingReaderWriter', seeing as > this class is now coupled with it.) > >> + */ >> +public class StorageIoException extends RuntimeException { >> + >> + LockingReaderWriter outer; >> + >> + public StorageIoException(Exception e) { >> + super(e); >> + } >> + >> + public StorageIoException(String e) { >> + super(e); >> + } >> + >> + public StorageIoException(Exception e, LockingReaderWriter >> outer) { >> + super(e); >> + this.outer = outer; >> + } >> +} >> diff -r e631770d76ba >> tests/netx/unit/net/sourceforge/appletextendedsecurity/impl/UnsignedAppletActionStorageImplTest.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ >> b/tests/netx/unit/net/sourceforge/appletextendedsecurity/impl/UnsignedAppletActionStorageImplTest.java >> Fri Feb 01 20:55:48 2013 +0100 >> @@ -0,0 +1,97 @@ >> +/* >> +Copyright (C) 2013 Red Hat >> + >> +This program 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 of the License, or >> +(at your option) any later version. >> + >> +This program 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 this program; if not, write to the Free Software >> +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA >> +*/ >> + >> +package net.sourceforge.appletextendedsecurity.impl; >> + >> +import >> net.sourceforge.appletextendedsecurity.UnsignedAppletActionEntry; >> +import java.io.File; >> +import java.io.IOException; >> +import java.util.Arrays; >> +import net.sourceforge.jnlp.ServerAccess; >> +import org.junit.Assert; >> +import org.junit.BeforeClass; >> +import org.junit.Test; >> + >> +public class UnsignedAppletActionStorageImplTest { >> + >> + private static File f1; >> + private static File f2; >> + private static File f3; >> + private static File f4; >> + >> + @BeforeClass >> + public static void preapreTestFiles() throws IOException { >> + f1 = File.createTempFile("itwMatching", "testFile1"); >> + f2 = File.createTempFile("itwMatching", "testFile2"); >> + f3 = File.createTempFile("itwMatching", "testFile3"); >> + f4 = File.createTempFile("itwMatching", "testFile4"); >> + ServerAccess.saveFile("A 123456 .* .* main jar1;jar2", f1); >> + ServerAccess.saveFile("A 123456 .* \\Qbla\\E main >> jar1;jar2", f2); >> + } >> + >> + @Test >> + public void allMatchingDocAndCode() { >> + UnsignedAppletActionStorageImpl i1 = new >> UnsignedAppletActionStorageImpl(f1); >> + UnsignedAppletActionEntry r1 = i1.getMatchingItem("bla", >> "blaBla", "main", Arrays.asList(new String[]{"jar1", "jar2"})); >> + Assert.assertNotNull("r1 should be found", r1); >> + UnsignedAppletActionEntry r3 = i1.getMatchingItem("blah", >> "blaBla", "main", Arrays.asList(new String[]{"jar2", "jar1"})); >> + Assert.assertNotNull("r3 should be found", r1); >> + UnsignedAppletActionEntry r2 = i1.getMatchingItem("bla", >> "blaBlam", "wrong_main", Arrays.asList(new String[]{"jar1", "jar2"})); >> + Assert.assertNull("r2 should NOT be found", r2); >> + UnsignedAppletActionEntry r4 = i1.getMatchingItem("blha", >> "blaBlam", "main", Arrays.asList(new String[]{"jar2", "wrong_jar"})); >> + Assert.assertNull("r4 should NOT be found", r4); >> + UnsignedAppletActionEntry r5 = i1.getMatchingItem("blaBla", >> "blaBlaBla", "main", Arrays.asList(new String[]{"jar2"})); >> + Assert.assertNull("r5 should NOT be found", r5); >> + >> + } >> + >> + @Test >> + public void allMatchingDocAndStrictCode() { >> + UnsignedAppletActionStorageImpl i1 = new >> UnsignedAppletActionStorageImpl(f2); >> + UnsignedAppletActionEntry r1 = >> i1.getMatchingItem("whatever", "bla", "main", Arrays.asList(new >> String[]{"jar1", "jar2"})); >> + Assert.assertNotNull("r1 should be found", r1); >> + UnsignedAppletActionEntry r3 = >> i1.getMatchingItem("whatever", null, "main", Arrays.asList(new >> String[]{"jar2", "jar1"})); >> + Assert.assertNotNull("r3 should be found", r1); >> + UnsignedAppletActionEntry r2 = i1.getMatchingItem("bla", >> "blaBlam", "main", Arrays.asList(new String[]{"jar1", "jar2"})); >> + Assert.assertNull("r2 should NOT be found", r2); >> + UnsignedAppletActionEntry r4 = i1.getMatchingItem(null, >> "blaBlam", null, null); >> + Assert.assertNull("r4 should NOT be found", r4); >> + >> + } >> + >> + @Test >> + public void allMatchingDocAndCodeWithNulls() { >> + UnsignedAppletActionStorageImpl i1 = new >> UnsignedAppletActionStorageImpl(f1); >> + UnsignedAppletActionEntry r1 = i1.getMatchingItem("bla", >> "blaBla", null, null); >> + Assert.assertNotNull("r1 should be found", r1); >> + UnsignedAppletActionEntry r3 = i1.getMatchingItem("bla", >> "whatever", "", null); >> + Assert.assertNotNull("r3 should be found", r1); >> + UnsignedAppletActionEntry r2 = i1.getMatchingItem("bla", >> "blaBla", null, Arrays.asList(new String[]{"jar2", "jar1"})); >> + Assert.assertNotNull("r2 should be found", r2); >> + UnsignedAppletActionEntry r4 = i1.getMatchingItem("bla", >> "blaBla", "main", null); >> + Assert.assertNotNull("r4 should be found", r4); >> + UnsignedAppletActionEntry r5 = i1.getMatchingItem("", >> "blaBla", "main", Arrays.asList(new String[]{"jar2", "jar1"})); >> + Assert.assertNotNull("r5 should be found", r5); >> + UnsignedAppletActionEntry r6 = i1.getMatchingItem(null, >> null, "main", Arrays.asList(new String[]{"jar2", "jar1"})); >> + Assert.assertNotNull("r6 should be found", r6); >> + UnsignedAppletActionEntry r7 = i1.getMatchingItem(null, >> null, "main", Arrays.asList(new String[]{"jar2", "jar11"})); >> + Assert.assertNull("r7 should NOT be found", r7); >> + >> + >> + } >> +} >> diff -r e631770d76ba >> tests/netx/unit/net/sourceforge/jnlp/util/lockingfile/LockingStringListStorageTest.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ >> b/tests/netx/unit/net/sourceforge/jnlp/util/lockingfile/LockingStringListStorageTest.java >> Fri Feb 01 20:55:48 2013 +0100 >> @@ -0,0 +1,385 @@ >> +/* >> +Copyright (C) 2013 Red Hat >> + >> +This program 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 of the License, or >> +(at your option) any later version. >> + >> +This program 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 this program; if not, write to the Free Software >> +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA >> +*/ >> + >> +package net.sourceforge.jnlp.util.lockingfile; >> + >> +import static org.junit.Assert.assertFalse; >> +import static org.junit.Assert.assertTrue; >> +import org.junit.Before; >> +import java.io.BufferedWriter; >> +import java.io.File; >> +import java.io.IOException; >> +import java.util.ArrayList; >> +import java.util.List; >> +import org.junit.Assert; >> +import org.junit.Test; >> + >> + >> + >> +public class LockingStringListStorageTest { >> + >> +/** >> + * Process-locked string storage backed by a file. >> + * Each string is stored on its own line. >> + * Any new-lines must be encoded somehow if they are to be stored. >> + */ >> +public static class LockingStringListStorage extends >> LockingReaderWriter { >> + >> + private List cachedContents = new ArrayList(); >> + >> + //To sutisfy testengine, void constructor and dummy testmethod >> + public LockingStringListStorage() throws IOException { >> + this(createTmpBackend()); >> + } >> + >> + @Test >> + public void lockingStringListStorageCanBeInstantiated(){ >> + Assert.assertNotNull(this); >> + } >> + >> + >> + private static File createTmpBackend() throws IOException{ >> + File f = File.createTempFile("forTests","emptyConstructor"); >> + f.deleteOnExit(); >> + return f; >> + } >> + >> + >> + /** >> + * Create locking file-backed storage. >> + * @param file the storage file >> + */ >> + public LockingStringListStorage(File file) { >> + super(file); >> + } >> + >> + /** >> + * Get the underlying string list cache. Should lock >> + * before using. >> + * @return the cache >> + */ >> + final protected List getCachedContents() { >> + return cachedContents; >> + } >> + >> + @Override >> + public void writeContent(BufferedWriter writer) throws >> IOException { >> + for (String string : cachedContents) { >> + writer.write(string); >> + writer.newLine(); >> + } >> + } >> + >> + @Override >> + protected void readLine(String line) { >> + this.cachedContents.add(line); >> + } >> + >> + @Override >> + protected void readContents() throws IOException { >> + cachedContents.clear(); >> + super.readContents(); >> + } >> + >> + /* >> + * Atomic container abstraction methods. These all allow the >> file-backed >> + * string list to be treated as a convenient in-memory object. >> + */ >> + /** >> + * Appends the specified line to the end of the storage. >> + * >> + * @param line the line to add >> + */ >> + synchronized public void add(final String line) { >> + doLocked(new Runnable() { >> + >> + public void run() { >> + try { >> + readContents(); >> + cachedContents.add(line); >> + writeContents(); >> + } catch (IOException ex) { >> + throw new StorageIoException(ex); >> + } >> + } >> + }); >> + } >> + >> + /** >> + * Returns an array containing all of the lines in the storage. >> + * >> + * @return an array of the stored strings >> + */ >> + synchronized public String[] toArray() { >> + lock(); >> + try { >> + readContents(); >> + return cachedContents.toArray(new String[]{}); >> + } catch (IOException e) { >> + throw new StorageIoException(e); >> + } finally { >> + unlock(); >> + } >> + } >> + >> + /** >> + * Returns amount of lines in the storage. >> + * >> + * @return amount of stored strings >> + */ >> + synchronized public int size() { >> + lock(); >> + try { >> + readContents(); >> + return cachedContents.size(); >> + } catch (IOException e) { >> + throw new StorageIoException(e); >> + } finally { >> + unlock(); >> + } >> + } >> + >> + /** >> + * Returns 'i'th line >> + * >> + * @return the line >> + */ >> + synchronized public String get(int i) { >> + lock(); >> + try { >> + readContents(); >> + return cachedContents.get(i); >> + } catch (IOException e) { >> + throw new StorageIoException(e); >> + } finally { >> + unlock(); >> + } >> + } >> + >> + /** >> + * Set the 'i'th line >> + * >> + * @param line the new line >> + */ >> + synchronized public String set(int i, String line) { >> + lock(); >> + try { >> + readContents(); >> + return cachedContents.set(i, line); >> + } catch (IOException e) { >> + throw new StorageIoException(e); >> + } finally { >> + unlock(); >> + } >> + } >> + >> + /** >> + * Returns a copied list containing all of the lines in the >> storage. >> + * >> + * @return a list of the stored strings >> + */ >> + synchronized public List toList() { >> + lock(); >> + try { >> + readContents(); >> + return new ArrayList(cachedContents); >> + } catch (IOException e) { >> + throw new StorageIoException(e); >> + } finally { >> + unlock(); >> + } >> + } >> + >> + /** >> + * Returns true if the storage contains the specified >> element. >> + * >> + * @param line >> + * @return true if the storage contains the line >> + */ >> + synchronized public boolean contains(String line) { >> + lock(); >> + try { >> + readContents(); >> + return cachedContents.contains(line); >> + } catch (IOException e) { >> + throw new StorageIoException(e); >> + } finally { >> + unlock(); >> + } >> + } >> + >> + /** >> + * Empty the storage. >> + */ >> + synchronized public void clear() { >> + lock(); >> + try { >> + cachedContents.clear(); >> + writeContents(); >> + } catch (IOException e) { >> + throw new StorageIoException(e); >> + } finally { >> + unlock(); >> + } >> + } >> + >> + /** >> + * Removes the first occurrence of the specified element from >> this list, >> + * if it is present (optional operation). If this list does not >> contain >> + * the element, it is unchanged. >> + * >> + * @param line string to be removed from this list, if present >> + * @return true if the storage contained the line >> + */ >> + synchronized public boolean remove(String line) { >> + boolean didRemove; >> + >> + lock(); >> + try { >> + readContents(); >> + didRemove = cachedContents.remove(line); >> + writeContents(); >> + } catch (IOException e) { >> + throw new StorageIoException(e); >> + } finally { >> + unlock(); >> + } >> + >> + return didRemove; >> + } >> +} >> + >> + >> + private static File storagefile; >> + >> + private static LockingStringListStorage newInstance() { >> + return new LockingStringListStorage(storagefile); >> + } >> + >> + @Before >> + public void setUp() throws IOException { >> + storagefile = File.createTempFile("foo", "bar"); >> + } >> + >> + @Test >> + public void testSimpleActions() throws IOException { >> + LockingStringListStorage storage = newInstance(); >> + >> + storage.add("teststring"); >> + assertTrue(storage.contains("teststring")); >> + storage.remove("teststring"); >> + assertFalse(storage.contains("teststring")); >> + } >> + >> + @Test >> + public void testInterleavedActions() throws IOException { >> + LockingStringListStorage storage1 = newInstance(); >> + LockingStringListStorage storage2 = newInstance(); >> + >> + storage1.add("teststring"); >> + assertTrue(storage2.contains("teststring")); >> + storage2.remove("teststring"); >> + assertFalse(storage1.contains("teststring")); >> + } >> + >> + static class TestThread extends Thread { >> + String testString; >> + int iterations; >> + Throwable error = null; >> + >> + TestThread(String testString, int iterations) { >> + this.testString = testString; >> + this.iterations = iterations; >> + } >> + >> + @Override >> + public void run() { >> + try { >> + LockingStringListStorage storage = newInstance(); >> + for (int i = 0; i < iterations; i++) { >> + assertTrue(storage.contains(this.testString)); >> + storage.add(this.testString); >> + storage.remove(this.testString); >> + assertTrue(storage.contains(this.testString)); >> + } >> + } catch (Throwable error) { >> + error.printStackTrace(); >> + this.error = error; >> + } >> + } >> + } >> + >> + private void concurrentReadWrites(int threadAmount, int iterations, >> + String testString) throws InterruptedException { >> + LockingStringListStorage storage = newInstance(); >> + >> + storage.add(testString); >> + >> + List testThreads = new ArrayList(); >> + >> + for (int i = 0; i < threadAmount; i++) { >> + TestThread thread = new TestThread(testString, iterations); >> + testThreads.add(thread); >> + thread.start(); >> + } >> + >> + for (int i = 0; i < threadAmount; i++) { >> + testThreads.get(i).join(); >> + } >> + >> + assertTrue(storage.contains(testString)); >> + storage.remove(testString); >> + >> + // So long as number adds == number writes, we should be >> left with >> + // nothing at end. >> + assertFalse(storage.contains(testString)); >> + } >> + >> + // Long testing string, the contents are not important >> + private String makeLongTestString() { >> + StringBuilder sb = new StringBuilder(); >> + for (int i = 0; i < 1000; i++) { >> + sb.append(Integer.toString(i)); >> + } >> + return sb.toString(); >> + } >> + >> + @Test >> + public void testManyReadWrite() throws Exception { >> + int oneThread = 1; >> + String shortString = "teststring"; >> + >> + // This was causing 'too many open files' because >> FileUtils#getFileLock >> + // leaks file descriptors. No longer used. >> + concurrentReadWrites(oneThread, 500 /* iterations */, >> + shortString); >> + } >> + >> + @Test >> + public void testManyThreads() throws Exception { >> + int threadAmount = 25; >> + String shortString = "teststring"; >> + String longString = makeLongTestString(); >> + >> + concurrentReadWrites(threadAmount, 10 /* per-thread >> iterations */, >> + shortString); >> + concurrentReadWrites(threadAmount, 2 /* per-thread >> iterations */, >> + longString); >> + } >> + >> +} > > In conclusion, nits are nits, but I really want to see this in HEAD > :-)) Great work on the icedtea-web-settings parts. > > Happy hacking, > -Adam Actually maybe hold off until Omair comments on the patch, and all the typos have been worked out. 1) Some additional comments: - The delete pop-up is awkward, doing 'delete all' could easily create a pop-up that stretches more than the screen, hiding the confirmation. - Additionally the delete button is hard to visually locate. I think selecting things and pressing 'delete' should delete them. - Help button does nothing ATM, correct ? (its OK for now but just double checking) 2) I have attached my patch, although take note of the following: - I had to fix an issue where applets without any jars said they were 'signing', not showing the dialogue. Note though that they were still not given any permissions, so there was no security hole. - Your LockingFile as-was did not recursively lock correctly. I had to fix it so I could recursively lock to make sure that updating the dialogue is an atomic operation. However I still prefer my refactoring of Locking File. -Even still it seems like multiple applet entries can sneak their way in, making it impossible to properly update the stored action (because simple 'yes/no's are stored...). Might need to put the most recent decision at the top of the list, or match starting from the bottom, just in case duplicates do sneak in. I am in favour though of dropping simple yes/no's being stored. 3) We need to decide if we are going to backport this: - This patch will have some odd behaviour unless my initialization fixes go in, but I fear they cannot all be backported. - The other option is to, for backporting purposes, instead of trying to show one pop-up for all the applets that share a classloader, we can show one pop-up for each applet (as Oracle does). That will circumvent the issues with classloader initialization/deinitialization. Thanks, -Adam -------------- next part -------------- A non-text attachment was scrubbed... Name: integrated-dialogue.patch Type: text/x-patch Size: 29098 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130204/0cbc87ff/integrated-dialogue.patch From omajid at icedtea.classpath.org Mon Feb 4 16:17:51 2013 From: omajid at icedtea.classpath.org (omajid at icedtea.classpath.org) Date: Tue, 05 Feb 2013 00:17:51 +0000 Subject: /hg/release/icedtea6-1.12: 5 new changesets Message-ID: changeset 62dd6aa7c604 in /hg/release/icedtea6-1.12 details: http://icedtea.classpath.org/hg/release/icedtea6-1.12?cmd=changeset;node=62dd6aa7c604 author: Omair Majid date: Mon Feb 04 00:51:04 2013 -0500 Add the 2013-02-01 Security Fixes 2013-02-04 Andrew John Hughes Omair Majid * Makefile.am: (SECURITY_PATCHES): Add latest batch. * patches/openjdk/7162902-corba_fixes.patch, * patches/openjdk/6633275-shaped_translucent_windows.patch: Regenerated against security patches. * patches/security/20120612/7145239.patch, * patches/security/20130201/6563318.patch, * patches/security/20130201/6664509.patch, * patches/security/20130201/6776941.patch, * patches/security/20130201/7141694.patch, * patches/security/20130201/7173145.patch, * patches/security/20130201/7186945.patch, * patches/security/20130201/7186948.patch, * patches/security/20130201/7186952.patch, * patches/security/20130201/7186954.patch, * patches/security/20130201/7192392.patch, * patches/security/20130201/7192393.patch, * patches/security/20130201/7192977.patch, * patches/security/20130201/7197546.patch, * patches/security/20130201/7200491.patch, * patches/security/20130201/7200500.patch, * patches/security/20130201/7201064.patch, * patches/security/20130201/7201066.patch, * patches/security/20130201/7201068.patch, * patches/security/20130201/7201070.patch, * patches/security/20130201/7201071.patch, * patches/security/20130201/8000210.patch, * patches/security/20130201/8000537.patch, * patches/security/20130201/8000540.patch, * patches/security/20130201/8000631.patch, * patches/security/20130201/8001235.patch, * patches/security/20130201/8001242.patch, * patches/security/20130201/8001307.patch, * patches/security/20130201/8001972.patch, * patches/security/20130201/8002325.patch: New security patches for 2013/02/01 errata. changeset 1ca45d31afce in /hg/release/icedtea6-1.12 details: http://icedtea.classpath.org/hg/release/icedtea6-1.12?cmd=changeset;node=1ca45d31afce author: Omair Majid date: Mon Feb 04 00:59:08 2013 -0500 S7010849: 5/5 Extraneous javac source/target options when building sa-jdi 2013-02-04 Andrew John Hughes Omair Majid * Makefile.am: (ICEDTEA_PATCHES): Add 7010849 backport. (ICEDTEA_ECJ_PATCHES): Remove 7010849 backport. * patches/ecj/7010849-make_sa-jdi_build_with_1.5.patch: Rename to ... * patches/openjdk/7010849-modernise_sa.patch: New file. changeset 76bd26205c60 in /hg/release/icedtea6-1.12 details: http://icedtea.classpath.org/hg/release/icedtea6-1.12?cmd=changeset;node=76bd26205c60 author: Omair Majid date: Mon Feb 04 01:03:56 2013 -0500 Add security fixes to NEWS. 2013-02-04 Andrew John Hughes * NEWS: Add security fixes. changeset 63fea6a4bee0 in /hg/release/icedtea6-1.12 details: http://icedtea.classpath.org/hg/release/icedtea6-1.12?cmd=changeset;node=63fea6a4bee0 author: Omair Majid date: Mon Feb 04 01:07:39 2013 -0500 Bump to 1.12.1 and set release date 2013-02-04 Andrew John Hughes Omair Majid * NEWS: Add release date. * configure.ac: Bump to 1.12.1. changeset 1d484ae64eb7 in /hg/release/icedtea6-1.12 details: http://icedtea.classpath.org/hg/release/icedtea6-1.12?cmd=changeset;node=1d484ae64eb7 author: Omair Majid date: Mon Feb 04 17:59:40 2013 -0500 Added tag icedtea6-1.12.1 for changeset 63fea6a4bee0 diffstat: .hgtags | 1 + ChangeLog | 59 + Makefile.am | 35 +- NEWS | 37 +- configure.ac | 2 +- patches/ecj/7010849-make_sa-jdi_build_with_1.5.patch | 394 - patches/openjdk/6633275-shaped_translucent_windows.patch | 28 +- patches/openjdk/7010849-modernise_sa.patch | 394 + patches/openjdk/7162902-corba_fixes.patch | 19 +- patches/security/20130201/6563318.patch | 36 + patches/security/20130201/6664509.patch | 1322 + patches/security/20130201/6776941.patch | 272 + patches/security/20130201/7141694.patch | 87 + patches/security/20130201/7173145.patch | 22 + patches/security/20130201/7186945.patch | 10819 +++++++++++++ patches/security/20130201/7186948.patch | 20 + patches/security/20130201/7186952.patch | 127 + patches/security/20130201/7186954.patch | 81 + patches/security/20130201/7192392.patch | 695 + patches/security/20130201/7192393.patch | 60 + patches/security/20130201/7192977.patch | 436 + patches/security/20130201/7197546.patch | 479 + patches/security/20130201/7200491.patch | 49 + patches/security/20130201/7200500.patch | 60 + patches/security/20130201/7201064.patch | 117 + patches/security/20130201/7201066.patch | 66 + patches/security/20130201/7201068.patch | 83 + patches/security/20130201/7201070.patch | 31 + patches/security/20130201/7201071.patch | 553 + patches/security/20130201/8000210.patch | 104 + patches/security/20130201/8000537.patch | 334 + patches/security/20130201/8000540.patch | 187 + patches/security/20130201/8000631.patch | 3964 ++++ patches/security/20130201/8001235.patch | 36 + patches/security/20130201/8001242.patch | 61 + patches/security/20130201/8001307.patch | 27 + patches/security/20130201/8001972.patch | 438 + patches/security/20130201/8002325.patch | 59 + 38 files changed, 21164 insertions(+), 430 deletions(-) diffs (truncated from 21840 to 500 lines): diff -r c3d7a7f46fcb -r 1d484ae64eb7 .hgtags --- a/.hgtags Tue Jan 29 20:53:39 2013 +0000 +++ b/.hgtags Mon Feb 04 17:59:40 2013 -0500 @@ -23,3 +23,4 @@ 24c5bd2e7d574441813bfb8f9e4636e50c5d7c28 icedtea6-1.11-branchpoint 5a1e1b39664409e9a0945ba49b558f25ef976c58 icedtea6-1.12-branchpoint 69b6ee29712304225f57535e507e6745e478ae9e icedtea6-1.12 +63fea6a4bee0e2e8ecb9f2061dba92be4924ddb4 icedtea6-1.12.1 diff -r c3d7a7f46fcb -r 1d484ae64eb7 ChangeLog --- a/ChangeLog Tue Jan 29 20:53:39 2013 +0000 +++ b/ChangeLog Mon Feb 04 17:59:40 2013 -0500 @@ -1,3 +1,62 @@ +2013-02-04 Andrew John Hughes + Omair Majid + + * NEWS: Add release date. + * configure.ac: Bump to 1.12.1. + +2013-02-04 Andrew John Hughes + + * NEWS: Add security fixes. + +2013-02-04 Andrew John Hughes + Omair Majid + + * Makefile.am: + (ICEDTEA_PATCHES): Add 7010849 backport. + (ICEDTEA_ECJ_PATCHES): Remove 7010849 backport. + * patches/ecj/7010849-make_sa-jdi_build_with_1.5.patch: Rename to ... + * patches/openjdk/7010849-modernise_sa.patch: New file. + +2013-02-04 Andrew John Hughes + Omair Majid + + * Makefile.am: + (SECURITY_PATCHES): Add latest batch. + * patches/openjdk/7162902-corba_fixes.patch, + * patches/openjdk/6633275-shaped_translucent_windows.patch: + Regenerated against security patches. + * patches/security/20120612/7145239.patch, + * patches/security/20130201/6563318.patch, + * patches/security/20130201/6664509.patch, + * patches/security/20130201/6776941.patch, + * patches/security/20130201/7141694.patch, + * patches/security/20130201/7173145.patch, + * patches/security/20130201/7186945.patch, + * patches/security/20130201/7186948.patch, + * patches/security/20130201/7186952.patch, + * patches/security/20130201/7186954.patch, + * patches/security/20130201/7192392.patch, + * patches/security/20130201/7192393.patch, + * patches/security/20130201/7192977.patch, + * patches/security/20130201/7197546.patch, + * patches/security/20130201/7200491.patch, + * patches/security/20130201/7200500.patch, + * patches/security/20130201/7201064.patch, + * patches/security/20130201/7201066.patch, + * patches/security/20130201/7201068.patch, + * patches/security/20130201/7201070.patch, + * patches/security/20130201/7201071.patch, + * patches/security/20130201/8000210.patch, + * patches/security/20130201/8000537.patch, + * patches/security/20130201/8000540.patch, + * patches/security/20130201/8000631.patch, + * patches/security/20130201/8001235.patch, + * patches/security/20130201/8001242.patch, + * patches/security/20130201/8001307.patch, + * patches/security/20130201/8001972.patch, + * patches/security/20130201/8002325.patch: + New security patches for 2013/02/01 errata. + 2013-01-29 Andrew John Hughes * NEWS: Use the correct year; it is diff -r c3d7a7f46fcb -r 1d484ae64eb7 Makefile.am --- a/Makefile.am Tue Jan 29 20:53:39 2013 +0000 +++ b/Makefile.am Mon Feb 04 17:59:40 2013 -0500 @@ -245,7 +245,36 @@ ICEDTEA_FSG_PATCHES = SECURITY_PATCHES = \ - patches/security/20120830/7182135-impossible_to_use_some_editors_directly.patch + patches/security/20120830/7182135-impossible_to_use_some_editors_directly.patch \ + patches/security/20130201/7201068.patch \ + patches/security/20130201/6563318.patch \ + patches/security/20130201/6664509.patch \ + patches/security/20130201/6776941.patch \ + patches/security/20130201/7141694.patch \ + patches/security/20130201/7173145.patch \ + patches/security/20130201/7186945.patch \ + patches/security/20130201/7186948.patch \ + patches/security/20130201/7186952.patch \ + patches/security/20130201/7186954.patch \ + patches/security/20130201/7192392.patch \ + patches/security/20130201/7192393.patch \ + patches/security/20130201/7192977.patch \ + patches/security/20130201/7197546.patch \ + patches/security/20130201/7200491.patch \ + patches/security/20130201/7200500.patch \ + patches/security/20130201/7201064.patch \ + patches/security/20130201/7201066.patch \ + patches/security/20130201/7201070.patch \ + patches/security/20130201/7201071.patch \ + patches/security/20130201/8000210.patch \ + patches/security/20130201/8000537.patch \ + patches/security/20130201/8000540.patch \ + patches/security/20130201/8000631.patch \ + patches/security/20130201/8001242.patch \ + patches/security/20130201/8001307.patch \ + patches/security/20130201/8001972.patch \ + patches/security/20130201/8002325.patch \ + patches/security/20130201/8001235.patch SPECIAL_SECURITY_PATCH = patches/security/20120214/7112642.patch @@ -470,7 +499,8 @@ patches/openjdk/6763340-corba_memory_leak.patch \ patches/openjdk/6980681-corba_deadlock.patch \ patches/openjdk/7162902-corba_fixes.patch \ - patches/traceable.patch + patches/traceable.patch \ + patches/openjdk/7010849-modernise_sa.patch if WITH_RHINO ICEDTEA_PATCHES += \ @@ -527,7 +557,6 @@ # Bootstrapping patches ICEDTEA_ECJ_PATCHES = \ - patches/ecj/7010849-make_sa-jdi_build_with_1.5.patch \ patches/ecj/icedtea.patch \ patches/ecj/javafiles.patch \ patches/ecj/spp.patch \ diff -r c3d7a7f46fcb -r 1d484ae64eb7 NEWS --- a/NEWS Tue Jan 29 20:53:39 2013 +0000 +++ b/NEWS Mon Feb 04 17:59:40 2013 -0500 @@ -10,7 +10,41 @@ CVE-XXXX-YYYY: http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY -New in release 1.12.1 (2012-02-XX): +New in release 1.12.1 (2012-02-04): + +* Security fixes + - S6563318, CVE-2013-0424: RMI data sanitization + - S6664509, CVE-2013-0425: Add logging context + - S6664528, CVE-2013-0426: Find log level matching its name or value given at construction time + - S6776941: CVE-2013-0427: Improve thread pool shutdown + - S7141694, CVE-2013-0429: Improving CORBA internals + - S7173145: Improve in-memory representation of splashscreens + - S7186945: Unpack200 improvement + - S7186946: Refine unpacker resource usage + - S7186948: Improve Swing data validation + - S7186952, CVE-2013-0432: Improve clipboard access + - S7186954: Improve connection performance + - S7186957: Improve Pack200 data validation + - S7192392, CVE-2013-0443: Better validation of client keys + - S7192393, CVE-2013-0440: Better Checking of order of TLS Messages + - S7192977, CVE-2013-0442: Issue in toolkit thread + - S7197546, CVE-2013-0428: (proxy) Reflect about creating reflective proxies + - S7200491: Tighten up JTable layout code + - S7200500: Launcher better input validation + - S7201064: Better dialogue checking + - S7201066, CVE-2013-0441: Change modifiers on unused fields + - S7201068, CVE-2013-0435: Better handling of UI elements + - S7201070: Serialization to conform to protocol + - S7201071, CVE-2013-0433: InetSocketAddress serialization issue + - S8000210: Improve JarFile code quality + - S8000537, CVE-2013-0450: Contextualize RequiredModelMBean class + - S8000540, CVE-2013-1475: Improve IIOP type reuse management + - S8000631, CVE-2013-1476: Restrict access to class constructor + - S8001235, CVE-2013-0434: Improve JAXP HTTP handling + - S8001242: Improve RMI HTTP conformance + - S8001307: Modify ACC_SUPER behavior + - S8001972, CVE-2013-1478: Improve image processing + - S8002325, CVE-2013-1480: Improve management of images New in release 1.12.0 (2013-01-29): @@ -101,6 +135,7 @@ * SystemTap - Addition of garbage collection probes + New in release 1.11.5 (2012-10-16): * Security fixes diff -r c3d7a7f46fcb -r 1d484ae64eb7 configure.ac --- a/configure.ac Tue Jan 29 20:53:39 2013 +0000 +++ b/configure.ac Mon Feb 04 17:59:40 2013 -0500 @@ -1,4 +1,4 @@ -AC_INIT([icedtea6],[1.12.1pre],[distro-pkg-dev at openjdk.java.net]) +AC_INIT([icedtea6],[1.12.1],[distro-pkg-dev at openjdk.java.net]) AM_INIT_AUTOMAKE([1.9 tar-pax foreign]) AC_CONFIG_FILES([Makefile]) diff -r c3d7a7f46fcb -r 1d484ae64eb7 patches/ecj/7010849-make_sa-jdi_build_with_1.5.patch --- a/patches/ecj/7010849-make_sa-jdi_build_with_1.5.patch Tue Jan 29 20:53:39 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,394 +0,0 @@ -# HG changeset patch -# User andrew -# Date 1301696137 25200 -# Node ID 37be97a5839376b2d2fa1d2ac1ab3a6cbe0653d0 -# Parent b025bffd6c2ca81c7c08f0dd2f4b2e0ba3223c05 -7010849: 5/5 Extraneous javac source/target options when building sa-jdi -Summary: Make code changes necessary to get rid of the '-source 1.4 -target 1.4' options. -Reviewed-by: dholmes, dcubed - -diff --git a/agent/src/share/classes/sun/jvm/hotspot/HelloWorld.java b/agent/src/share/classes/sun/jvm/hotspot/HelloWorld.java ---- openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/HelloWorld.java -+++ openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/HelloWorld.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2000, 2011, 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 -@@ -55,7 +55,7 @@ - synchronized(lock) { - if (useMethodInvoke) { - try { -- Method method = HelloWorld.class.getMethod("e", null); -+ Method method = HelloWorld.class.getMethod("e"); - Integer result = (Integer) method.invoke(null, new Object[0]); - return result.intValue(); - } -diff --git a/agent/src/share/classes/sun/jvm/hotspot/jdi/ByteValueImpl.java b/agent/src/share/classes/sun/jvm/hotspot/jdi/ByteValueImpl.java ---- openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ByteValueImpl.java -+++ openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ByteValueImpl.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2002, 2011, 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 -@@ -52,12 +52,10 @@ - return intValue(); - } - -- public int compareTo(Object obj) { -- byte other = ((ByteValue)obj).value(); -- return value() - other; -+ public int compareTo(ByteValue byteVal) { -+ return value() - byteVal.value(); - } - -- - public Type type() { - return vm.theByteType(); - } -diff --git a/agent/src/share/classes/sun/jvm/hotspot/jdi/CharValueImpl.java b/agent/src/share/classes/sun/jvm/hotspot/jdi/CharValueImpl.java ---- openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/CharValueImpl.java -+++ openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/CharValueImpl.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2002, 2011, 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 -@@ -52,9 +52,8 @@ - return intValue(); - } - -- public int compareTo(Object obj) { -- char other = ((CharValue)obj).value(); -- return value() - other; -+ public int compareTo(CharValue charVal) { -+ return value() - charVal.value(); - } - - public Type type() { -diff --git a/agent/src/share/classes/sun/jvm/hotspot/jdi/ConnectorImpl.java b/agent/src/share/classes/sun/jvm/hotspot/jdi/ConnectorImpl.java ---- openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ConnectorImpl.java -+++ openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ConnectorImpl.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2002, 2011, 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 -@@ -186,7 +186,7 @@ - // assert isVMVersionMismatch(throwable), "not a VMVersionMismatch" - Class expClass = throwable.getClass(); - Method targetVersionMethod = expClass.getMethod("getTargetVersion", new Class[0]); -- return (String) targetVersionMethod.invoke(throwable, null); -+ return (String) targetVersionMethod.invoke(throwable); - } - - /** If the causal chain has a sun.jvm.hotspot.runtime.VMVersionMismatchException, -diff --git a/agent/src/share/classes/sun/jvm/hotspot/jdi/DoubleValueImpl.java b/agent/src/share/classes/sun/jvm/hotspot/jdi/DoubleValueImpl.java ---- openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/DoubleValueImpl.java -+++ openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/DoubleValueImpl.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2002, 2011, 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 -@@ -45,8 +45,8 @@ - } - } - -- public int compareTo(Object obj) { -- double other = ((DoubleValue)obj).value(); -+ public int compareTo(DoubleValue doubleVal) { -+ double other = doubleVal.value(); - if (value() < other) { - return -1; - } else if (value() == other) { -diff --git a/agent/src/share/classes/sun/jvm/hotspot/jdi/FieldImpl.java b/agent/src/share/classes/sun/jvm/hotspot/jdi/FieldImpl.java ---- openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/FieldImpl.java -+++ openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/FieldImpl.java -@@ -145,8 +145,7 @@ - } - - // From interface Comparable -- public int compareTo(Object object) { -- Field field = (Field)object; -+ public int compareTo(Field field) { - ReferenceTypeImpl declaringType = (ReferenceTypeImpl)declaringType(); - int rc = declaringType.compareTo(field.declaringType()); - if (rc == 0) { -diff --git a/agent/src/share/classes/sun/jvm/hotspot/jdi/FloatValueImpl.java b/agent/src/share/classes/sun/jvm/hotspot/jdi/FloatValueImpl.java ---- openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/FloatValueImpl.java -+++ openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/FloatValueImpl.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2002, 2011, 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 -@@ -52,8 +52,8 @@ - return intValue(); - } - -- public int compareTo(Object obj) { -- float other = ((FloatValue)obj).value(); -+ public int compareTo(FloatValue floatVal) { -+ float other = floatVal.value(); - if (value() < other) { - return -1; - } else if (value() == other) { -diff --git a/agent/src/share/classes/sun/jvm/hotspot/jdi/IntegerValueImpl.java b/agent/src/share/classes/sun/jvm/hotspot/jdi/IntegerValueImpl.java ---- openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/IntegerValueImpl.java -+++ openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/IntegerValueImpl.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2002, 2011, 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 -@@ -52,9 +52,8 @@ - return intValue(); - } - -- public int compareTo(Object obj) { -- int other = ((IntegerValue)obj).value(); -- return value() - other; -+ public int compareTo(IntegerValue integerVal) { -+ return value() - integerVal.value(); - } - - public Type type() { -diff --git a/agent/src/share/classes/sun/jvm/hotspot/jdi/LocalVariableImpl.java b/agent/src/share/classes/sun/jvm/hotspot/jdi/LocalVariableImpl.java ---- openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LocalVariableImpl.java -+++ openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LocalVariableImpl.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2002, 2011, 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 -@@ -67,8 +67,8 @@ - return (int)method.hashCode() + slot(); - } - -- public int compareTo(Object object) { -- LocalVariableImpl other = (LocalVariableImpl)object; -+ public int compareTo(LocalVariable localVar) { -+ LocalVariableImpl other = (LocalVariableImpl) localVar; - int rc = method.compareTo(other.method); - if (rc == 0) { - rc = slot() - other.slot(); -diff --git a/agent/src/share/classes/sun/jvm/hotspot/jdi/LocationImpl.java b/agent/src/share/classes/sun/jvm/hotspot/jdi/LocationImpl.java ---- openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LocationImpl.java -+++ openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LocationImpl.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2002, 2011, 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 -@@ -78,8 +78,7 @@ - return method().hashCode() + (int)codeIndex(); - } - -- public int compareTo(Object object) { -- LocationImpl other = (LocationImpl)object; -+ public int compareTo(Location other) { - int rc = method().compareTo(other.method()); - if (rc == 0) { - long diff = codeIndex() - other.codeIndex(); -diff --git a/agent/src/share/classes/sun/jvm/hotspot/jdi/LongValueImpl.java b/agent/src/share/classes/sun/jvm/hotspot/jdi/LongValueImpl.java ---- openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LongValueImpl.java -+++ openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LongValueImpl.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2002, 2011, 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 -@@ -52,8 +52,8 @@ - return intValue(); - } - -- public int compareTo(Object obj) { -- long other = ((LongValue)obj).value(); -+ public int compareTo(LongValue longVal) { -+ long other = longVal.value(); - if (value() < other) { - return -1; - } else if (value() == other) { -diff --git a/agent/src/share/classes/sun/jvm/hotspot/jdi/MethodImpl.java b/agent/src/share/classes/sun/jvm/hotspot/jdi/MethodImpl.java ---- openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/MethodImpl.java -+++ openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/MethodImpl.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2002, 2011, 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 -@@ -200,8 +200,7 @@ - } - - // From interface Comparable -- public int compareTo(Object object) { -- Method method = (Method)object; -+ public int compareTo(Method method) { - ReferenceTypeImpl declaringType = (ReferenceTypeImpl)declaringType(); - int rc = declaringType.compareTo(method.declaringType()); - if (rc == 0) { -diff --git a/agent/src/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java b/agent/src/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java ---- openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java -+++ openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2002, 2011, 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 -@@ -99,7 +99,7 @@ - return saKlass.hashCode(); - } - -- public int compareTo(Object object) { -+ public int compareTo(ReferenceType refType) { - /* - * Note that it is critical that compareTo() == 0 - * implies that equals() == true. Otherwise, TreeSet -@@ -108,7 +108,7 @@ - * (Classes of the same name loaded by different class loaders - * or in different VMs must not return 0). - */ -- ReferenceTypeImpl other = (ReferenceTypeImpl)object; -+ ReferenceTypeImpl other = (ReferenceTypeImpl)refType; - int comp = name().compareTo(other.name()); - if (comp == 0) { - Oop rf1 = ref(); -diff --git a/agent/src/share/classes/sun/jvm/hotspot/jdi/ShortValueImpl.java b/agent/src/share/classes/sun/jvm/hotspot/jdi/ShortValueImpl.java ---- openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ShortValueImpl.java -+++ openjdk-ecj/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ShortValueImpl.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2002, 2011, 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 -@@ -52,9 +52,8 @@ - return intValue(); - } - -- public int compareTo(Object obj) { -- short other = ((ShortValue)obj).value(); -- return value() - other; -+ public int compareTo(ShortValue shortVal) { -+ return value() - shortVal.value(); From bugzilla-daemon at icedtea.classpath.org Mon Feb 4 16:34:58 2013 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 05 Feb 2013 00:34:58 +0000 Subject: [Bug 1296] -Xshare:dump causes Zero to crash In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1296 Andrew John Hughes changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gnu.andrew at redhat.com Summary|[regression] Zero is broken |-Xshare:dump causes Zero to |in 6-1.12 |crash Severity|major |normal --- Comment #1 from Andrew John Hughes --- $ /home/andrew/build/zero6/bin/java -version java version "1.6.0_27" OpenJDK Runtime Environment (IcedTea6 1.12pre+r5c83d26b2437) (Gentoo build 1.6.0_27-b27) OpenJDK 64-Bit Zero VM (build 20.0-b12, interpreted mode) But I don't usually do full builds of Zero because of the time the second stage takes. I don't think this is a regression, but that -Xshare:dump has just never been used on Zero before. As a workaround, you should be able to just do make stamps/icedtea.stamp ; touch stamps/add-archive.stamp; make or patch Makefile.am to only run add-archive if !ZERO_BUILD. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130205/71dd4e2d/attachment.html From bugzilla-daemon at icedtea.classpath.org Mon Feb 4 16:36:11 2013 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 05 Feb 2013 00:36:11 +0000 Subject: [Bug 1296] -Xshare:dump causes Zero to crash In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1296 --- Comment #2 from Andrew John Hughes --- If it helps: Using host libthread_db library "/lib64/libthread_db.so.1". [New Thread 0x7ffff7fae700 (LWP 1971)] [New Thread 0x7ffff529a700 (LWP 1972)] Loading classes to share ... Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffff7fae700 (LWP 1971)] ObjectSynchronizer::slow_enter (obj=..., lock=0x7ffff7fab970, __the_thread__=0x7ffff00052e0) at /mnt/builder/zero6/openjdk-ecj/hotspot/src/share/vm/runtime/synchronizer.cpp:200 -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130205/6777bdf3/attachment.html From omajid at redhat.com Mon Feb 4 16:37:33 2013 From: omajid at redhat.com (Omair Majid) Date: Mon, 04 Feb 2013 19:37:33 -0500 Subject: [SECURITY] IcedTea6 1.12.1 Released! Message-ID: <5110544D.4060006@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The IcedTea project provides a harness to build the source code from OpenJDK6 using Free Software build tools, along with additional features such as a PulseAudio sound driver and support for alternative virtual machines. A new security release is now available: 1.12.1. The update contains the following security fixes: * S6563318, CVE-2013-0424: RMI data sanitization * S6664509, CVE-2013-0425: Add logging context * S6664528, CVE-2013-0426: Find log level matching its name or value given at construction time * S6776941: CVE-2013-0427: Improve thread pool shutdown * S7141694, CVE-2013-0429: Improving CORBA internals * S7173145: Improve in-memory representation of splashscreens * S7186945: Unpack200 improvement * S7186946: Refine unpacker resource usage * S7186948: Improve Swing data validation * S7186952, CVE-2013-0432: Improve clipboard access * S7186954: Improve connection performance * S7186957: Improve Pack200 data validation * S7192392, CVE-2013-0443: Better validation of client keys * S7192393, CVE-2013-0440: Better Checking of order of TLS Messages * S7192977, CVE-2013-0442: Issue in toolkit thread * S7197546, CVE-2013-0428: (proxy) Reflect about creating reflective proxies * S7200491: Tighten up JTable layout code * S7200500: Launcher better input validation * S7201064: Better dialogue checking * S7201066, CVE-2013-0441: Change modifiers on unused fields * S7201068, CVE-2013-0435: Better handling of UI elements * S7201070: Serialization to conform to protocol * S7201071, CVE-2013-0433: InetSocketAddress serialization issue * S8000210: Improve JarFile code quality * S8000537, CVE-2013-0450: Contextualize RequiredModelMBean class * S8000540, CVE-2013-1475: Improve IIOP type reuse management * S8000631, CVE-2013-1476: Restrict access to class constructor * S8001235, CVE-2013-0434: Improve JAXP HTTP handling * S8001242: Improve RMI HTTP conformance * S8001307: Modify ACC_SUPER behavior * S8001972, CVE-2013-1478: Improve image processing * S8002325, CVE-2013-1480: Improve management of images Full details can be found below. What's New __________ New in release 1.12.1 (2012-02-04): * Security fixes - S6563318, CVE-2013-0424: RMI data sanitization - S6664509, CVE-2013-0425: Add logging context - S6664528, CVE-2013-0426: Find log level matching its name or value given at construction time - S6776941: CVE-2013-0427: Improve thread pool shutdown - S7141694, CVE-2013-0429: Improving CORBA internals - S7173145: Improve in-memory representation of splashscreens - S7186945: Unpack200 improvement - S7186946: Refine unpacker resource usage - S7186948: Improve Swing data validation - S7186952, CVE-2013-0432: Improve clipboard access - S7186954: Improve connection performance - S7186957: Improve Pack200 data validation - S7192392, CVE-2013-0443: Better validation of client keys - S7192393, CVE-2013-0440: Better Checking of order of TLS Messages - S7192977, CVE-2013-0442: Issue in toolkit thread - S7197546, CVE-2013-0428: (proxy) Reflect about creating reflective proxies - S7200491: Tighten up JTable layout code - S7200500: Launcher better input validation - S7201064: Better dialogue checking - S7201066, CVE-2013-0441: Change modifiers on unused fields - S7201068, CVE-2013-0435: Better handling of UI elements - S7201070: Serialization to conform to protocol - S7201071, CVE-2013-0433: InetSocketAddress serialization issue - S8000210: Improve JarFile code quality - S8000537, CVE-2013-0450: Contextualize RequiredModelMBean class - S8000540, CVE-2013-1475: Improve IIOP type reuse management - S8000631, CVE-2013-1476: Restrict access to class constructor - S8001235, CVE-2013-0434: Improve JAXP HTTP handling - S8001242: Improve RMI HTTP conformance - S8001307: Modify ACC_SUPER behavior - S8001972, CVE-2013-1478: Improve image processing - S8002325, CVE-2013-1480: Improve management of images * Backports - S7010849: 5/5 Extraneous javac source/target options when building sa-jdi The tarball can be downloaded from: * http://icedtea.classpath.org/download/source/icedtea6-1.12.1.tar.gz SHA256 checksum: 8e73a3939ba8c2cca888defc6c90811c959273a9bc7bd1352338a72cefcf1157 icedtea6-1.12.1.tar.gz Each tarball is accompanied by a digital signature (available at the above URL + '.sig'). This is produced using my public key. See details below. The following people helped with these releases: * Andrew John Hughes (applying all security patches & backports, release testing) * Omair Majid (identification of ordering issues with security patches, porting security patches to 1.12) We would also like to thank the bug reporters and testers! To get started: $ tar xf icedtea6-1.12.1.tar.gz Full build requirements and instructions are in INSTALL: $ mkdir icedtea6-build $ cd icedtea6-build $ ../icedtea6-1.12.1/configure [--enable-zero --enable-pulse-java --enable-systemtap ...] $ make Happy hacking! - -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) iQIcBAEBAgAGBQJREFRMAAoJEPKG8U9mSEaBqb0P/3GgwxTdjrSU5I0aK3cL9Hh1 Dtv8ZpSGX560T2zzK4AzB3a+WZDd8Erw9fmHMS0d3qvMSaGfysPl0U1b9IDNzDEN 7nhHUKYkkN8/mfRxW84IvMj5A14kSUxUxSK1dxFo5xUQv4+9JBO5Hc+0JPEAnTsB HwOZgZITAUA8klYBO6/TV/ucvvlmU4G9OCJV86z7gUWDh29p4uWyyDb7gUdzT74Y AIgOep8Jehwi0WGzIT8uT/LyCKpoL98Fw42hfvDofUBbPPHBJAOm+XDa5QK2jP4n TxeedM6he9JntVjwKbxXEMLxG3r7rjSyVi9LuiO9Al4WegeE5xXj+iiQ2vviEUyb nkXP8WitONtVWSAtemYNGtWXE7A8LrnigWhMk6J2seENH5+6Nbhy6z98VresEjsa /MTalZQwTd31EQnBqc9rPjlrz7ZYMv/9ieW//iyIeu5n4yowbm5rXzlZ7SG/wet3 9+fNbfgS+Lr5WxCBtaVuNDQVY0uwZhVvUUkpzYREkusLjz2t8q69Xu7r+uu/qi3w ESHUlAjqjvI7xbyuoUwp8zzjyAbhAudsaH6gih1py5Ifq6lXzhygRnGDOqK5/XCl nEYEN+xZOBWmGsBX2cwn9VEDQq/cn5e6JjSngV/yvSXdLB/WMnomI46mlzKBx+l0 t9NPsQ7x3lfv4wPR2s/a =OeRQ -----END PGP SIGNATURE----- From bugzilla-daemon at icedtea.classpath.org Mon Feb 4 16:38:46 2013 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 05 Feb 2013 00:38:46 +0000 Subject: [Bug 1296] -Xshare:dump causes Zero to crash In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1296 --- Comment #3 from Andrew John Hughes --- Line 200 is: markOop mark = obj->mark(); and is the first line of: // Interpreter/Compiler Slow Case // This routine is used to handle interpreter/compiler slow case // We don't need to use fast path here, because it must have been // failed in the interpreter/compile code. void ObjectSynchronizer::slow_enter(Handle obj, BasicLock* lock, TRAPS) { I would guess obj is NULL. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130205/86633a4c/attachment.html From bugzilla-daemon at icedtea.classpath.org Mon Feb 4 16:54:29 2013 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 05 Feb 2013 00:54:29 +0000 Subject: [Bug 1296] -Xshare:dump causes Zero to crash In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1296 --- Comment #4 from Andrew John Hughes --- And it is: (gdb) print obj $1 = {_handle = 0x0} -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130205/eff713a3/attachment.html From omajid at icedtea.classpath.org Mon Feb 4 17:26:50 2013 From: omajid at icedtea.classpath.org (omajid at icedtea.classpath.org) Date: Tue, 05 Feb 2013 01:26:50 +0000 Subject: /hg/release/icedtea6-1.12: Prepare for 1.12.2 Message-ID: changeset 52124c9776fb in /hg/release/icedtea6-1.12 details: http://icedtea.classpath.org/hg/release/icedtea6-1.12?cmd=changeset;node=52124c9776fb author: Omair Majid date: Mon Feb 04 20:23:15 2013 -0500 Prepare for 1.12.2 2013-02-04 Omair Majid * NEWS: Fix release date of 1.12.1. Add new section. * configure.ac: Prepare for 1.12.2 diffstat: ChangeLog | 5 +++++ NEWS | 6 +++++- configure.ac | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diffs (44 lines): diff -r 1d484ae64eb7 -r 52124c9776fb ChangeLog --- a/ChangeLog Mon Feb 04 17:59:40 2013 -0500 +++ b/ChangeLog Mon Feb 04 20:23:15 2013 -0500 @@ -1,3 +1,8 @@ +2013-02-04 Omair Majid + + * NEWS: Fix release date of 1.12.1. Add new section. + * configure.ac: Prepare for 1.12.2 + 2013-02-04 Andrew John Hughes Omair Majid diff -r 1d484ae64eb7 -r 52124c9776fb NEWS --- a/NEWS Mon Feb 04 17:59:40 2013 -0500 +++ b/NEWS Mon Feb 04 20:23:15 2013 -0500 @@ -10,7 +10,9 @@ CVE-XXXX-YYYY: http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY -New in release 1.12.1 (2012-02-04): +New in release 1.12.2 (2013-XX-YY): + +New in release 1.12.1 (2013-02-04): * Security fixes - S6563318, CVE-2013-0424: RMI data sanitization @@ -45,6 +47,8 @@ - S8001307: Modify ACC_SUPER behavior - S8001972, CVE-2013-1478: Improve image processing - S8002325, CVE-2013-1480: Improve management of images +* Backports + - S7010849: 5/5 Extraneous javac source/target options when building sa-jdi New in release 1.12.0 (2013-01-29): diff -r 1d484ae64eb7 -r 52124c9776fb configure.ac --- a/configure.ac Mon Feb 04 17:59:40 2013 -0500 +++ b/configure.ac Mon Feb 04 20:23:15 2013 -0500 @@ -1,4 +1,4 @@ -AC_INIT([icedtea6],[1.12.1],[distro-pkg-dev at openjdk.java.net]) +AC_INIT([icedtea6],[1.12.2pre],[distro-pkg-dev at openjdk.java.net]) AM_INIT_AUTOMAKE([1.9 tar-pax foreign]) AC_CONFIG_FILES([Makefile]) From andrew at icedtea.classpath.org Tue Feb 5 00:36:34 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 05 Feb 2013 08:36:34 +0000 Subject: /hg/release/icedtea7-forest-2.2: Added tag icedtea-2.2.5 for cha... Message-ID: changeset ac5792f240c0 in /hg/release/icedtea7-forest-2.2 details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2?cmd=changeset;node=ac5792f240c0 author: andrew date: Tue Feb 05 08:35:49 2013 +0000 Added tag icedtea-2.2.5 for changeset 431257be5014 diffstat: .hgtags | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diffs (8 lines): diff -r 431257be5014 -r ac5792f240c0 .hgtags --- a/.hgtags Mon Jan 14 22:54:01 2013 +0000 +++ b/.hgtags Tue Feb 05 08:35:49 2013 +0000 @@ -178,3 +178,4 @@ 0b776ef594741d3c316eb6b7b4e2b53a23f5b942 icedtea-2.2.2 0fd1b10097bd083b99466e104e2eecbfa1f24f1a icedtea-2.2.3 32574ae3c2be6473eacf254d524442f8f7fd64d4 icedtea-2.2.4 +431257be50142366a1ab02920c45392cc86a28e8 icedtea-2.2.5 From andrew at icedtea.classpath.org Tue Feb 5 00:36:44 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 05 Feb 2013 08:36:44 +0000 Subject: /hg/release/icedtea7-forest-2.2/corba: 5 new changesets Message-ID: changeset 61fe9908ce37 in /hg/release/icedtea7-forest-2.2/corba details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/corba?cmd=changeset;node=61fe9908ce37 author: mbankal date: Fri Nov 09 10:20:16 2012 -0800 7141694: Improving CORBA internals Reviewed-by: coffeys, ahgross changeset a78c15e36b6c in /hg/release/icedtea7-forest-2.2/corba details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/corba?cmd=changeset;node=a78c15e36b6c author: coffeys date: Tue Nov 06 15:50:14 2012 +0000 7201066: Change modifiers on unused fields Reviewed-by: alanb, skoivu changeset ac4d709ac7a7 in /hg/release/icedtea7-forest-2.2/corba details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/corba?cmd=changeset;node=ac4d709ac7a7 author: ngmr date: Tue Oct 30 17:15:13 2012 +0000 8000540: Improve IIOP type reuse management Reviewed-by: alanb, ahgross, coffeys changeset e35a6cffcdb0 in /hg/release/icedtea7-forest-2.2/corba details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/corba?cmd=changeset;node=e35a6cffcdb0 author: coffeys date: Tue Oct 30 17:06:35 2012 +0000 8000631: Restrict access to class constructor Reviewed-by: alanb, ahgross changeset ac1b50725439 in /hg/release/icedtea7-forest-2.2/corba details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/corba?cmd=changeset;node=ac1b50725439 author: andrew date: Tue Feb 05 08:35:51 2013 +0000 Added tag icedtea-2.2.5 for changeset e35a6cffcdb0 diffstat: .hgtags | 1 + make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk | 14 +- src/share/classes/com/sun/corba/se/impl/activation/ServerMain.java | 8 +- src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java | 6 +- src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java | 61 +- src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java | 20 +- src/share/classes/com/sun/corba/se/impl/io/FVDCodeBaseImpl.java | 8 +- src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java | 114 +- src/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java | 85 +- src/share/classes/com/sun/corba/se/impl/io/ValueUtility.java | 10 +- src/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java | 6 +- src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java | 2 +- src/share/classes/com/sun/corba/se/impl/orbutil/IIOPInputStream_1_3.java | 57 - src/share/classes/com/sun/corba/se/impl/orbutil/IIOPInputStream_1_3_1.java | 54 - src/share/classes/com/sun/corba/se/impl/orbutil/IIOPOutputStream_1_3.java | 68 - src/share/classes/com/sun/corba/se/impl/orbutil/IIOPOutputStream_1_3_1.java | 66 - src/share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java | 38 +- src/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamClass_1_3_1.java | 6 +- src/share/classes/com/sun/corba/se/impl/orbutil/RepIdDelegator_1_3.java | 177 - src/share/classes/com/sun/corba/se/impl/orbutil/RepIdDelegator_1_3_1.java | 177 - src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdCache_1_3.java | 108 - src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdCache_1_3_1.java | 102 - src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdFactory.java | 53 +- src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryId_1_3.java | 990 --------- src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryId_1_3_1.java | 1065 ---------- src/share/classes/com/sun/corba/se/impl/orbutil/ValueHandlerImpl_1_3.java | 251 -- src/share/classes/com/sun/corba/se/impl/orbutil/ValueHandlerImpl_1_3_1.java | 77 - src/share/classes/com/sun/corba/se/spi/orb/ORB.java | 37 +- src/share/classes/sun/corba/JavaCorbaAccess.java | 32 + src/share/classes/sun/corba/SharedSecrets.java | 60 + 30 files changed, 220 insertions(+), 3533 deletions(-) diffs (truncated from 4252 to 500 lines): diff -r f90e1b6ccfb6 -r ac1b50725439 .hgtags --- a/.hgtags Mon Jan 14 22:54:02 2013 +0000 +++ b/.hgtags Tue Feb 05 08:35:51 2013 +0000 @@ -178,3 +178,4 @@ 38deb372c569b4c824bd3913567c0ea5844e34a9 icedtea-2.2.2 64c5506f4a4b50657ce32a68dbf4c6aecd07e4bf icedtea-2.2.3 12fee4f9ac222e28ca0e7d4e4475c4c6f92a50bf icedtea-2.2.4 +e35a6cffcdb09223158a04694455ad39365e88cb icedtea-2.2.5 diff -r f90e1b6ccfb6 -r ac1b50725439 make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk --- a/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk Mon Jan 14 22:54:02 2013 +0000 +++ b/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk Tue Feb 05 08:35:51 2013 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2012, 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 @@ -29,10 +29,6 @@ com/sun/corba/se/impl/orbutil/DenseIntMapImpl.java \ com/sun/corba/se/impl/orbutil/GetPropertyAction.java \ com/sun/corba/se/impl/orbutil/HexOutputStream.java \ - com/sun/corba/se/impl/orbutil/IIOPInputStream_1_3.java \ - com/sun/corba/se/impl/orbutil/IIOPInputStream_1_3_1.java \ - com/sun/corba/se/impl/orbutil/IIOPOutputStream_1_3.java \ - com/sun/corba/se/impl/orbutil/IIOPOutputStream_1_3_1.java \ com/sun/corba/se/impl/orbutil/LegacyHookGetFields.java \ com/sun/corba/se/impl/orbutil/LegacyHookPutFields.java \ com/sun/corba/se/impl/orbutil/LogKeywords.java \ @@ -45,19 +41,11 @@ com/sun/corba/se/impl/orbutil/ORBUtility.java \ com/sun/corba/se/impl/orbutil/ORBClassLoader.java \ com/sun/corba/se/impl/orbutil/RepIdDelegator.java \ - com/sun/corba/se/impl/orbutil/RepIdDelegator_1_3.java \ - com/sun/corba/se/impl/orbutil/RepIdDelegator_1_3_1.java \ - com/sun/corba/se/impl/orbutil/RepositoryIdCache_1_3.java \ - com/sun/corba/se/impl/orbutil/RepositoryId_1_3.java \ com/sun/corba/se/impl/orbutil/RepositoryIdFactory.java \ com/sun/corba/se/impl/orbutil/RepositoryIdStrings.java \ com/sun/corba/se/impl/orbutil/RepositoryIdUtility.java \ com/sun/corba/se/impl/orbutil/RepositoryIdInterface.java \ - com/sun/corba/se/impl/orbutil/RepositoryIdCache_1_3_1.java \ - com/sun/corba/se/impl/orbutil/RepositoryId_1_3_1.java \ com/sun/corba/se/impl/orbutil/StackImpl.java \ - com/sun/corba/se/impl/orbutil/ValueHandlerImpl_1_3_1.java \ - com/sun/corba/se/impl/orbutil/ValueHandlerImpl_1_3.java \ com/sun/corba/se/impl/orbutil/closure/Future.java \ com/sun/corba/se/impl/orbutil/closure/Constant.java \ com/sun/corba/se/impl/orbutil/concurrent/Sync.java \ diff -r f90e1b6ccfb6 -r ac1b50725439 src/share/classes/com/sun/corba/se/impl/activation/ServerMain.java --- a/src/share/classes/com/sun/corba/se/impl/activation/ServerMain.java Mon Jan 14 22:54:02 2013 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/activation/ServerMain.java Tue Feb 05 08:35:51 2013 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -322,9 +322,9 @@ com.sun.corba.se.spi.activation._ServerImplBase { private ORB orb; - private Method installMethod ; - private Method uninstallMethod ; - private Method shutdownMethod ; + private transient Method installMethod ; + private transient Method uninstallMethod ; + private transient Method shutdownMethod ; private Object methodArgs[] ; ServerCallback(ORB orb, Method installMethod, Method uninstallMethod, diff -r f90e1b6ccfb6 -r ac1b50725439 src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java --- a/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java Mon Jan 14 22:54:02 2013 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java Tue Feb 05 08:35:51 2013 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -1218,7 +1218,7 @@ // See bug 4391648 for more info about the tcORB in this // case. RepositoryIdStrings repStrs - = RepositoryIdFactory.getRepIdStringsFactory(tcORB); + = RepositoryIdFactory.getRepIdStringsFactory(); // Assertion: c instanceof Serializable? @@ -1251,7 +1251,7 @@ // Anything else // We know that this is a TypeCodeImpl since it is our ORB classTC = (TypeCodeImpl)ValueUtility.createTypeCodeForClass( - tcORB, c, ORBUtility.createValueHandler(tcORB)); + tcORB, c, ORBUtility.createValueHandler()); // Intruct classTC to store its buffer classTC.setCaching(true); // Update the cache diff -r f90e1b6ccfb6 -r ac1b50725439 src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java --- a/src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java Mon Jan 14 22:54:02 2013 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java Tue Feb 05 08:35:51 2013 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -269,8 +269,8 @@ private final void createRepositoryIdHandlers() { - repIdUtil = RepositoryIdFactory.getRepIdUtility(orb); - repIdStrs = RepositoryIdFactory.getRepIdStringsFactory(orb); + repIdUtil = RepositoryIdFactory.getRepIdUtility(); + repIdStrs = RepositoryIdFactory.getRepIdStringsFactory(); } public GIOPVersion getGIOPVersion() { @@ -564,10 +564,7 @@ checkForNegativeLength(len); - if (orb != null && ORBUtility.isLegacyORB((ORB)orb)) - return legacyReadString(len); - else - return internalReadString(len); + return internalReadString(len); } private final String internalReadString(int len) { @@ -588,54 +585,6 @@ return new String(result, 0, getCharConverter().getNumChars()); } - private final String legacyReadString(int len) { - - // - // Workaround for ORBs which send string lengths of - // zero to mean empty string. - // - // - // IMPORTANT: Do not replace 'new String("")' with "", it may result - // in a Serialization bug (See serialization.zerolengthstring) and - // bug id: 4728756 for details - if (len == 0) - return new String(""); - - len--; - char[] c = new char[len]; - - int n = 0; - while (n < len) { - int avail; - int bytes; - int wanted; - - avail = bbwi.buflen - bbwi.position(); - if (avail <= 0) { - grow(1, 1); - avail = bbwi.buflen - bbwi.position(); - } - wanted = len - n; - bytes = (wanted < avail) ? wanted : avail; - // Microbenchmarks are showing a loop of ByteBuffer.get(int) being - // faster than ByteBuffer.get(byte[], int, int). - for (int i=0; i bbwi.buflen) - alignAndCheck(1, 1); - bbwi.position(bbwi.position() + 1); - - return new String(c); - } - public final String read_string() { return readStringOrIndirection(false); } @@ -1045,7 +994,7 @@ try { if (valueHandler == null) - valueHandler = ORBUtility.createValueHandler(orb); + valueHandler = ORBUtility.createValueHandler(); value = valueHandler.readValue(parent, indirection, diff -r f90e1b6ccfb6 -r ac1b50725439 src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java --- a/src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java Mon Jan 14 22:54:02 2013 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java Tue Feb 05 08:35:51 2013 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -189,18 +189,8 @@ private final void createRepositoryIdHandlers() { - if (orb != null) { - // Get the appropriate versions based on the ORB version. The - // ORB versioning info is only in the core ORB. - repIdUtil - = RepositoryIdFactory.getRepIdUtility(orb); - repIdStrs - = RepositoryIdFactory.getRepIdStringsFactory(orb); - } else { - // Get the latest versions - repIdUtil = RepositoryIdFactory.getRepIdUtility(); - repIdStrs = RepositoryIdFactory.getRepIdStringsFactory(); - } + repIdUtil = RepositoryIdFactory.getRepIdUtility(); + repIdStrs = RepositoryIdFactory.getRepIdStringsFactory(); } public BufferManagerWrite getBufferManager() @@ -705,7 +695,7 @@ private void writeArray(Serializable array, Class clazz) { if (valueHandler == null) - valueHandler = ORBUtility.createValueHandler(orb); //d11638 + valueHandler = ORBUtility.createValueHandler(); //d11638 // Write value_tag int indirection = writeValueTag(mustChunk, true, @@ -768,7 +758,7 @@ private void writeRMIIIOPValueType(Serializable object, Class clazz) { if (valueHandler == null) - valueHandler = ORBUtility.createValueHandler(orb); //d11638 + valueHandler = ORBUtility.createValueHandler(); //d11638 Serializable key = object; diff -r f90e1b6ccfb6 -r ac1b50725439 src/share/classes/com/sun/corba/se/impl/io/FVDCodeBaseImpl.java --- a/src/share/classes/com/sun/corba/se/impl/io/FVDCodeBaseImpl.java Mon Jan 14 22:54:02 2013 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/io/FVDCodeBaseImpl.java Tue Feb 05 08:35:51 2013 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2011, 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 @@ -86,7 +86,7 @@ // default to using the current ORB version in case the // vhandler is not set if (vhandler == null) { - vhandler = new ValueHandlerImpl(false); + vhandler = ValueHandlerImpl.getInstance(false); } // Util.getCodebase may return null which would @@ -120,7 +120,7 @@ // default to using the current ORB version in case the // vhandler is not set if (vhandler == null) { - vhandler = new ValueHandlerImpl(false); + vhandler = ValueHandlerImpl.getInstance(false); } try{ @@ -161,7 +161,7 @@ // default to using the current ORB version in case the // vhandler is not set if (vhandler == null) { - vhandler = new ValueHandlerImpl(false); + vhandler = ValueHandlerImpl.getInstance(false); } Stack repIds = new Stack(); diff -r f90e1b6ccfb6 -r ac1b50725439 src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java --- a/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java Mon Jan 14 22:54:02 2013 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java Tue Feb 05 08:35:51 2013 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2012, 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 @@ -25,7 +25,7 @@ /* * Licensed Materials - Property of IBM * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved + * Copyright IBM Corp. 1998 2012 All Rights Reserved * */ @@ -56,7 +56,6 @@ import java.util.Arrays; import java.util.Comparator; -import java.util.Hashtable; import com.sun.corba.se.impl.util.RepositoryId; @@ -83,8 +82,6 @@ private static Object noArgsList[] = {}; private static Class noTypesList[] = {}; - private static Hashtable translatedFields; - /** true if represents enum type */ private boolean isEnum; @@ -384,6 +381,42 @@ */ } + private static final class PersistentFieldsValue + extends ClassValue { + PersistentFieldsValue() { } + + protected ObjectStreamField[] computeValue(Class type) { + try { + Field pf = type.getDeclaredField("serialPersistentFields"); + int mods = pf.getModifiers(); + if (Modifier.isPrivate(mods) && Modifier.isStatic(mods) && + Modifier.isFinal(mods)) { + pf.setAccessible(true); + java.io.ObjectStreamField[] fields = + (java.io.ObjectStreamField[])pf.get(type); + return translateFields(fields); + } + } catch (NoSuchFieldException | IllegalAccessException | + IllegalArgumentException | ClassCastException e) { + } + return null; + } + + private static ObjectStreamField[] translateFields( + java.io.ObjectStreamField[] fields) { + ObjectStreamField[] translation = + new ObjectStreamField[fields.length]; + for (int i = 0; i < fields.length; i++) { + translation[i] = new ObjectStreamField(fields[i].getName(), + fields[i].getType()); + } + return translation; + } + } + + private static final PersistentFieldsValue persistentFieldsValue = + new PersistentFieldsValue(); + /* * Initialize class descriptor. This method is only invoked on class * descriptors created via calls to lookupInternal(). This method is kept @@ -416,35 +449,7 @@ * If it is declared, use the declared serialPersistentFields. * Otherwise, extract the fields from the class itself. */ - try { - Field pf = cl.getDeclaredField("serialPersistentFields"); - // serial bug 7; the serialPersistentFields were not - // being read and stored as Accessible bit was not set - pf.setAccessible(true); - // serial bug 7; need to find if the field is of type - // java.io.ObjectStreamField - java.io.ObjectStreamField[] f = - (java.io.ObjectStreamField[])pf.get(cl); - int mods = pf.getModifiers(); - if ((Modifier.isPrivate(mods)) && - (Modifier.isStatic(mods)) && - (Modifier.isFinal(mods))) - { - fields = (ObjectStreamField[])translateFields((Object[])pf.get(cl)); - } - } catch (NoSuchFieldException e) { - fields = null; - } catch (IllegalAccessException e) { - fields = null; - } catch (IllegalArgumentException e) { - fields = null; - } catch (ClassCastException e) { - /* Thrown if a field serialPersistentField exists - * but it is not of type ObjectStreamField. - */ - fields = null; - } - + fields = persistentFieldsValue.get(cl); if (fields == null) { /* Get all of the declared fields for this @@ -641,43 +646,6 @@ superclass = null; } - private static Object[] translateFields(Object objs[]) - throws NoSuchFieldException { - try{ - java.io.ObjectStreamField fields[] = (java.io.ObjectStreamField[])objs; - Object translation[] = null; - - if (translatedFields == null) - translatedFields = new Hashtable(); - - translation = (Object[])translatedFields.get(fields); - - if (translation != null) - return translation; - else { - Class osfClass = Class.forName("com.sun.corba.se.impl.io.ObjectStreamField"); - translation = (Object[])java.lang.reflect.Array.newInstance(osfClass, objs.length); - Object arg[] = new Object[2]; - Class types[] = {String.class, Class.class}; - Constructor constructor = osfClass.getDeclaredConstructor(types); - for (int i = fields.length -1; i >= 0; i--){ - arg[0] = fields[i].getName(); - arg[1] = fields[i].getType(); - - translation[i] = constructor.newInstance(arg); - } - translatedFields.put(fields, translation); - - } - - return (Object[])translation; - } - catch(Throwable t){ - NoSuchFieldException nsfe = new NoSuchFieldException(); - nsfe.initCause( t ) ; - throw nsfe ; - } - } /* * Set the class this version descriptor matches. @@ -1555,8 +1523,8 @@ private boolean hasExternalizableBlockData; Method writeObjectMethod; Method readObjectMethod; - private Method writeReplaceObjectMethod; - private Method readResolveObjectMethod; + private transient Method writeReplaceObjectMethod; + private transient Method readResolveObjectMethod; private Constructor cons ; /** diff -r f90e1b6ccfb6 -r ac1b50725439 src/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java --- a/src/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java Mon Jan 14 22:54:02 2013 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java Tue Feb 05 08:35:51 2013 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2012, 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 @@ -53,7 +53,7 @@ import com.sun.corba.se.impl.logging.OMGSystemException; import com.sun.corba.se.impl.logging.UtilSystemException; -public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat { +public final class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat { // Property to override our maximum stream format version public static final String FORMAT_VERSION_PROPERTY @@ -150,14 +150,22 @@ writeValueWithVersion(out, value, streamFormatVersion); } - public ValueHandlerImpl(){} + private ValueHandlerImpl(){} - public ValueHandlerImpl(boolean isInputStream) { + private ValueHandlerImpl(boolean isInputStream) { this(); useHashtables = false; this.isInputStream = isInputStream; } + static ValueHandlerImpl getInstance() { + return new ValueHandlerImpl(); + } + + static ValueHandlerImpl getInstance(boolean isInputStream) { + return new ValueHandlerImpl(isInputStream); + } + /** * Writes the value to the stream using java semantics. * @param out The stream to write the value to @@ -458,12 +466,7 @@ return ObjectStreamClass.lookup(value.getClass()).writeReplace(value); From andrew at icedtea.classpath.org Tue Feb 5 00:36:50 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 05 Feb 2013 08:36:50 +0000 Subject: /hg/release/icedtea7-forest-2.2/jaxp: 2 new changesets Message-ID: changeset 5ac7b9e75614 in /hg/release/icedtea7-forest-2.2/jaxp details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jaxp?cmd=changeset;node=5ac7b9e75614 author: joehw date: Mon Oct 29 11:53:57 2012 -0700 8001235: Improve JAXP HTTP handling Reviewed-by: lancea, skoivu changeset 7d285e628870 in /hg/release/icedtea7-forest-2.2/jaxp details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jaxp?cmd=changeset;node=7d285e628870 author: andrew date: Tue Feb 05 08:35:52 2013 +0000 Added tag icedtea-2.2.5 for changeset 5ac7b9e75614 diffstat: .hgtags | 1 + src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java | 2 +- 2 files changed, 2 insertions(+), 1 deletions(-) diffs (20 lines): diff -r 028a292be666 -r 7d285e628870 .hgtags --- a/.hgtags Mon Jan 14 22:54:02 2013 +0000 +++ b/.hgtags Tue Feb 05 08:35:52 2013 +0000 @@ -178,3 +178,4 @@ 335fb0b059b720dc8d066592f6296d086bb40e9e icedtea-2.2.2 d7e1594436a685ddae0a15bd3cb93be4e3cbe405 icedtea-2.2.3 dc64245ac19d9c7af987f7c8197b766f39cc76aa icedtea-2.2.4 +5ac7b9e75614f15e2f8b4ea31b12f1afa4623ec3 icedtea-2.2.5 diff -r 028a292be666 -r 7d285e628870 src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java --- a/src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java Mon Jan 14 22:54:02 2013 +0000 +++ b/src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java Tue Feb 05 08:35:52 2013 +0000 @@ -165,7 +165,7 @@ * should already be fully qualified as path/filename * @param target The target property bag the file will be placed into. */ - public void loadPropertyFile(String file, Properties target) + private void loadPropertyFile(String file, Properties target) { try { From andrew at icedtea.classpath.org Tue Feb 5 00:36:56 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 05 Feb 2013 08:36:56 +0000 Subject: /hg/release/icedtea7-forest-2.2/jaxws: Added tag icedtea-2.2.5 f... Message-ID: changeset acf0bd2643a5 in /hg/release/icedtea7-forest-2.2/jaxws details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jaxws?cmd=changeset;node=acf0bd2643a5 author: andrew date: Tue Feb 05 08:35:53 2013 +0000 Added tag icedtea-2.2.5 for changeset c620184ea425 diffstat: .hgtags | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diffs (8 lines): diff -r c620184ea425 -r acf0bd2643a5 .hgtags --- a/.hgtags Mon Jan 14 22:54:03 2013 +0000 +++ b/.hgtags Tue Feb 05 08:35:53 2013 +0000 @@ -178,3 +178,4 @@ 5471e01ef43b25d1546afaad51dad25b2b5e0aeb icedtea-2.2.2 e029fce63568e22c93d7d2943dcc0d0a26302425 icedtea-2.2.3 b41293d5794099a25e7e7bc69ff8843529272508 icedtea-2.2.4 +c620184ea4250a1988f5a2e25abcef29900108a2 icedtea-2.2.5 From andrew at icedtea.classpath.org Tue Feb 5 00:37:02 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 05 Feb 2013 08:37:02 +0000 Subject: /hg/release/icedtea7-forest-2.2/langtools: Added tag icedtea-2.2... Message-ID: changeset de74a816c73a in /hg/release/icedtea7-forest-2.2/langtools details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/langtools?cmd=changeset;node=de74a816c73a author: andrew date: Tue Feb 05 08:35:55 2013 +0000 Added tag icedtea-2.2.5 for changeset 206668cf21e5 diffstat: .hgtags | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diffs (8 lines): diff -r 206668cf21e5 -r de74a816c73a .hgtags --- a/.hgtags Mon Jan 14 22:54:04 2013 +0000 +++ b/.hgtags Tue Feb 05 08:35:55 2013 +0000 @@ -179,3 +179,4 @@ beea46c7086b21ae604bfaec7f6ffb615f652e88 icedtea-2.2.2 f5e3d40e7849fb0b52d0d2ac2238f072c86fd2cc icedtea-2.2.3 e96efe42e3d541f791f82f23c7465337cefea46e icedtea-2.2.4 +206668cf21e5c72ca48ebfc1aa45a012676681f6 icedtea-2.2.5 From andrew at icedtea.classpath.org Tue Feb 5 00:37:08 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 05 Feb 2013 08:37:08 +0000 Subject: /hg/release/icedtea7-forest-2.2/hotspot: 2 new changesets Message-ID: changeset da3747196112 in /hg/release/icedtea7-forest-2.2/hotspot details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/hotspot?cmd=changeset;node=da3747196112 author: kamg date: Thu Nov 08 17:45:05 2012 -0500 8001307: Modify ACC_SUPER behavior Summary: Disallow non-virtual calls even when ACC_SUPER is absent. Reviewed-by: kvn, acorn changeset d2e4bf94d38d in /hg/release/icedtea7-forest-2.2/hotspot details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/hotspot?cmd=changeset;node=d2e4bf94d38d author: andrew date: Tue Feb 05 08:35:56 2013 +0000 Added tag icedtea-2.2.5 for changeset da3747196112 diffstat: .hgtags | 1 + src/share/vm/interpreter/linkResolver.cpp | 2 +- src/share/vm/runtime/globals.hpp | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diffs (35 lines): diff -r 60d6e32e00a6 -r d2e4bf94d38d .hgtags --- a/.hgtags Mon Jan 14 22:54:04 2013 +0000 +++ b/.hgtags Tue Feb 05 08:35:56 2013 +0000 @@ -289,3 +289,4 @@ 0000000000000000000000000000000000000000 icedtea-2.2.3 fe641a4f943d914e50b3a984eb9ab12b680d635a icedtea-2.2.3 1a3dc05d59c23a25053386c921afc24d2a5d2734 icedtea-2.2.4 +da3747196112fca6f8f3db3b80712bcd3b10c477 icedtea-2.2.5 diff -r 60d6e32e00a6 -r d2e4bf94d38d src/share/vm/interpreter/linkResolver.cpp --- a/src/share/vm/interpreter/linkResolver.cpp Mon Jan 14 22:54:04 2013 +0000 +++ b/src/share/vm/interpreter/linkResolver.cpp Tue Feb 05 08:35:56 2013 +0000 @@ -712,7 +712,7 @@ if (check_access && // a) check if ACC_SUPER flag is set for the current class - current_klass->is_super() && + (current_klass->is_super() || !AllowNonVirtualCalls) && // b) check if the method class is a superclass of the current class (superclass relation is not reflexive!) current_klass->is_subtype_of(method_klass()) && current_klass() != method_klass() && // c) check if the method is not diff -r 60d6e32e00a6 -r d2e4bf94d38d src/share/vm/runtime/globals.hpp --- a/src/share/vm/runtime/globals.hpp Mon Jan 14 22:54:04 2013 +0000 +++ b/src/share/vm/runtime/globals.hpp Tue Feb 05 08:35:56 2013 +0000 @@ -3902,7 +3902,10 @@ product(bool, UseVMInterruptibleIO, false, \ "(Unstable, Solaris-specific) Thread interrupt before or with " \ "EINTR for I/O operations results in OS_INTRPT. The default value"\ - " of this flag is true for JDK 6 and earlier") + " of this flag is true for JDK 6 and earlier") \ + \ + product(bool, AllowNonVirtualCalls, false, \ + "Obey the ACC_SUPER flag and allow invokenonvirtual calls") /* * Macros for factoring of globals From andrew at icedtea.classpath.org Tue Feb 5 00:37:20 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 05 Feb 2013 08:37:20 +0000 Subject: /hg/release/icedtea7-forest-2.2/jdk: 30 new changesets Message-ID: changeset 9d52db015c65 in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=9d52db015c65 author: mullan date: Fri Oct 26 14:22:21 2012 -0400 7201068: Better handling of UI elements Reviewed-by: xuelei changeset adc4d75e071c in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=adc4d75e071c author: dmocek date: Mon Nov 19 13:52:08 2012 -0800 6563318: RMI data sanitization Reviewed-by: ahgross, hawtin, mchung, smarks changeset d97ba2b9d662 in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=d97ba2b9d662 author: coffeys date: Wed Jun 13 17:04:15 2012 +0100 7175616: Port fix for TimeZone from JDK 8 to JDK 7 Reviewed-by: okutsu changeset de94f3efa907 in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=de94f3efa907 author: mchung date: Mon Nov 26 13:32:17 2012 -0800 6664509: Add logging context 6664528: Find log level matching its name or value given at construction time Reviewed-by: alanb, ahgross, jgish, hawtin changeset 64c1d64099b5 in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=64c1d64099b5 author: dholmes date: Wed Aug 22 21:40:19 2012 -0400 6776941: Improve thread pool shutdown Reviewed-by: dl, skoivu changeset 7b3bd33c16d5 in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=7b3bd33c16d5 author: anthony date: Fri Sep 28 18:09:28 2012 +0400 7173145: Improve in-memory representation of splashscreens Reviewed-by: bae, mschoene changeset cf99f227877c in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=cf99f227877c author: ksrini date: Tue Oct 02 07:05:27 2012 -0700 7186945: Unpack200 improvement Reviewed-by: jrose, jjh, mschoene changeset 8189a79aa5b1 in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=8189a79aa5b1 author: ksrini date: Tue Oct 02 07:50:25 2012 -0700 7186946: Refine unpacker resource usage Reviewed-by: jrose, jjh, mschoene changeset 030a769bf840 in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=030a769bf840 author: rupashka date: Tue Oct 16 14:55:17 2012 +0400 7186948: Improve Swing data validation Reviewed-by: art, ahgross changeset e39eaef98527 in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=e39eaef98527 author: denis date: Tue Oct 30 22:18:42 2012 +0400 7186952: Improve clipboard access Reviewed-by: serb, ahgross changeset b40e6b759172 in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=b40e6b759172 author: khazra date: Thu Oct 18 12:13:15 2012 -0700 7186954: Improve connection performance Reviewed-by: chegar, skoivu changeset 6dd72750bfc7 in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=6dd72750bfc7 author: ksrini date: Tue Oct 02 07:34:37 2012 -0700 7186957: Improve Pack200 data validation Reviewed-by: jrose, jjh, mschoene changeset ba4dd5c84f45 in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=ba4dd5c84f45 author: xuelei date: Mon Oct 22 07:31:21 2012 -0700 7192392: Better validation of client keys Summary: Also reviewed by Andrew Gross Reviewed-by: vinnie changeset fc32b547d8cf in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=fc32b547d8cf author: xuelei date: Mon Sep 24 02:06:15 2012 -0700 7192393: Better Checking of order of TLS Messages Summary: Also reviewed by Andrew Gross Reviewed-by: weijun changeset a9c3615212ec in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=a9c3615212ec author: bagiras date: Tue Nov 13 23:33:57 2012 +0400 7192977: Issue in toolkit thread Reviewed-by: skoivu, rupashka, art changeset 69e95f5b7db3 in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=69e95f5b7db3 author: mchung date: Fri Nov 02 15:16:27 2012 -0700 7197546: (proxy) Reflect about creating reflective proxies Reviewed-by: alanb, jdn, jrose changeset 25d978f74f11 in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=25d978f74f11 author: rupashka date: Tue Nov 06 17:49:01 2012 +0400 7200491: Tighten up JTable layout code Reviewed-by: art, skoivu changeset 3bbe56fb7433 in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=3bbe56fb7433 author: malenkov date: Mon Oct 15 14:06:54 2012 +0400 7200493: Improve cache handling Reviewed-by: art, ahgross changeset 07c15d3e6e21 in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=07c15d3e6e21 author: andrew date: Sat Feb 02 13:30:13 2013 +0000 7200499: Better data validation for options Reviewed-by: darcy, jjh, mschoene changeset e0fd28f893af in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=e0fd28f893af author: ksrini date: Tue Oct 16 10:56:25 2012 -0700 7200500: Launcher better input validation Reviewed-by: darcy, jjh, mschoene changeset dd8400109306 in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=dd8400109306 author: denis date: Fri Nov 23 16:27:32 2012 +0400 7201064: Better dialogue checking Reviewed-by: serb, skoivu changeset 6b3d86ac1d9b in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=6b3d86ac1d9b author: smarks date: Thu Nov 08 15:21:44 2012 -0800 7201070: Serialization to conform to protocol Reviewed-by: dmocek, ahgross, skoivu changeset 05dd2dad650e in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=05dd2dad650e author: chegar date: Wed Nov 07 14:03:57 2012 +0000 7201071: InetSocketAddress serialization issue Reviewed-by: alanb, michaelm, skoivu changeset 780311644e7e in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=780311644e7e author: weijun date: Wed Sep 19 12:58:43 2012 +0800 8000210: Improve JarFile code quality Reviewed-by: ahgross, xuelei, mschoene changeset 1dafd28641b3 in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=1dafd28641b3 author: dsamersoff date: Thu Nov 15 09:41:36 2012 +0100 8000537: Contextualize RequiredModelMBean class Reviewed-by: ahgross, dsamersoff, skoivu Contributed-by: Jaroslav Bachorik changeset badf9c752e9e in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=badf9c752e9e author: dsamersoff date: Tue Oct 30 17:18:43 2012 +0400 8000539: Introspect JMX data handling Summary: Added extra packageAccess check call Reviewed-by: ahgross, dfuchs Contributed-by: jaroslav.bachorik at oracle.com changeset 28f574a3aca7 in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=28f574a3aca7 author: dmocek date: Mon Nov 19 15:32:59 2012 -0800 8001242: Improve RMI HTTP conformance Reviewed-by: ahgross, mchung, smarks changeset 626020a74227 in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=626020a74227 author: bae date: Thu Nov 15 19:16:41 2012 +0400 8001972: Improve image processing Reviewed-by: prr, ahgross changeset 5c8a49907577 in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=5c8a49907577 author: bae date: Sat Nov 17 18:21:24 2012 +0400 8002325: Improve management of images Reviewed-by: prr, ahgross changeset 0256f476a911 in /hg/release/icedtea7-forest-2.2/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.2/jdk?cmd=changeset;node=0256f476a911 author: andrew date: Tue Feb 05 08:36:01 2013 +0000 Added tag icedtea-2.2.5 for changeset 5c8a49907577 diffstat: .hgtags | 1 + make/java/java/FILES_java.gmk | 3 +- src/share/bin/jli_util.h | 2 +- src/share/bin/parse_manifest.c | 15 +- src/share/classes/com/sun/beans/finder/MethodFinder.java | 7 +- src/share/classes/com/sun/crypto/provider/DHKeyAgreement.java | 5 + src/share/classes/com/sun/java/util/jar/pack/BandStructure.java | 3 +- src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java | 2 + src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java | 6 +- src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java | 4 +- src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java | 6 +- src/share/classes/com/sun/jmx/mbeanserver/Introspector.java | 8 +- src/share/classes/java/awt/Dialog.java | 53 +- src/share/classes/java/awt/EventQueue.java | 19 +- src/share/classes/java/awt/TextComponent.java | 25 +- src/share/classes/java/awt/Window.java | 2 +- src/share/classes/java/io/ObjectInputStream.java | 6 + src/share/classes/java/lang/Class.java | 47 +- src/share/classes/java/lang/invoke/MethodHandleProxies.java | 73 +- src/share/classes/java/lang/reflect/Proxy.java | 151 ++- src/share/classes/java/net/InetSocketAddress.java | 272 +++- src/share/classes/java/util/TimeZone.java | 59 +- src/share/classes/java/util/concurrent/ThreadPoolExecutor.java | 172 +- src/share/classes/java/util/jar/JarFile.java | 21 +- src/share/classes/java/util/logging/Level.java | 255 ++++- src/share/classes/java/util/logging/LogManager.java | 535 ++++++--- src/share/classes/java/util/logging/Logger.java | 67 +- src/share/classes/java/util/logging/Logging.java | 14 +- src/share/classes/java/util/logging/LoggingProxyImpl.java | 11 +- src/share/classes/java/util/logging/SimpleFormatter.java | 2 +- src/share/classes/javax/management/modelmbean/RequiredModelMBean.java | 227 +++- src/share/classes/javax/swing/JTable.java | 14 +- src/share/classes/javax/swing/RepaintManager.java | 156 +- src/share/classes/javax/swing/UIDefaults.java | 2 + src/share/classes/javax/swing/plaf/nimbus/NimbusLookAndFeel.java | 7 +- src/share/classes/sun/applet/AppletPanel.java | 60 +- src/share/classes/sun/awt/AWTAccessor.java | 7 + src/share/classes/sun/awt/AppContext.java | 62 +- src/share/classes/sun/awt/image/ByteComponentRaster.java | 70 +- src/share/classes/sun/awt/image/ByteInterleavedRaster.java | 29 +- src/share/classes/sun/awt/image/ShortComponentRaster.java | 69 +- src/share/classes/sun/awt/image/ShortInterleavedRaster.java | 29 +- src/share/classes/sun/misc/JavaAWTAccess.java | 42 + src/share/classes/sun/misc/SharedSecrets.java | 13 +- src/share/classes/sun/net/httpserver/ChunkedInputStream.java | 14 +- src/share/classes/sun/net/www/http/ChunkedInputStream.java | 9 + src/share/classes/sun/nio/ch/DatagramChannelImpl.java | 18 +- src/share/classes/sun/reflect/misc/ReflectUtil.java | 59 + src/share/classes/sun/rmi/transport/proxy/CGIHandler.java | 19 +- src/share/classes/sun/rmi/transport/proxy/HttpInputStream.java | 15 +- src/share/classes/sun/security/pkcs11/P11KeyAgreement.java | 9 + src/share/classes/sun/security/ssl/ClientHandshaker.java | 13 +- src/share/classes/sun/security/ssl/DHClientKeyExchange.java | 19 +- src/share/classes/sun/security/ssl/DHCrypt.java | 87 +- src/share/classes/sun/security/ssl/HandshakeMessage.java | 16 +- src/share/classes/sun/security/ssl/RSAClientKeyExchange.java | 4 +- src/share/classes/sun/security/ssl/ServerHandshaker.java | 18 +- src/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java | 4 +- src/share/classes/sun/security/util/DerIndefLenConverter.java | 4 + src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java | 2 +- src/share/classes/sun/security/util/KeyLength.java | 91 - src/share/classes/sun/security/util/KeyUtil.java | 204 +++ src/share/lib/security/java.security | 22 +- src/share/lib/security/java.security-macosx | 18 +- src/share/lib/security/java.security-solaris | 16 +- src/share/lib/security/java.security-windows | 16 +- src/share/native/com/sun/java/util/jar/pack/bands.cpp | 4 + src/share/native/com/sun/java/util/jar/pack/bands.h | 4 +- src/share/native/com/sun/java/util/jar/pack/jni.cpp | 53 +- src/share/native/com/sun/java/util/jar/pack/unpack.cpp | 33 +- src/share/native/sun/awt/image/awt_parseImage.c | 110 +- src/share/native/sun/awt/image/awt_parseImage.h | 1 + src/share/native/sun/awt/medialib/safe_alloc.h | 5 + src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c | 4 + src/solaris/classes/sun/nio/ch/SctpChannelImpl.java | 14 +- src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java | 16 +- src/solaris/native/sun/nio/ch/DatagramChannelImpl.c | 9 +- src/solaris/native/sun/nio/ch/SctpChannelImpl.c | 27 +- src/windows/bin/java_md.c | 34 +- src/windows/classes/sun/awt/windows/WComponentPeer.java | 9 +- src/windows/classes/sun/awt/windows/WEmbeddedFrame.java | 15 +- src/windows/native/sun/nio/ch/DatagramChannelImpl.c | 10 +- src/windows/native/sun/windows/awt_TextComponent.cpp | 22 +- src/windows/native/sun/windows/awt_TextComponent.h | 3 +- 84 files changed, 2619 insertions(+), 1064 deletions(-) diffs (truncated from 6445 to 500 lines): diff -r 8fccb53fef83 -r 0256f476a911 .hgtags --- a/.hgtags Mon Jan 14 22:54:05 2013 +0000 +++ b/.hgtags Tue Feb 05 08:36:01 2013 +0000 @@ -182,3 +182,4 @@ 5ec35e1b30b02b11a13cbebaa8e23520c5ca89cc icedtea-2.2.2 08baf77fec47a067341cf890a2e4c4a4917b9f09 icedtea-2.2.3 819c4d5211199bf71811e69bde95b39434da384b icedtea-2.2.4 +5c8a49907577a446a21103c7d24205836dc1a76c icedtea-2.2.5 diff -r 8fccb53fef83 -r 0256f476a911 make/java/java/FILES_java.gmk --- a/make/java/java/FILES_java.gmk Mon Jan 14 22:54:05 2013 +0000 +++ b/make/java/java/FILES_java.gmk Tue Feb 05 08:36:01 2013 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1996, 2012, 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 @@ -476,6 +476,7 @@ sun/misc/MessageUtils.java \ sun/misc/GC.java \ sun/misc/Service.java \ + sun/misc/JavaAWTAccess.java \ sun/misc/JavaLangAccess.java \ sun/misc/JavaIOAccess.java \ sun/misc/JavaIOFileDescriptorAccess.java \ diff -r 8fccb53fef83 -r 0256f476a911 src/share/bin/jli_util.h --- a/src/share/bin/jli_util.h Mon Jan 14 22:54:05 2013 +0000 +++ b/src/share/bin/jli_util.h Tue Feb 05 08:36:01 2013 +0000 @@ -55,7 +55,7 @@ #include #define JLI_StrCaseCmp(p1, p2) stricmp((p1), (p2)) #define JLI_StrNCaseCmp(p1, p2, p3) strnicmp((p1), (p2), (p3)) -#define JLI_Snprintf _snprintf +size_t JLI_Snprintf(char *buffer, size_t size, const char *format, ...); #else #include #define JLI_StrCaseCmp(p1, p2) strcasecmp((p1), (p2)) diff -r 8fccb53fef83 -r 0256f476a911 src/share/bin/parse_manifest.c --- a/src/share/bin/parse_manifest.c Mon Jan 14 22:54:05 2013 +0000 +++ b/src/share/bin/parse_manifest.c Tue Feb 05 08:36:01 2013 +0000 @@ -490,9 +490,9 @@ #ifdef O_BINARY | O_BINARY /* use binary mode on windows */ #endif - )) == -1) + )) == -1) { return (-1); - + } info->manifest_version = NULL; info->main_class = NULL; info->jre_version = NULL; @@ -539,12 +539,14 @@ zentry entry; void *data = NULL; - fd = open(jarfile, O_RDONLY + if ((fd = open(jarfile, O_RDONLY #ifdef O_BINARY | O_BINARY /* use binary mode on windows */ #endif - ); - if (fd != -1 && find_file(fd, &entry, filename) == 0) { + )) == -1) { + return NULL; + } + if (find_file(fd, &entry, filename) == 0) { data = inflate_file(fd, &entry, size); } close(fd); @@ -586,8 +588,9 @@ #ifdef O_BINARY | O_BINARY /* use binary mode on windows */ #endif - )) == -1) + )) == -1) { return (-1); + } if (rc = find_file(fd, &entry, manifest_name) != 0) { close(fd); diff -r 8fccb53fef83 -r 0256f476a911 src/share/classes/com/sun/beans/finder/MethodFinder.java --- a/src/share/classes/com/sun/beans/finder/MethodFinder.java Mon Jan 14 22:54:05 2013 +0000 +++ b/src/share/classes/com/sun/beans/finder/MethodFinder.java Tue Feb 05 08:36:01 2013 +0000 @@ -68,11 +68,14 @@ Signature signature = new Signature(type, name, args); Method method = CACHE.get(signature); - if (method != null) { + boolean cached = method != null; + if (cached && isPackageAccessible(method.getDeclaringClass())) { return method; } method = findAccessibleMethod(new MethodFinder(name, args).find(type.getMethods())); - CACHE.put(signature, method); + if (!cached) { + CACHE.put(signature, method); + } return method; } diff -r 8fccb53fef83 -r 0256f476a911 src/share/classes/com/sun/crypto/provider/DHKeyAgreement.java --- a/src/share/classes/com/sun/crypto/provider/DHKeyAgreement.java Mon Jan 14 22:54:05 2013 +0000 +++ b/src/share/classes/com/sun/crypto/provider/DHKeyAgreement.java Tue Feb 05 08:36:01 2013 +0000 @@ -40,6 +40,8 @@ import javax.crypto.SecretKey; import javax.crypto.spec.*; +import sun.security.util.KeyUtil; + /** * This class implements the Diffie-Hellman key agreement protocol between * any number of parties. @@ -199,6 +201,9 @@ throw new InvalidKeyException("Incompatible parameters"); } + // validate the Diffie-Hellman public key + KeyUtil.validate(dhPubKey); + // store the y value this.y = dhPubKey.getY(); diff -r 8fccb53fef83 -r 0256f476a911 src/share/classes/com/sun/java/util/jar/pack/BandStructure.java --- a/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java Mon Jan 14 22:54:05 2013 +0000 +++ b/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java Tue Feb 05 08:36:01 2013 +0000 @@ -1003,7 +1003,6 @@ /** Write a constant pool reference. */ public void putRef(Entry e) { - assert(index != null); addValue(encodeRefOrNull(e, index)); } public void putRef(Entry e, Index index) { @@ -1055,6 +1054,8 @@ int encodeRef(Entry e, Index ix) { + if (ix == null) + throw new RuntimeException("null index for " + e.stringValue()); int coding = ix.indexOf(e); if (verbose > 2) Utils.log.fine("putRef "+coding+" => "+e); diff -r 8fccb53fef83 -r 0256f476a911 src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java --- a/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java Mon Jan 14 22:54:05 2013 +0000 +++ b/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java Tue Feb 05 08:36:01 2013 +0000 @@ -1049,6 +1049,8 @@ /** Index of all CP entries of a given tag and class. */ public Index getMemberIndex(byte tag, ClassEntry classRef) { + if (classRef == null) + throw new RuntimeException("missing class reference for " + tagName(tag)); if (indexByTagAndClass == null) indexByTagAndClass = new Index[CONSTANT_Limit][]; Index allClasses = getIndexByTag(CONSTANT_Class); diff -r 8fccb53fef83 -r 0256f476a911 src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java --- a/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java Mon Jan 14 22:54:05 2013 +0000 +++ b/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java Tue Feb 05 08:36:01 2013 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, 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 @@ -104,6 +104,10 @@ return (p200 == null)? null: p200._nunp; } + private synchronized long getUnpackerPtr() { + return unpackerPtr; + } + // Callback from the unpacker engine to get more data. private long readInputFn(ByteBuffer pbuf, long minlen) throws IOException { if (in == null) return 0; // nothing is readable diff -r 8fccb53fef83 -r 0256f476a911 src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java --- a/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java Mon Jan 14 22:54:05 2013 +0000 +++ b/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java Tue Feb 05 08:36:01 2013 +0000 @@ -83,7 +83,7 @@ * @param out an OutputStream * @exception IOException if an error is encountered. */ - public void pack(JarFile in, OutputStream out) throws IOException { + public synchronized void pack(JarFile in, OutputStream out) throws IOException { assert(Utils.currentInstance.get() == null); TimeZone tz = (props.getBoolean(Utils.PACK_DEFAULT_TIMEZONE)) ? null @@ -118,7 +118,7 @@ * @param out an OutputStream * @exception IOException if an error is encountered. */ - public void pack(JarInputStream in, OutputStream out) throws IOException { + public synchronized void pack(JarInputStream in, OutputStream out) throws IOException { assert(Utils.currentInstance.get() == null); TimeZone tz = (props.getBoolean(Utils.PACK_DEFAULT_TIMEZONE)) ? null : TimeZone.getDefault(); diff -r 8fccb53fef83 -r 0256f476a911 src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java --- a/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java Mon Jan 14 22:54:05 2013 +0000 +++ b/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java Tue Feb 05 08:36:01 2013 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, 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 @@ -106,7 +106,7 @@ * @param out a JarOutputStream. * @exception IOException if an error is encountered. */ - public void unpack(InputStream in, JarOutputStream out) throws IOException { + public synchronized void unpack(InputStream in, JarOutputStream out) throws IOException { if (in == null) { throw new NullPointerException("null input"); } @@ -151,7 +151,7 @@ * @param out a JarOutputStream. * @exception IOException if an error is encountered. */ - public void unpack(File in, JarOutputStream out) throws IOException { + public synchronized void unpack(File in, JarOutputStream out) throws IOException { if (in == null) { throw new NullPointerException("null input"); } diff -r 8fccb53fef83 -r 0256f476a911 src/share/classes/com/sun/jmx/mbeanserver/Introspector.java --- a/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java Mon Jan 14 22:54:05 2013 +0000 +++ b/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java Tue Feb 05 08:36:01 2013 +0000 @@ -56,6 +56,8 @@ import java.lang.reflect.InvocationTargetException; import javax.management.AttributeNotFoundException; import javax.management.openmbean.CompositeData; +import sun.reflect.misc.MethodUtil; +import sun.reflect.misc.ReflectUtil; /** * This class contains the methods for performing all the tests needed to verify @@ -528,8 +530,10 @@ // to locate method readMethod = SimpleIntrospector.getReadMethod(clazz, element); } - if (readMethod != null) - return readMethod.invoke(complex); + if (readMethod != null) { + ReflectUtil.checkPackageAccess(readMethod.getDeclaringClass()); + return MethodUtil.invoke(readMethod, complex, new Class[0]); + } throw new AttributeNotFoundException( "Could not find the getter method for the property " + diff -r 8fccb53fef83 -r 0256f476a911 src/share/classes/java/awt/Dialog.java --- a/src/share/classes/java/awt/Dialog.java Mon Jan 14 22:54:05 2013 +0000 +++ b/src/share/classes/java/awt/Dialog.java Tue Feb 05 08:36:01 2013 +0000 @@ -39,6 +39,7 @@ import sun.awt.util.IdentityArrayList; import sun.awt.util.IdentityLinkedList; import sun.security.util.SecurityConstants; +import java.security.AccessControlException; /** * A Dialog is a top-level window with a title and a border @@ -128,6 +129,8 @@ */ boolean undecorated = false; + private transient boolean initialized = false; + /** * Modal dialogs block all input to some top-level windows. * Whether a particular window is blocked depends on dialog's type @@ -671,6 +674,7 @@ this.title = title; setModalityType(modalityType); SunToolkit.checkAndSetPolicy(this); + initialized = true; } /** @@ -722,6 +726,7 @@ this.title = title; setModalityType(modalityType); SunToolkit.checkAndSetPolicy(this); + initialized = true; } /** @@ -851,12 +856,9 @@ if (modalityType == type) { return; } - if (type == ModalityType.TOOLKIT_MODAL) { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - sm.checkPermission(SecurityConstants.AWT.TOOLKIT_MODALITY_PERMISSION); - } - } + + checkModalityPermission(type); + modalityType = type; modal = (modalityType != ModalityType.MODELESS); } @@ -1025,6 +1027,9 @@ */ @Deprecated public void show() { + if (!initialized) throw new IllegalStateException( + "The dialog component has not been initialized properly"); + beforeFirstShow = false; if (!isModal()) { conditionalShow(null, null); @@ -1595,18 +1600,50 @@ } } + private void checkModalityPermission(ModalityType mt) { + if (mt == ModalityType.TOOLKIT_MODAL) { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission( + SecurityConstants.AWT.TOOLKIT_MODALITY_PERMISSION + ); + } + } + } + private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException, HeadlessException { GraphicsEnvironment.checkHeadless(); - s.defaultReadObject(); + + java.io.ObjectInputStream.GetField fields = + s.readFields(); + + ModalityType localModalityType = (ModalityType)fields.get("modalityType", null); + + try { + checkModalityPermission(localModalityType); + } catch (AccessControlException ace) { + localModalityType = DEFAULT_MODALITY_TYPE; + } // in 1.5 or earlier modalityType was absent, so use "modal" instead - if (modalityType == null) { + if (localModalityType == null) { + this.modal = fields.get("modal", false); setModal(modal); } + this.resizable = fields.get("resizable", true); + this.undecorated = fields.get("undecorated", false); + this.title = (String)fields.get("title", ""); + this.modalityType = localModalityType; + blockedWindows = new IdentityArrayList(); + + SunToolkit.checkAndSetPolicy(this); + + initialized = true; + } /* diff -r 8fccb53fef83 -r 0256f476a911 src/share/classes/java/awt/EventQueue.java --- a/src/share/classes/java/awt/EventQueue.java Mon Jan 14 22:54:05 2013 +0000 +++ b/src/share/classes/java/awt/EventQueue.java Tue Feb 05 08:36:01 2013 +0000 @@ -187,7 +187,8 @@ } public void removeSourceEvents(EventQueue eventQueue, Object source, - boolean removeAllEvents) { + boolean removeAllEvents) + { eventQueue.removeSourceEvents(source, removeAllEvents); } public boolean noEvents(EventQueue eventQueue) { @@ -196,6 +197,11 @@ public void wakeup(EventQueue eventQueue, boolean isShutdown) { eventQueue.wakeup(isShutdown); } + public void invokeAndWait(Object source, Runnable r) + throws InterruptedException, InvocationTargetException + { + EventQueue.invokeAndWait(source, r); + } }); } @@ -1223,8 +1229,14 @@ * @since 1.2 */ public static void invokeAndWait(Runnable runnable) - throws InterruptedException, InvocationTargetException { + throws InterruptedException, InvocationTargetException + { + invokeAndWait(Toolkit.getDefaultToolkit(), runnable); + } + static void invokeAndWait(Object source, Runnable runnable) + throws InterruptedException, InvocationTargetException + { if (EventQueue.isDispatchThread()) { throw new Error("Cannot call invokeAndWait from the event dispatcher thread"); } @@ -1233,8 +1245,7 @@ Object lock = new AWTInvocationLock(); InvocationEvent event = - new InvocationEvent(Toolkit.getDefaultToolkit(), runnable, lock, - true); + new InvocationEvent(source, runnable, lock, true); synchronized (lock) { Toolkit.getEventQueue().postEvent(event); diff -r 8fccb53fef83 -r 0256f476a911 src/share/classes/java/awt/TextComponent.java --- a/src/share/classes/java/awt/TextComponent.java Mon Jan 14 22:54:05 2013 +0000 +++ b/src/share/classes/java/awt/TextComponent.java Tue Feb 05 08:36:01 2013 +0000 @@ -107,12 +107,6 @@ // the background color of non-editable TextComponents. boolean backgroundSetByClientCode = false; - /** - * True if this TextComponent has access - * to the System clipboard. - */ - transient private boolean canAccessClipboard; - transient protected TextListener textListener; /* @@ -137,7 +131,6 @@ GraphicsEnvironment.checkHeadless(); this.text = (text != null) ? text : ""; setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR)); - checkSystemClipboardAccess(); } private void enableInputMethodsIfNecessary() { @@ -727,17 +720,14 @@ /** * Assigns a valid value to the canAccessClipboard instance variable. */ - private void checkSystemClipboardAccess() { - canAccessClipboard = true; + private boolean canAccessClipboard() { SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - try { - sm.checkSystemClipboardAccess(); - } - catch (SecurityException e) { - canAccessClipboard = false; - } - } + if (sm == null) return true; + try { + sm.checkSystemClipboardAccess(); + return true; + } catch (SecurityException e) {} + return false; } /* @@ -820,7 +810,6 @@ } } enableInputMethodsIfNecessary(); - checkSystemClipboardAccess(); } diff -r 8fccb53fef83 -r 0256f476a911 src/share/classes/java/awt/Window.java --- a/src/share/classes/java/awt/Window.java Mon Jan 14 22:54:05 2013 +0000 +++ b/src/share/classes/java/awt/Window.java Tue Feb 05 08:36:01 2013 +0000 @@ -1206,7 +1206,7 @@ } else { try { - EventQueue.invokeAndWait(action); + EventQueue.invokeAndWait(this, action); } catch (InterruptedException e) { System.err.println("Disposal was interrupted:"); diff -r 8fccb53fef83 -r 0256f476a911 src/share/classes/java/io/ObjectInputStream.java --- a/src/share/classes/java/io/ObjectInputStream.java Mon Jan 14 22:54:05 2013 +0000 +++ b/src/share/classes/java/io/ObjectInputStream.java Tue Feb 05 08:36:01 2013 +0000 @@ -1750,6 +1750,12 @@ ObjectStreamClass desc = readClassDesc(false); desc.checkDeserialize(); + Class cl = desc.forClass(); + if (cl == String.class || cl == Class.class + || cl == ObjectStreamClass.class) { + throw new InvalidClassException("invalid class descriptor"); + } + Object obj; From jvanek at icedtea.classpath.org Tue Feb 5 00:51:15 2013 From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org) Date: Tue, 05 Feb 2013 08:51:15 +0000 Subject: /hg/icedtea-web: Another renamed conflict file for case insensit... Message-ID: changeset fd01cd1c2bbc in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=fd01cd1c2bbc author: Jiri Vanek date: Tue Feb 05 09:51:44 2013 +0100 Another renamed conflict file for case insensitive systems * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1E_x_2s.html Renamed to ParallelAppletsTest_1_x_2EE.html * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1EE_x_2s.html new file. * tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java: (testParallelAppletsTest1Ex2s) adapted to renaming diffstat: ChangeLog | 10 ++ tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1EE_x_2s.html | 44 ++++++++++ tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1E_x_2s.html | 44 ---------- tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java | 2 +- 4 files changed, 55 insertions(+), 45 deletions(-) diffs (125 lines): diff -r e631770d76ba -r fd01cd1c2bbc ChangeLog --- a/ChangeLog Thu Jan 31 11:12:35 2013 +0100 +++ b/ChangeLog Tue Feb 05 09:51:44 2013 +0100 @@ -1,3 +1,13 @@ +2013-02-03 Jiri Vanek + + Another renamed conflict file for case insensitive systems + * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1E_x_2s.html + Renamed to ParallelAppletsTest_1_x_2EE.html + * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1EE_x_2s.html + new file. + * tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java: + (testParallelAppletsTest1Ex2s) adapted to renaming + 2013-01-31 Jiri Vanek Renamed conflict file for case insensitive systems diff -r e631770d76ba -r fd01cd1c2bbc tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1EE_x_2s.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1EE_x_2s.html Tue Feb 05 09:51:44 2013 +0100 @@ -0,0 +1,44 @@ + + +

+

+

+

+ + diff -r e631770d76ba -r fd01cd1c2bbc tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1E_x_2s.html --- a/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1E_x_2s.html Thu Jan 31 11:12:35 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ - - -

-

-

-

- - diff -r e631770d76ba -r fd01cd1c2bbc tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java --- a/tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java Thu Jan 31 11:12:35 2013 +0100 +++ b/tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java Tue Feb 05 09:51:44 2013 +0100 @@ -50,7 +50,7 @@ @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay public void testParallelAppletsTest1Ex2s() throws Exception { - ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1E_x_2s.html"); + ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1EE_x_2s.html"); checkSimpleSignedStarted(pr); checkNotInitialised(pr); } From bugzilla-daemon at icedtea.classpath.org Tue Feb 5 01:35:01 2013 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 05 Feb 2013 09:35:01 +0000 Subject: [Bug 1297] New: [IcedTea6] cacao and jamvm parallel unpack failures Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1297 Bug ID: 1297 Summary: [IcedTea6] cacao and jamvm parallel unpack failures Classification: Unclassified Product: IcedTea Version: 6-hg Hardware: all OS: All Status: NEW Severity: normal Priority: P3 Component: IcedTea Assignee: gnu.andrew at redhat.com Reporter: gnu.andrew at redhat.com CC: unassigned at icedtea.classpath.org Clone of PR1295 for IcedTea6. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130205/5c7f6934/attachment.html From bugzilla-daemon at icedtea.classpath.org Tue Feb 5 01:35:26 2013 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 05 Feb 2013 09:35:26 +0000 Subject: [Bug 1295] Icedtea 6/7: cacao and jamvm parallel unpack failures In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1295 Andrew John Hughes changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Version|unspecified |7-hg Target Milestone|--- |2.1.5 --- Comment #2 from Andrew John Hughes --- Move 6 issue to http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1297 -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130205/66f8cc7d/attachment.html From bugzilla-daemon at icedtea.classpath.org Tue Feb 5 01:36:05 2013 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 05 Feb 2013 09:36:05 +0000 Subject: [Bug 1295] [IcedTea7] cacao and jamvm parallel unpack failures In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1295 Andrew John Hughes changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |1274 Summary|Icedtea 6/7: cacao and |[IcedTea7] cacao and jamvm |jamvm parallel unpack |parallel unpack failures |failures | -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130205/7fd9830f/attachment.html From bugzilla-daemon at icedtea.classpath.org Tue Feb 5 01:36:05 2013 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 05 Feb 2013 09:36:05 +0000 Subject: [Bug 1274] [TRACKER] IcedTea 2.4.0 Release In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1274 Andrew John Hughes changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |1295 -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130205/d2d6f303/attachment.html From bugzilla-daemon at icedtea.classpath.org Tue Feb 5 01:37:21 2013 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 05 Feb 2013 09:37:21 +0000 Subject: [Bug 1272] [TRACKER] IcedTea6 1.13 Release In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1272 Andrew John Hughes changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |1297 -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130205/427de5fe/attachment.html From bugzilla-daemon at icedtea.classpath.org Tue Feb 5 01:37:21 2013 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 05 Feb 2013 09:37:21 +0000 Subject: [Bug 1297] [IcedTea6] cacao and jamvm parallel unpack failures In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1297 Andrew John Hughes changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Blocks| |1272 Target Milestone|--- |6-1.13.0 -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130205/e71ebd82/attachment.html From bugzilla-daemon at icedtea.classpath.org Tue Feb 5 01:37:54 2013 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 05 Feb 2013 09:37:54 +0000 Subject: [Bug 1295] [IcedTea7] jamvm parallel unpack failures In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1295 Andrew John Hughes changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|[IcedTea7] cacao and jamvm |[IcedTea7] jamvm parallel |parallel unpack failures |unpack failures -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130205/a4dd52e1/attachment.html From aph at redhat.com Tue Feb 5 01:54:31 2013 From: aph at redhat.com (Andrew Haley) Date: Tue, 05 Feb 2013 09:54:31 +0000 Subject: The Death of IcedTea? In-Reply-To: <211087304.7902585.1359725417697.JavaMail.root@redhat.com> References: <211087304.7902585.1359725417697.JavaMail.root@redhat.com> Message-ID: <5110D6D7.1050106@redhat.com> On 02/01/2013 01:30 PM, Andrew Hughes wrote: > My thoughts on the future of #IcedTea: http://blog.fuseyism.com/index.php/2013/02/01/the-death-of-icedtea/ > > Thoughts, comments, flames, etc. very much welcomed. Please pass onto others who may be interested. > > A brief disclaimer that these are my personal thoughts, and not necessarily those of Red Hat. There's not much there that I can disagree with. Every day that IcedTea continues to exist marks a failure of OpenJDK. It should be possible for OpenJDK itself to work with CACAO. It should be possible for OpenJDK to have an easy-to-use test suite. Maybe OpenJDK should have a plugin. Etc, etc. And finally, it should be just as easy to work in OpenJDK as it is in IcedTea. But as we all know, it isn't. We need to keep working on that. I'm not sure that I agree that getting security fixes out to users requires IcedTea: it just requires those fixes to be committed to the 7 update tree a bit more promptly. We could do that in the community. For OpenJDK 8, there should be no reason (with the exception of ARM, CACAO, et al.) that we need to package anything other then the upstream release, We need to be packaging development OpenJDK 8 builds in the meantime to make sure this works. Andrew. From ptisnovs at icedtea.classpath.org Tue Feb 5 01:56:01 2013 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Tue, 05 Feb 2013 09:56:01 +0000 Subject: /hg/gfx-test: Four helper methods added into CommonBitmapOperati... Message-ID: changeset fe1337158c95 in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=fe1337158c95 author: Pavel Tisnovsky date: Tue Feb 05 10:59:03 2013 +0100 Four helper methods added into CommonBitmapOperations.java. diffstat: ChangeLog | 5 + src/org/gfxtest/framework/CommonBitmapOperations.java | 105 ++++++++++++++++++ 2 files changed, 110 insertions(+), 0 deletions(-) diffs (125 lines): diff -r 6388bd700344 -r fe1337158c95 ChangeLog --- a/ChangeLog Mon Feb 04 17:27:13 2013 +0100 +++ b/ChangeLog Tue Feb 05 10:59:03 2013 +0100 @@ -1,3 +1,8 @@ +2013-02-05 Pavel Tisnovsky + + * src/org/gfxtest/framework/CommonBitmapOperations.java: + Four helper methods added into CommonBitmapOperations.java. + 2013-02-04 Pavel Tisnovsky * src/org/gfxtest/framework/ImageFactory.java: diff -r 6388bd700344 -r fe1337158c95 src/org/gfxtest/framework/CommonBitmapOperations.java --- a/src/org/gfxtest/framework/CommonBitmapOperations.java Mon Feb 04 17:27:13 2013 +0100 +++ b/src/org/gfxtest/framework/CommonBitmapOperations.java Tue Feb 05 10:59:03 2013 +0100 @@ -1721,4 +1721,109 @@ // BitBlt with custom scaling return performBitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED; } + + /** + * Create new buffered image containing horizontal green gradient and then perform basic BitBlt test. + * + * @param image + * image to which another image is to be drawn + * @param graphics2d + * graphics canvas + * @param imageType + * type of the created image + */ + public static TestResult doBitBltTestWithHorizontalGreenGradientImage(TestImage image, Graphics2D graphics2d, int imageType) + { + // create new buffered bitmap with given type + BufferedImage bufferedImage = ImageFactory.createHorizontalGreenGradientImage(DEFAULT_TEST_IMAGE_WIDTH, DEFAULT_TEST_IMAGE_HEIGHT, imageType); + // basic check if buffered image was created + if (bufferedImage == null) + { + return TestResult.FAILED; + } + // BitBlt with 1:1 scaling + return performBitBlt(bufferedImage, image, graphics2d) ? TestResult.PASSED : TestResult.FAILED; + } + + /** + * Create new buffered image containing horizontal green gradient and then perform + * basic BitBlt test. + * + * @param image + * image to which another image is to be drawn + * @param graphics2d + * graphics canvas + * @param imageType + * type of the created image + * @param width + * width of a image after BitBlt operation is performed + * @param height + * height of a image after BitBlt operation is performed + */ + public static TestResult doBitBltTestWithHorizontalGreenGradientImage(TestImage image, Graphics2D graphics2d, int imageType, + int width, int height) + { + // create new buffered bitmap with given type + BufferedImage bufferedImage = ImageFactory.createHorizontalGreenGradientImage(DEFAULT_TEST_IMAGE_WIDTH, DEFAULT_TEST_IMAGE_HEIGHT, imageType); + // basic check if buffered image was created + if (bufferedImage == null) + { + return TestResult.FAILED; + } + // BitBlt with custom scaling + return performBitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED; + } + + /** + * Create new buffered image containing vertical green gradient and then perform basic BitBlt test. + * + * @param image + * image to which another image is to be drawn + * @param graphics2d + * graphics canvas + * @param imageType + * type of the created image + */ + public static TestResult doBitBltTestWithVerticalGreenGradientImage(TestImage image, Graphics2D graphics2d, int imageType) + { + // create new buffered bitmap with given type + BufferedImage bufferedImage = ImageFactory.createVerticalGreenGradientImage(DEFAULT_TEST_IMAGE_WIDTH, DEFAULT_TEST_IMAGE_HEIGHT, imageType); + // basic check if buffered image was created + if (bufferedImage == null) + { + return TestResult.FAILED; + } + // BitBlt with 1:1 scaling + return performBitBlt(bufferedImage, image, graphics2d) ? TestResult.PASSED : TestResult.FAILED; + } + + /** + * Create new buffered image containing vertical green gradient and then perform + * basic BitBlt test. + * + * @param image + * image to which another image is to be drawn + * @param graphics2d + * graphics canvas + * @param imageType + * type of the created image + * @param width + * width of a image after BitBlt operation is performed + * @param height + * height of a image after BitBlt operation is performed + */ + public static TestResult doBitBltTestWithVerticalGreenGradientImage(TestImage image, Graphics2D graphics2d, int imageType, + int width, int height) + { + // create new buffered bitmap with given type + BufferedImage bufferedImage = ImageFactory.createVerticalGreenGradientImage(DEFAULT_TEST_IMAGE_WIDTH, DEFAULT_TEST_IMAGE_HEIGHT, imageType); + // basic check if buffered image was created + if (bufferedImage == null) + { + return TestResult.FAILED; + } + // BitBlt with custom scaling + return performBitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED; + } + } From ptisnovs at icedtea.classpath.org Tue Feb 5 02:05:40 2013 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Tue, 05 Feb 2013 10:05:40 +0000 Subject: /hg/rhino-tests: Two new tests added into the test suite SimpleS... Message-ID: changeset 3a438f8082f6 in /hg/rhino-tests details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=3a438f8082f6 author: Pavel Tisnovsky date: Tue Feb 05 11:08:40 2013 +0100 Two new tests added into the test suite SimpleScriptContextClassTest: getMethod() and getDeclaredMethod(). diffstat: ChangeLog | 6 + src/org/RhinoTests/SimpleScriptContextClassTest.java | 134 +++++++++++++++++++ 2 files changed, 140 insertions(+), 0 deletions(-) diffs (157 lines): diff -r 95723cffb439 -r 3a438f8082f6 ChangeLog --- a/ChangeLog Mon Feb 04 17:30:29 2013 +0100 +++ b/ChangeLog Tue Feb 05 11:08:40 2013 +0100 @@ -1,3 +1,9 @@ +2013-02-05 Pavel Tisnovsky + + * src/org/RhinoTests/SimpleScriptContextClassTest.java: + Two new tests added into the test suite SimpleScriptContextClassTest: + getMethod() and getDeclaredMethod(). + 2013-02-04 Pavel Tisnovsky * src/org/RhinoTests/CompilableClassTest.java: diff -r 95723cffb439 -r 3a438f8082f6 src/org/RhinoTests/SimpleScriptContextClassTest.java --- a/src/org/RhinoTests/SimpleScriptContextClassTest.java Mon Feb 04 17:30:29 2013 +0100 +++ b/src/org/RhinoTests/SimpleScriptContextClassTest.java Tue Feb 05 11:08:40 2013 +0100 @@ -548,6 +548,140 @@ } /** + * Test for method javax.script.SimpleScriptContext.getClass().getMethod() + */ + protected void testGetMethod() { + // following methods should exist + Map methodsThatShouldExist_jdk6 = new TreeMap(); + methodsThatShouldExist_jdk6.put("setBindings", new Class[] {javax.script.Bindings.class, int.class}); + methodsThatShouldExist_jdk6.put("getBindings", new Class[] {int.class}); + methodsThatShouldExist_jdk6.put("getWriter", new Class[] {}); + methodsThatShouldExist_jdk6.put("setWriter", new Class[] {java.io.Writer.class}); + methodsThatShouldExist_jdk6.put("getReader", new Class[] {}); + methodsThatShouldExist_jdk6.put("setReader", new Class[] {java.io.Reader.class}); + methodsThatShouldExist_jdk6.put("getErrorWriter", new Class[] {}); + methodsThatShouldExist_jdk6.put("setErrorWriter", new Class[] {java.io.Writer.class}); + methodsThatShouldExist_jdk6.put("setAttribute", new Class[] {java.lang.String.class, java.lang.Object.class, int.class}); + methodsThatShouldExist_jdk6.put("getAttribute", new Class[] {java.lang.String.class}); + methodsThatShouldExist_jdk6.put("getAttribute", new Class[] {java.lang.String.class, int.class}); + methodsThatShouldExist_jdk6.put("removeAttribute", new Class[] {java.lang.String.class, int.class}); + methodsThatShouldExist_jdk6.put("getAttributesScope", new Class[] {java.lang.String.class}); + methodsThatShouldExist_jdk6.put("getScopes", new Class[] {}); + methodsThatShouldExist_jdk6.put("wait", new Class[] {long.class}); + methodsThatShouldExist_jdk6.put("wait", new Class[] {long.class, int.class}); + methodsThatShouldExist_jdk6.put("wait", new Class[] {}); + methodsThatShouldExist_jdk6.put("hashCode", new Class[] {}); + methodsThatShouldExist_jdk6.put("getClass", new Class[] {}); + methodsThatShouldExist_jdk6.put("equals", new Class[] {java.lang.Object.class}); + methodsThatShouldExist_jdk6.put("toString", new Class[] {}); + methodsThatShouldExist_jdk6.put("notify", new Class[] {}); + methodsThatShouldExist_jdk6.put("notifyAll", new Class[] {}); + + Map methodsThatShouldExist_jdk7 = new TreeMap(); + methodsThatShouldExist_jdk7.put("getErrorWriter", new Class[] {}); + methodsThatShouldExist_jdk7.put("getBindings", new Class[] {int.class}); + methodsThatShouldExist_jdk7.put("getReader", new Class[] {}); + methodsThatShouldExist_jdk7.put("getWriter", new Class[] {}); + methodsThatShouldExist_jdk7.put("setBindings", new Class[] {javax.script.Bindings.class, int.class}); + methodsThatShouldExist_jdk7.put("setErrorWriter", new Class[] {java.io.Writer.class}); + methodsThatShouldExist_jdk7.put("setReader", new Class[] {java.io.Reader.class}); + methodsThatShouldExist_jdk7.put("setWriter", new Class[] {java.io.Writer.class}); + methodsThatShouldExist_jdk7.put("getAttribute", new Class[] {java.lang.String.class}); + methodsThatShouldExist_jdk7.put("getAttribute", new Class[] {java.lang.String.class, int.class}); + methodsThatShouldExist_jdk7.put("getAttributesScope", new Class[] {java.lang.String.class}); + methodsThatShouldExist_jdk7.put("getScopes", new Class[] {}); + methodsThatShouldExist_jdk7.put("removeAttribute", new Class[] {java.lang.String.class, int.class}); + methodsThatShouldExist_jdk7.put("setAttribute", new Class[] {java.lang.String.class, java.lang.Object.class, int.class}); + methodsThatShouldExist_jdk7.put("wait", new Class[] {long.class, int.class}); + methodsThatShouldExist_jdk7.put("wait", new Class[] {long.class}); + methodsThatShouldExist_jdk7.put("wait", new Class[] {}); + methodsThatShouldExist_jdk7.put("equals", new Class[] {java.lang.Object.class}); + methodsThatShouldExist_jdk7.put("toString", new Class[] {}); + methodsThatShouldExist_jdk7.put("hashCode", new Class[] {}); + methodsThatShouldExist_jdk7.put("getClass", new Class[] {}); + methodsThatShouldExist_jdk7.put("notify", new Class[] {}); + methodsThatShouldExist_jdk7.put("notifyAll", new Class[] {}); + + Map methodsThatShouldExist = getJavaVersion() < 7 ? methodsThatShouldExist_jdk6 : methodsThatShouldExist_jdk7; + + // check if all required methods really exist + for (Map.Entry methodThatShouldExists : methodsThatShouldExist.entrySet()) { + try { + Method method = this.simpleScriptContextClass.getMethod(methodThatShouldExists.getKey(), methodThatShouldExists.getValue()); + assertNotNull(method, + "method " + methodThatShouldExists.getKey() + " not found"); + String methodName = method.getName(); + assertNotNull(methodName, + "method " + methodThatShouldExists.getKey() + " does not have name assigned"); + assertTrue(methodName.equals(methodThatShouldExists.getKey()), + "method " + methodThatShouldExists.getKey() + " not found"); + } + catch (Exception e) { + e.printStackTrace(); + throw new AssertionError(e.getMessage()); + } + } + } + + /** + * Test for method javax.script.SimpleScriptContext.getClass().getDeclaredMethod() + */ + protected void testGetDeclaredMethod() { + // following methods should exist + Map methodsThatShouldExist_jdk6 = new TreeMap(); + methodsThatShouldExist_jdk6.put("setBindings", new Class[] {javax.script.Bindings.class, int.class}); + methodsThatShouldExist_jdk6.put("getBindings", new Class[] {int.class}); + methodsThatShouldExist_jdk6.put("getWriter", new Class[] {}); + methodsThatShouldExist_jdk6.put("setWriter", new Class[] {java.io.Writer.class}); + methodsThatShouldExist_jdk6.put("getReader", new Class[] {}); + methodsThatShouldExist_jdk6.put("setReader", new Class[] {java.io.Reader.class}); + methodsThatShouldExist_jdk6.put("getErrorWriter", new Class[] {}); + methodsThatShouldExist_jdk6.put("setErrorWriter", new Class[] {java.io.Writer.class}); + methodsThatShouldExist_jdk6.put("setAttribute", new Class[] {java.lang.String.class, java.lang.Object.class, int.class}); + methodsThatShouldExist_jdk6.put("getAttribute", new Class[] {java.lang.String.class}); + methodsThatShouldExist_jdk6.put("getAttribute", new Class[] {java.lang.String.class, int.class}); + methodsThatShouldExist_jdk6.put("removeAttribute", new Class[] {java.lang.String.class, int.class}); + methodsThatShouldExist_jdk6.put("getAttributesScope", new Class[] {java.lang.String.class}); + methodsThatShouldExist_jdk6.put("getScopes", new Class[] {}); + + Map methodsThatShouldExist_jdk7 = new TreeMap(); + methodsThatShouldExist_jdk7.put("getErrorWriter", new Class[] {}); + methodsThatShouldExist_jdk7.put("getBindings", new Class[] {int.class}); + methodsThatShouldExist_jdk7.put("getReader", new Class[] {}); + methodsThatShouldExist_jdk7.put("getWriter", new Class[] {}); + methodsThatShouldExist_jdk7.put("setBindings", new Class[] {javax.script.Bindings.class, int.class}); + methodsThatShouldExist_jdk7.put("setErrorWriter", new Class[] {java.io.Writer.class}); + methodsThatShouldExist_jdk7.put("setReader", new Class[] {java.io.Reader.class}); + methodsThatShouldExist_jdk7.put("setWriter", new Class[] {java.io.Writer.class}); + methodsThatShouldExist_jdk7.put("getAttribute", new Class[] {java.lang.String.class}); + methodsThatShouldExist_jdk7.put("getAttribute", new Class[] {java.lang.String.class, int.class}); + methodsThatShouldExist_jdk7.put("getAttributesScope", new Class[] {java.lang.String.class}); + methodsThatShouldExist_jdk7.put("getScopes", new Class[] {}); + methodsThatShouldExist_jdk7.put("removeAttribute", new Class[] {java.lang.String.class, int.class}); + methodsThatShouldExist_jdk7.put("setAttribute", new Class[] {java.lang.String.class, java.lang.Object.class, int.class}); + + Map methodsThatShouldExist = getJavaVersion() < 7 ? methodsThatShouldExist_jdk6 : methodsThatShouldExist_jdk7; + + // check if all required methods really exist + for (Map.Entry methodThatShouldExists : methodsThatShouldExist.entrySet()) { + try { + Method method = this.simpleScriptContextClass.getDeclaredMethod(methodThatShouldExists.getKey(), methodThatShouldExists.getValue()); + assertNotNull(method, + "method " + methodThatShouldExists.getKey() + " not found"); + String methodName = method.getName(); + assertNotNull(methodName, + "method " + methodThatShouldExists.getKey() + " does not have name assigned"); + assertTrue(methodName.equals(methodThatShouldExists.getKey()), + "method " + methodThatShouldExists.getKey() + " not found"); + } + catch (Exception e) { + e.printStackTrace(); + throw new AssertionError(e.getMessage()); + } + } + } + + /** * Test for method javax.script.SimpleScriptContext.getClass().getAnnotations() */ protected void testGetAnnotations() { From andrew at icedtea.classpath.org Tue Feb 5 03:08:48 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 05 Feb 2013 11:08:48 +0000 Subject: /hg/release/icedtea7-forest-2.1: Added tag icedtea-2.1.5 for cha... Message-ID: changeset 9806157f99d2 in /hg/release/icedtea7-forest-2.1 details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1?cmd=changeset;node=9806157f99d2 author: andrew date: Tue Feb 05 11:08:11 2013 +0000 Added tag icedtea-2.1.5 for changeset bc612c7c99ec diffstat: .hgtags | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diffs (8 lines): diff -r bc612c7c99ec -r 9806157f99d2 .hgtags --- a/.hgtags Mon Jan 14 22:22:10 2013 +0000 +++ b/.hgtags Tue Feb 05 11:08:11 2013 +0000 @@ -151,3 +151,4 @@ 7f3d1172a6a4f6e885c8ae2b6a5d6a5265f17532 icedtea-2.1.2 1e3893e92a164926556f0bde7aea8cf93a73a403 icedtea-2.1.3 f89009ada191aa33887530d70c039f0b8fee6070 icedtea-2.1.4 +bc612c7c99eca70b87bb076a4699f21857cafc3b icedtea-2.1.5 From andrew at icedtea.classpath.org Tue Feb 5 03:08:55 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 05 Feb 2013 11:08:55 +0000 Subject: /hg/release/icedtea7-forest-2.1/corba: 5 new changesets Message-ID: changeset 9d9b17ad1fe9 in /hg/release/icedtea7-forest-2.1/corba details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/corba?cmd=changeset;node=9d9b17ad1fe9 author: mbankal date: Fri Nov 09 10:20:16 2012 -0800 7141694: Improving CORBA internals Reviewed-by: coffeys, ahgross changeset c51ab72d2c85 in /hg/release/icedtea7-forest-2.1/corba details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/corba?cmd=changeset;node=c51ab72d2c85 author: coffeys date: Tue Nov 06 15:50:14 2012 +0000 7201066: Change modifiers on unused fields Reviewed-by: alanb, skoivu changeset ab532d6a78d1 in /hg/release/icedtea7-forest-2.1/corba details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/corba?cmd=changeset;node=ab532d6a78d1 author: ngmr date: Tue Oct 30 17:15:13 2012 +0000 8000540: Improve IIOP type reuse management Reviewed-by: alanb, ahgross, coffeys changeset 50f1d640ea27 in /hg/release/icedtea7-forest-2.1/corba details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/corba?cmd=changeset;node=50f1d640ea27 author: andrew date: Tue Feb 05 08:39:53 2013 +0000 8000631: Restrict access to class constructor Reviewed-by: alanb, ahgross changeset 104afef69da6 in /hg/release/icedtea7-forest-2.1/corba details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/corba?cmd=changeset;node=104afef69da6 author: andrew date: Tue Feb 05 11:08:12 2013 +0000 Added tag icedtea-2.1.5 for changeset 50f1d640ea27 diffstat: .hgtags | 1 + make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk | 14 +- src/share/classes/com/sun/corba/se/impl/activation/ServerMain.java | 8 +- src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java | 6 +- src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java | 61 +---- src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java | 20 +- src/share/classes/com/sun/corba/se/impl/io/FVDCodeBaseImpl.java | 8 +- src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java | 114 +++------ src/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java | 85 +----- src/share/classes/com/sun/corba/se/impl/io/ValueUtility.java | 10 +- src/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java | 6 +- src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java | 2 +- src/share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java | 38 +--- src/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamClass_1_3_1.java | 6 +- src/share/classes/com/sun/corba/se/impl/orbutil/RepositoryIdFactory.java | 53 +---- src/share/classes/com/sun/corba/se/spi/orb/ORB.java | 37 +- 16 files changed, 128 insertions(+), 341 deletions(-) diffs (truncated from 912 to 500 lines): diff -r fccd14ecf86c -r 104afef69da6 .hgtags --- a/.hgtags Mon Jan 14 22:22:11 2013 +0000 +++ b/.hgtags Tue Feb 05 11:08:12 2013 +0000 @@ -151,3 +151,4 @@ 8c5573b22489182901b2fafaec3950b1c09a6851 icedtea-2.1.2 5fb07c08e9e8c7b62395b0dc5f5a95086a7bb718 icedtea-2.1.3 79ee8535bc518acf1156438967170004cc1eaab4 icedtea-2.1.4 +50f1d640ea27ea178b679d5ed67f19ecef698796 icedtea-2.1.5 diff -r fccd14ecf86c -r 104afef69da6 make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk --- a/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk Mon Jan 14 22:22:11 2013 +0000 +++ b/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk Tue Feb 05 11:08:12 2013 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2012, 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 @@ -29,10 +29,6 @@ com/sun/corba/se/impl/orbutil/DenseIntMapImpl.java \ com/sun/corba/se/impl/orbutil/GetPropertyAction.java \ com/sun/corba/se/impl/orbutil/HexOutputStream.java \ - com/sun/corba/se/impl/orbutil/IIOPInputStream_1_3.java \ - com/sun/corba/se/impl/orbutil/IIOPInputStream_1_3_1.java \ - com/sun/corba/se/impl/orbutil/IIOPOutputStream_1_3.java \ - com/sun/corba/se/impl/orbutil/IIOPOutputStream_1_3_1.java \ com/sun/corba/se/impl/orbutil/LegacyHookGetFields.java \ com/sun/corba/se/impl/orbutil/LegacyHookPutFields.java \ com/sun/corba/se/impl/orbutil/LogKeywords.java \ @@ -45,19 +41,11 @@ com/sun/corba/se/impl/orbutil/ORBUtility.java \ com/sun/corba/se/impl/orbutil/ORBClassLoader.java \ com/sun/corba/se/impl/orbutil/RepIdDelegator.java \ - com/sun/corba/se/impl/orbutil/RepIdDelegator_1_3.java \ - com/sun/corba/se/impl/orbutil/RepIdDelegator_1_3_1.java \ - com/sun/corba/se/impl/orbutil/RepositoryIdCache_1_3.java \ - com/sun/corba/se/impl/orbutil/RepositoryId_1_3.java \ com/sun/corba/se/impl/orbutil/RepositoryIdFactory.java \ com/sun/corba/se/impl/orbutil/RepositoryIdStrings.java \ com/sun/corba/se/impl/orbutil/RepositoryIdUtility.java \ com/sun/corba/se/impl/orbutil/RepositoryIdInterface.java \ - com/sun/corba/se/impl/orbutil/RepositoryIdCache_1_3_1.java \ - com/sun/corba/se/impl/orbutil/RepositoryId_1_3_1.java \ com/sun/corba/se/impl/orbutil/StackImpl.java \ - com/sun/corba/se/impl/orbutil/ValueHandlerImpl_1_3_1.java \ - com/sun/corba/se/impl/orbutil/ValueHandlerImpl_1_3.java \ com/sun/corba/se/impl/orbutil/closure/Future.java \ com/sun/corba/se/impl/orbutil/closure/Constant.java \ com/sun/corba/se/impl/orbutil/concurrent/Sync.java \ diff -r fccd14ecf86c -r 104afef69da6 src/share/classes/com/sun/corba/se/impl/activation/ServerMain.java --- a/src/share/classes/com/sun/corba/se/impl/activation/ServerMain.java Mon Jan 14 22:22:11 2013 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/activation/ServerMain.java Tue Feb 05 11:08:12 2013 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -322,9 +322,9 @@ com.sun.corba.se.spi.activation._ServerImplBase { private ORB orb; - private Method installMethod ; - private Method uninstallMethod ; - private Method shutdownMethod ; + private transient Method installMethod ; + private transient Method uninstallMethod ; + private transient Method shutdownMethod ; private Object methodArgs[] ; ServerCallback(ORB orb, Method installMethod, Method uninstallMethod, diff -r fccd14ecf86c -r 104afef69da6 src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java --- a/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java Mon Jan 14 22:22:11 2013 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java Tue Feb 05 11:08:12 2013 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -1218,7 +1218,7 @@ // See bug 4391648 for more info about the tcORB in this // case. RepositoryIdStrings repStrs - = RepositoryIdFactory.getRepIdStringsFactory(tcORB); + = RepositoryIdFactory.getRepIdStringsFactory(); // Assertion: c instanceof Serializable? @@ -1251,7 +1251,7 @@ // Anything else // We know that this is a TypeCodeImpl since it is our ORB classTC = (TypeCodeImpl)ValueUtility.createTypeCodeForClass( - tcORB, c, ORBUtility.createValueHandler(tcORB)); + tcORB, c, ORBUtility.createValueHandler()); // Intruct classTC to store its buffer classTC.setCaching(true); // Update the cache diff -r fccd14ecf86c -r 104afef69da6 src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java --- a/src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java Mon Jan 14 22:22:11 2013 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java Tue Feb 05 11:08:12 2013 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -269,8 +269,8 @@ private final void createRepositoryIdHandlers() { - repIdUtil = RepositoryIdFactory.getRepIdUtility(orb); - repIdStrs = RepositoryIdFactory.getRepIdStringsFactory(orb); + repIdUtil = RepositoryIdFactory.getRepIdUtility(); + repIdStrs = RepositoryIdFactory.getRepIdStringsFactory(); } public GIOPVersion getGIOPVersion() { @@ -564,10 +564,7 @@ checkForNegativeLength(len); - if (orb != null && ORBUtility.isLegacyORB((ORB)orb)) - return legacyReadString(len); - else - return internalReadString(len); + return internalReadString(len); } private final String internalReadString(int len) { @@ -588,54 +585,6 @@ return new String(result, 0, getCharConverter().getNumChars()); } - private final String legacyReadString(int len) { - - // - // Workaround for ORBs which send string lengths of - // zero to mean empty string. - // - // - // IMPORTANT: Do not replace 'new String("")' with "", it may result - // in a Serialization bug (See serialization.zerolengthstring) and - // bug id: 4728756 for details - if (len == 0) - return new String(""); - - len--; - char[] c = new char[len]; - - int n = 0; - while (n < len) { - int avail; - int bytes; - int wanted; - - avail = bbwi.buflen - bbwi.position(); - if (avail <= 0) { - grow(1, 1); - avail = bbwi.buflen - bbwi.position(); - } - wanted = len - n; - bytes = (wanted < avail) ? wanted : avail; - // Microbenchmarks are showing a loop of ByteBuffer.get(int) being - // faster than ByteBuffer.get(byte[], int, int). - for (int i=0; i bbwi.buflen) - alignAndCheck(1, 1); - bbwi.position(bbwi.position() + 1); - - return new String(c); - } - public final String read_string() { return readStringOrIndirection(false); } @@ -1045,7 +994,7 @@ try { if (valueHandler == null) - valueHandler = ORBUtility.createValueHandler(orb); + valueHandler = ORBUtility.createValueHandler(); value = valueHandler.readValue(parent, indirection, diff -r fccd14ecf86c -r 104afef69da6 src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java --- a/src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java Mon Jan 14 22:22:11 2013 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java Tue Feb 05 11:08:12 2013 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2012, 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 @@ -189,18 +189,8 @@ private final void createRepositoryIdHandlers() { - if (orb != null) { - // Get the appropriate versions based on the ORB version. The - // ORB versioning info is only in the core ORB. - repIdUtil - = RepositoryIdFactory.getRepIdUtility(orb); - repIdStrs - = RepositoryIdFactory.getRepIdStringsFactory(orb); - } else { - // Get the latest versions - repIdUtil = RepositoryIdFactory.getRepIdUtility(); - repIdStrs = RepositoryIdFactory.getRepIdStringsFactory(); - } + repIdUtil = RepositoryIdFactory.getRepIdUtility(); + repIdStrs = RepositoryIdFactory.getRepIdStringsFactory(); } public BufferManagerWrite getBufferManager() @@ -705,7 +695,7 @@ private void writeArray(Serializable array, Class clazz) { if (valueHandler == null) - valueHandler = ORBUtility.createValueHandler(orb); //d11638 + valueHandler = ORBUtility.createValueHandler(); //d11638 // Write value_tag int indirection = writeValueTag(mustChunk, true, @@ -768,7 +758,7 @@ private void writeRMIIIOPValueType(Serializable object, Class clazz) { if (valueHandler == null) - valueHandler = ORBUtility.createValueHandler(orb); //d11638 + valueHandler = ORBUtility.createValueHandler(); //d11638 Serializable key = object; diff -r fccd14ecf86c -r 104afef69da6 src/share/classes/com/sun/corba/se/impl/io/FVDCodeBaseImpl.java --- a/src/share/classes/com/sun/corba/se/impl/io/FVDCodeBaseImpl.java Mon Jan 14 22:22:11 2013 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/io/FVDCodeBaseImpl.java Tue Feb 05 11:08:12 2013 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2011, 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 @@ -86,7 +86,7 @@ // default to using the current ORB version in case the // vhandler is not set if (vhandler == null) { - vhandler = new ValueHandlerImpl(false); + vhandler = ValueHandlerImpl.getInstance(false); } // Util.getCodebase may return null which would @@ -120,7 +120,7 @@ // default to using the current ORB version in case the // vhandler is not set if (vhandler == null) { - vhandler = new ValueHandlerImpl(false); + vhandler = ValueHandlerImpl.getInstance(false); } try{ @@ -161,7 +161,7 @@ // default to using the current ORB version in case the // vhandler is not set if (vhandler == null) { - vhandler = new ValueHandlerImpl(false); + vhandler = ValueHandlerImpl.getInstance(false); } Stack repIds = new Stack(); diff -r fccd14ecf86c -r 104afef69da6 src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java --- a/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java Mon Jan 14 22:22:11 2013 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java Tue Feb 05 11:08:12 2013 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2012, 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 @@ -25,7 +25,7 @@ /* * Licensed Materials - Property of IBM * RMI-IIOP v1.0 - * Copyright IBM Corp. 1998 1999 All Rights Reserved + * Copyright IBM Corp. 1998 2012 All Rights Reserved * */ @@ -56,7 +56,6 @@ import java.util.Arrays; import java.util.Comparator; -import java.util.Hashtable; import com.sun.corba.se.impl.util.RepositoryId; @@ -83,8 +82,6 @@ private static Object noArgsList[] = {}; private static Class noTypesList[] = {}; - private static Hashtable translatedFields; - /** true if represents enum type */ private boolean isEnum; @@ -384,6 +381,42 @@ */ } + private static final class PersistentFieldsValue + extends ClassValue { + PersistentFieldsValue() { } + + protected ObjectStreamField[] computeValue(Class type) { + try { + Field pf = type.getDeclaredField("serialPersistentFields"); + int mods = pf.getModifiers(); + if (Modifier.isPrivate(mods) && Modifier.isStatic(mods) && + Modifier.isFinal(mods)) { + pf.setAccessible(true); + java.io.ObjectStreamField[] fields = + (java.io.ObjectStreamField[])pf.get(type); + return translateFields(fields); + } + } catch (NoSuchFieldException | IllegalAccessException | + IllegalArgumentException | ClassCastException e) { + } + return null; + } + + private static ObjectStreamField[] translateFields( + java.io.ObjectStreamField[] fields) { + ObjectStreamField[] translation = + new ObjectStreamField[fields.length]; + for (int i = 0; i < fields.length; i++) { + translation[i] = new ObjectStreamField(fields[i].getName(), + fields[i].getType()); + } + return translation; + } + } + + private static final PersistentFieldsValue persistentFieldsValue = + new PersistentFieldsValue(); + /* * Initialize class descriptor. This method is only invoked on class * descriptors created via calls to lookupInternal(). This method is kept @@ -416,35 +449,7 @@ * If it is declared, use the declared serialPersistentFields. * Otherwise, extract the fields from the class itself. */ - try { - Field pf = cl.getDeclaredField("serialPersistentFields"); - // serial bug 7; the serialPersistentFields were not - // being read and stored as Accessible bit was not set - pf.setAccessible(true); - // serial bug 7; need to find if the field is of type - // java.io.ObjectStreamField - java.io.ObjectStreamField[] f = - (java.io.ObjectStreamField[])pf.get(cl); - int mods = pf.getModifiers(); - if ((Modifier.isPrivate(mods)) && - (Modifier.isStatic(mods)) && - (Modifier.isFinal(mods))) - { - fields = (ObjectStreamField[])translateFields((Object[])pf.get(cl)); - } - } catch (NoSuchFieldException e) { - fields = null; - } catch (IllegalAccessException e) { - fields = null; - } catch (IllegalArgumentException e) { - fields = null; - } catch (ClassCastException e) { - /* Thrown if a field serialPersistentField exists - * but it is not of type ObjectStreamField. - */ - fields = null; - } - + fields = persistentFieldsValue.get(cl); if (fields == null) { /* Get all of the declared fields for this @@ -641,43 +646,6 @@ superclass = null; } - private static Object[] translateFields(Object objs[]) - throws NoSuchFieldException { - try{ - java.io.ObjectStreamField fields[] = (java.io.ObjectStreamField[])objs; - Object translation[] = null; - - if (translatedFields == null) - translatedFields = new Hashtable(); - - translation = (Object[])translatedFields.get(fields); - - if (translation != null) - return translation; - else { - Class osfClass = Class.forName("com.sun.corba.se.impl.io.ObjectStreamField"); - translation = (Object[])java.lang.reflect.Array.newInstance(osfClass, objs.length); - Object arg[] = new Object[2]; - Class types[] = {String.class, Class.class}; - Constructor constructor = osfClass.getDeclaredConstructor(types); - for (int i = fields.length -1; i >= 0; i--){ - arg[0] = fields[i].getName(); - arg[1] = fields[i].getType(); - - translation[i] = constructor.newInstance(arg); - } - translatedFields.put(fields, translation); - - } - - return (Object[])translation; - } - catch(Throwable t){ - NoSuchFieldException nsfe = new NoSuchFieldException(); - nsfe.initCause( t ) ; - throw nsfe ; - } - } /* * Set the class this version descriptor matches. @@ -1555,8 +1523,8 @@ private boolean hasExternalizableBlockData; Method writeObjectMethod; Method readObjectMethod; - private Method writeReplaceObjectMethod; - private Method readResolveObjectMethod; + private transient Method writeReplaceObjectMethod; + private transient Method readResolveObjectMethod; private Constructor cons ; /** diff -r fccd14ecf86c -r 104afef69da6 src/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java --- a/src/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java Mon Jan 14 22:22:11 2013 +0000 +++ b/src/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java Tue Feb 05 11:08:12 2013 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2012, 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 @@ -53,7 +53,7 @@ import com.sun.corba.se.impl.logging.OMGSystemException; import com.sun.corba.se.impl.logging.UtilSystemException; -public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat { +public final class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat { // Property to override our maximum stream format version public static final String FORMAT_VERSION_PROPERTY @@ -150,14 +150,22 @@ writeValueWithVersion(out, value, streamFormatVersion); } - public ValueHandlerImpl(){} + private ValueHandlerImpl(){} - public ValueHandlerImpl(boolean isInputStream) { + private ValueHandlerImpl(boolean isInputStream) { this(); useHashtables = false; this.isInputStream = isInputStream; } + static ValueHandlerImpl getInstance() { + return new ValueHandlerImpl(); + } + + static ValueHandlerImpl getInstance(boolean isInputStream) { + return new ValueHandlerImpl(isInputStream); + } + /** * Writes the value to the stream using java semantics. * @param out The stream to write the value to @@ -458,12 +466,7 @@ return ObjectStreamClass.lookup(value.getClass()).writeReplace(value); From andrew at icedtea.classpath.org Tue Feb 5 03:09:00 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 05 Feb 2013 11:09:00 +0000 Subject: /hg/release/icedtea7-forest-2.1/jaxp: 2 new changesets Message-ID: changeset 3cd118e6573d in /hg/release/icedtea7-forest-2.1/jaxp details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jaxp?cmd=changeset;node=3cd118e6573d author: andrew date: Tue Feb 05 08:42:39 2013 +0000 8001235: Improve JAXP HTTP handling Reviewed-by: lancea, skoivu changeset c4bf68441a8d in /hg/release/icedtea7-forest-2.1/jaxp details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jaxp?cmd=changeset;node=c4bf68441a8d author: andrew date: Tue Feb 05 11:08:13 2013 +0000 Added tag icedtea-2.1.5 for changeset 3cd118e6573d diffstat: .hgtags | 1 + sources/jaxp_src/src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java | 2 +- 2 files changed, 2 insertions(+), 1 deletions(-) diffs (20 lines): diff -r fb08c190f504 -r c4bf68441a8d .hgtags --- a/.hgtags Mon Jan 14 22:22:11 2013 +0000 +++ b/.hgtags Tue Feb 05 11:08:13 2013 +0000 @@ -151,3 +151,4 @@ a812eed5797d5725785e45a13ed767fd1b067018 icedtea-2.1.2 68cc6550c43e7327e9b9556d1db8abd070ae3b91 icedtea-2.1.3 77e7219c74241ff6bc56e5bb973376458ed11b2b icedtea-2.1.4 +3cd118e6573deb6139bcf6247d2577748f529105 icedtea-2.1.5 diff -r fb08c190f504 -r c4bf68441a8d sources/jaxp_src/src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java --- a/sources/jaxp_src/src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java Mon Jan 14 22:22:11 2013 +0000 +++ b/sources/jaxp_src/src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java Tue Feb 05 11:08:13 2013 +0000 @@ -163,7 +163,7 @@ * should already be fully qualified as path/filename * @param target The target property bag the file will be placed into. */ - public void loadPropertyFile(String file, Properties target) + private void loadPropertyFile(String file, Properties target) { try { From andrew at icedtea.classpath.org Tue Feb 5 03:09:06 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 05 Feb 2013 11:09:06 +0000 Subject: /hg/release/icedtea7-forest-2.1/jaxws: Added tag icedtea-2.1.5 f... Message-ID: changeset 5c2f1241ceac in /hg/release/icedtea7-forest-2.1/jaxws details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jaxws?cmd=changeset;node=5c2f1241ceac author: andrew date: Tue Feb 05 11:08:14 2013 +0000 Added tag icedtea-2.1.5 for changeset 77e7849c5e50 diffstat: .hgtags | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diffs (8 lines): diff -r 77e7849c5e50 -r 5c2f1241ceac .hgtags --- a/.hgtags Mon Jan 14 22:22:12 2013 +0000 +++ b/.hgtags Tue Feb 05 11:08:14 2013 +0000 @@ -151,3 +151,4 @@ 4bb1edad129c0c441e01905b8bb43620f521bbcf icedtea-2.1.2 27864fc818734473ceb15afcb9375504a32fe936 icedtea-2.1.3 d92eda447bca8cdc2d53d93c80c2a014d7d05f21 icedtea-2.1.4 +77e7849c5e50667e32d0c4cb0166b94d63ec8842 icedtea-2.1.5 From andrew at icedtea.classpath.org Tue Feb 5 03:09:11 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 05 Feb 2013 11:09:11 +0000 Subject: /hg/release/icedtea7-forest-2.1/langtools: Added tag icedtea-2.1... Message-ID: changeset e351b6e580c2 in /hg/release/icedtea7-forest-2.1/langtools details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/langtools?cmd=changeset;node=e351b6e580c2 author: andrew date: Tue Feb 05 11:08:16 2013 +0000 Added tag icedtea-2.1.5 for changeset de674a569978 diffstat: .hgtags | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diffs (8 lines): diff -r de674a569978 -r e351b6e580c2 .hgtags --- a/.hgtags Mon Jan 14 22:22:13 2013 +0000 +++ b/.hgtags Tue Feb 05 11:08:16 2013 +0000 @@ -151,3 +151,4 @@ 25c8b4900996be7ae923a336ea2d4e1ddb07a006 icedtea-2.1.2 59d1da0990018410db0cdff04e96fb7dd4d0d0a3 icedtea-2.1.3 fd2fdb20d8585ebffee074e82b040f3b2af5ee83 icedtea-2.1.4 +de674a5699784ac2d9ad945d93b341dcc82db5a5 icedtea-2.1.5 From andrew at icedtea.classpath.org Tue Feb 5 03:09:18 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 05 Feb 2013 11:09:18 +0000 Subject: /hg/release/icedtea7-forest-2.1/hotspot: 2 new changesets Message-ID: changeset 76c46d4d4ad0 in /hg/release/icedtea7-forest-2.1/hotspot details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/hotspot?cmd=changeset;node=76c46d4d4ad0 author: andrew date: Tue Feb 05 08:44:37 2013 +0000 8001307: Modify ACC_SUPER behavior Summary: Disallow non-virtual calls even when ACC_SUPER is absent. Reviewed-by: kvn, acorn changeset 32569b4d36f4 in /hg/release/icedtea7-forest-2.1/hotspot details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/hotspot?cmd=changeset;node=32569b4d36f4 author: andrew date: Tue Feb 05 11:08:17 2013 +0000 Added tag icedtea-2.1.5 for changeset 76c46d4d4ad0 diffstat: .hgtags | 1 + src/share/vm/interpreter/linkResolver.cpp | 2 +- src/share/vm/runtime/globals.hpp | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diffs (35 lines): diff -r 3f345e5f65eb -r 32569b4d36f4 .hgtags --- a/.hgtags Mon Jan 14 22:22:14 2013 +0000 +++ b/.hgtags Tue Feb 05 11:08:17 2013 +0000 @@ -226,3 +226,4 @@ 0000000000000000000000000000000000000000 icedtea-2.1.3 96ba7edfedfab0ed332b24cdb161e73e3add5482 icedtea-2.1.3 a456d0771ba0f6604b172f05f0b594178f7cc49c icedtea-2.1.4 +76c46d4d4ad04e444f0981a559ceff81c74bf1b9 icedtea-2.1.5 diff -r 3f345e5f65eb -r 32569b4d36f4 src/share/vm/interpreter/linkResolver.cpp --- a/src/share/vm/interpreter/linkResolver.cpp Mon Jan 14 22:22:14 2013 +0000 +++ b/src/share/vm/interpreter/linkResolver.cpp Tue Feb 05 11:08:17 2013 +0000 @@ -709,7 +709,7 @@ if (check_access && // a) check if ACC_SUPER flag is set for the current class - current_klass->is_super() && + (current_klass->is_super() || !AllowNonVirtualCalls) && // b) check if the method class is a superclass of the current class (superclass relation is not reflexive!) current_klass->is_subtype_of(method_klass()) && current_klass() != method_klass() && // c) check if the method is not diff -r 3f345e5f65eb -r 32569b4d36f4 src/share/vm/runtime/globals.hpp --- a/src/share/vm/runtime/globals.hpp Mon Jan 14 22:22:14 2013 +0000 +++ b/src/share/vm/runtime/globals.hpp Tue Feb 05 11:08:17 2013 +0000 @@ -3837,7 +3837,10 @@ product(bool, UseVMInterruptibleIO, false, \ "(Unstable, Solaris-specific) Thread interrupt before or with " \ "EINTR for I/O operations results in OS_INTRPT. The default value"\ - " of this flag is true for JDK 6 and earliers") + " of this flag is true for JDK 6 and earlier") \ + \ + product(bool, AllowNonVirtualCalls, false, \ + "Obey the ACC_SUPER flag and allow invokenonvirtual calls") /* * Macros for factoring of globals From andrew at icedtea.classpath.org Tue Feb 5 03:09:28 2013 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Tue, 05 Feb 2013 11:09:28 +0000 Subject: /hg/release/icedtea7-forest-2.1/jdk: 32 new changesets Message-ID: changeset 348ce15c3b92 in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=348ce15c3b92 author: mullan date: Fri Oct 26 14:22:21 2012 -0400 7201068: Better handling of UI elements Reviewed-by: xuelei changeset 9e208d07b47e in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=9e208d07b47e author: dmocek date: Mon Nov 19 13:52:08 2012 -0800 6563318: RMI data sanitization Reviewed-by: ahgross, hawtin, mchung, smarks changeset c090e23f82fb in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=c090e23f82fb author: andrew date: Tue Feb 05 08:49:18 2013 +0000 7175616: Port fix for TimeZone from JDK 8 to JDK 7 Reviewed-by: okutsu changeset 507aca1e14b3 in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=507aca1e14b3 author: andrew date: Tue Feb 05 08:55:45 2013 +0000 6664509: Add logging context 6664528: Find log level matching its name or value given at construction time Reviewed-by: alanb, ahgross, jgish, hawtin changeset 3d2e230bf733 in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=3d2e230bf733 author: dholmes date: Wed Aug 22 21:40:19 2012 -0400 6776941: Improve thread pool shutdown Reviewed-by: dl, skoivu changeset bba4c01b037c in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=bba4c01b037c author: anthony date: Fri Sep 28 18:09:28 2012 +0400 7173145: Improve in-memory representation of splashscreens Reviewed-by: bae, mschoene changeset f083e32a2f8c in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=f083e32a2f8c author: ksrini date: Tue Oct 02 07:05:27 2012 -0700 7186945: Unpack200 improvement Reviewed-by: jrose, jjh, mschoene changeset 307178db1ab4 in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=307178db1ab4 author: ksrini date: Tue Oct 02 07:50:25 2012 -0700 7186946: Refine unpacker resource usage Reviewed-by: jrose, jjh, mschoene changeset a933e3f07c6b in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=a933e3f07c6b author: rupashka date: Tue Oct 16 14:55:17 2012 +0400 7186948: Improve Swing data validation Reviewed-by: art, ahgross changeset 9eb4b6f7f4a1 in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=9eb4b6f7f4a1 author: denis date: Tue Oct 30 22:18:42 2012 +0400 7186952: Improve clipboard access Reviewed-by: serb, ahgross changeset 8c7b55c7852b in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=8c7b55c7852b author: khazra date: Thu Oct 18 12:13:15 2012 -0700 7186954: Improve connection performance Reviewed-by: chegar, skoivu changeset 811e88b05429 in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=811e88b05429 author: ksrini date: Tue Oct 02 07:34:37 2012 -0700 7186957: Improve Pack200 data validation Reviewed-by: jrose, jjh, mschoene changeset 80d3c91ac73d in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=80d3c91ac73d author: xuelei date: Mon Oct 22 07:31:21 2012 -0700 7192392: Better validation of client keys Summary: Also reviewed by Andrew Gross Reviewed-by: vinnie changeset 87dfac0e8806 in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=87dfac0e8806 author: xuelei date: Mon Sep 24 02:06:15 2012 -0700 7192393: Better Checking of order of TLS Messages Summary: Also reviewed by Andrew Gross Reviewed-by: weijun changeset b004e3774785 in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=b004e3774785 author: bagiras date: Tue Nov 13 23:33:57 2012 +0400 7192977: Issue in toolkit thread Reviewed-by: skoivu, rupashka, art changeset 6778773dc878 in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=6778773dc878 author: jrose date: Tue Jun 14 22:47:12 2011 -0700 7054590: (JSR-292) MethodHandleProxies.asInterfaceInstance() accepts private/protected nested interfaces Summary: fix non-compliant logic in MethodHandleProxies, fix invalid private classes in MethodHandlesTest Reviewed-by: twisti, never changeset ae88e718ed8a in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=ae88e718ed8a author: mchung date: Fri Nov 02 15:16:27 2012 -0700 7197546: (proxy) Reflect about creating reflective proxies Reviewed-by: alanb, jdn, jrose changeset b42ade93c6f4 in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=b42ade93c6f4 author: rupashka date: Tue Nov 06 17:49:01 2012 +0400 7200491: Tighten up JTable layout code Reviewed-by: art, skoivu changeset 674515331337 in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=674515331337 author: malenkov date: Mon Oct 15 14:06:54 2012 +0400 7200493: Improve cache handling Reviewed-by: art, ahgross changeset d853f51937df in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=d853f51937df author: andrew date: Tue Feb 05 09:13:06 2013 +0000 7200499: Better data validation for options Reviewed-by: darcy, jjh, mschoene changeset 59e50d6b690d in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=59e50d6b690d author: ksrini date: Tue Oct 16 10:56:25 2012 -0700 7200500: Launcher better input validation Reviewed-by: darcy, jjh, mschoene changeset 39b3aa727ccc in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=39b3aa727ccc author: andrew date: Tue Feb 05 09:15:00 2013 +0000 7201064: Better dialogue checking Reviewed-by: serb, skoivu changeset 16d76993e3ed in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=16d76993e3ed author: smarks date: Thu Nov 08 15:21:44 2012 -0800 7201070: Serialization to conform to protocol Reviewed-by: dmocek, ahgross, skoivu changeset 0adde0c52d36 in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=0adde0c52d36 author: andrew date: Tue Feb 05 09:15:51 2013 +0000 7201071: InetSocketAddress serialization issue Reviewed-by: alanb, michaelm, skoivu changeset f499c68a6a9c in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=f499c68a6a9c author: weijun date: Wed Sep 19 12:58:43 2012 +0800 8000210: Improve JarFile code quality Reviewed-by: ahgross, xuelei, mschoene changeset 229f3b25fb58 in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=229f3b25fb58 author: dsamersoff date: Thu Nov 15 09:41:36 2012 +0100 8000537: Contextualize RequiredModelMBean class Reviewed-by: ahgross, dsamersoff, skoivu Contributed-by: Jaroslav Bachorik changeset f963552922f3 in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=f963552922f3 author: dsamersoff date: Tue Oct 30 17:18:43 2012 +0400 8000539: Introspect JMX data handling Summary: Added extra packageAccess check call Reviewed-by: ahgross, dfuchs Contributed-by: jaroslav.bachorik at oracle.com changeset d27578f1ca5a in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=d27578f1ca5a author: dmocek date: Mon Nov 19 15:32:59 2012 -0800 8001242: Improve RMI HTTP conformance Reviewed-by: ahgross, mchung, smarks changeset e9487fe68325 in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=e9487fe68325 author: bae date: Thu Nov 15 19:16:41 2012 +0400 8001972: Improve image processing Reviewed-by: prr, ahgross changeset eba6d84bc70d in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=eba6d84bc70d author: bae date: Sat Nov 17 18:21:24 2012 +0400 8002325: Improve management of images Reviewed-by: prr, ahgross changeset 73455df094cb in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=73455df094cb author: andrew date: Tue Feb 05 11:08:04 2013 +0000 Fix bad call to checkAndSetPolicy added by security patch. changeset 52029bcc00e1 in /hg/release/icedtea7-forest-2.1/jdk details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=52029bcc00e1 author: andrew date: Tue Feb 05 11:08:18 2013 +0000 Added tag icedtea-2.1.5 for changeset 73455df094cb diffstat: .hgtags | 1 + make/java/java/FILES_java.gmk | 3 +- src/share/bin/jli_util.h | 2 +- src/share/bin/parse_manifest.c | 15 +- src/share/classes/com/sun/beans/finder/MethodFinder.java | 7 +- src/share/classes/com/sun/crypto/provider/DHKeyAgreement.java | 5 + src/share/classes/com/sun/java/util/jar/pack/BandStructure.java | 3 +- src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java | 2 + src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java | 6 +- src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java | 4 +- src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java | 6 +- src/share/classes/com/sun/jmx/mbeanserver/Introspector.java | 8 +- src/share/classes/java/awt/Dialog.java | 53 +- src/share/classes/java/awt/EventQueue.java | 19 +- src/share/classes/java/awt/TextComponent.java | 25 +- src/share/classes/java/awt/Window.java | 2 +- src/share/classes/java/io/ObjectInputStream.java | 6 + src/share/classes/java/lang/Class.java | 47 +- src/share/classes/java/lang/invoke/MethodHandleProxies.java | 114 +- src/share/classes/java/lang/reflect/Proxy.java | 151 ++- src/share/classes/java/net/InetSocketAddress.java | 272 +++- src/share/classes/java/util/TimeZone.java | 59 +- src/share/classes/java/util/concurrent/ThreadPoolExecutor.java | 172 +- src/share/classes/java/util/jar/JarFile.java | 21 +- src/share/classes/java/util/logging/Level.java | 255 ++++- src/share/classes/java/util/logging/LogManager.java | 535 ++++++--- src/share/classes/java/util/logging/Logger.java | 67 +- src/share/classes/java/util/logging/Logging.java | 14 +- src/share/classes/java/util/logging/LoggingProxyImpl.java | 11 +- src/share/classes/java/util/logging/SimpleFormatter.java | 2 +- src/share/classes/javax/management/modelmbean/RequiredModelMBean.java | 227 +++- src/share/classes/javax/swing/JTable.java | 14 +- src/share/classes/javax/swing/RepaintManager.java | 156 +- src/share/classes/javax/swing/UIDefaults.java | 2 + src/share/classes/javax/swing/plaf/nimbus/NimbusLookAndFeel.java | 7 +- src/share/classes/sun/applet/AppletPanel.java | 60 +- src/share/classes/sun/awt/AWTAccessor.java | 7 + src/share/classes/sun/awt/AppContext.java | 62 +- src/share/classes/sun/awt/image/ByteComponentRaster.java | 70 +- src/share/classes/sun/awt/image/ByteInterleavedRaster.java | 29 +- src/share/classes/sun/awt/image/ShortComponentRaster.java | 69 +- src/share/classes/sun/awt/image/ShortInterleavedRaster.java | 29 +- src/share/classes/sun/misc/JavaAWTAccess.java | 42 + src/share/classes/sun/misc/SharedSecrets.java | 13 +- src/share/classes/sun/net/httpserver/ChunkedInputStream.java | 14 +- src/share/classes/sun/net/www/http/ChunkedInputStream.java | 9 + src/share/classes/sun/nio/ch/DatagramChannelImpl.java | 18 +- src/share/classes/sun/reflect/misc/ReflectUtil.java | 59 + src/share/classes/sun/rmi/transport/proxy/CGIHandler.java | 19 +- src/share/classes/sun/rmi/transport/proxy/HttpInputStream.java | 15 +- src/share/classes/sun/security/pkcs11/P11KeyAgreement.java | 9 + src/share/classes/sun/security/ssl/ClientHandshaker.java | 13 +- src/share/classes/sun/security/ssl/DHClientKeyExchange.java | 19 +- src/share/classes/sun/security/ssl/DHCrypt.java | 87 +- src/share/classes/sun/security/ssl/HandshakeMessage.java | 16 +- src/share/classes/sun/security/ssl/RSAClientKeyExchange.java | 4 +- src/share/classes/sun/security/ssl/ServerHandshaker.java | 18 +- src/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java | 4 +- src/share/classes/sun/security/util/DerIndefLenConverter.java | 4 + src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java | 2 +- src/share/classes/sun/security/util/KeyLength.java | 91 - src/share/classes/sun/security/util/KeyUtil.java | 204 +++ src/share/lib/security/java.security | 22 +- src/share/lib/security/java.security-solaris | 16 +- src/share/lib/security/java.security-windows | 16 +- src/share/native/com/sun/java/util/jar/pack/bands.cpp | 4 + src/share/native/com/sun/java/util/jar/pack/bands.h | 4 +- src/share/native/com/sun/java/util/jar/pack/jni.cpp | 53 +- src/share/native/com/sun/java/util/jar/pack/unpack.cpp | 33 +- src/share/native/sun/awt/image/awt_parseImage.c | 110 +- src/share/native/sun/awt/image/awt_parseImage.h | 1 + src/share/native/sun/awt/medialib/safe_alloc.h | 5 + src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c | 4 + src/solaris/classes/sun/nio/ch/SctpChannelImpl.java | 14 +- src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java | 16 +- src/solaris/native/sun/nio/ch/DatagramChannelImpl.c | 9 +- src/solaris/native/sun/nio/ch/SctpChannelImpl.c | 27 +- src/windows/bin/java_md.c | 32 +- src/windows/classes/sun/awt/windows/WComponentPeer.java | 9 +- src/windows/classes/sun/awt/windows/WEmbeddedFrame.java | 15 +- src/windows/native/sun/nio/ch/DatagramChannelImpl.c | 10 +- src/windows/native/sun/windows/awt_TextComponent.cpp | 22 +- src/windows/native/sun/windows/awt_TextComponent.h | 3 +- test/java/lang/invoke/MethodHandlesTest.java | 23 +- 84 files changed, 2643 insertions(+), 1084 deletions(-) diffs (truncated from 6513 to 500 lines): diff -r e7d1cb36e005 -r 52029bcc00e1 .hgtags --- a/.hgtags Mon Jan 14 22:22:15 2013 +0000 +++ b/.hgtags Tue Feb 05 11:08:18 2013 +0000 @@ -155,3 +155,4 @@ 2b707a3a7d8d885d00eab5d0d43dd24d1c5a0213 icedtea-2.1.2 8c49c024c920982eb4a99b5960f260b9210eb363 icedtea-2.1.3 d119038320a3133018f0b968a4e0a9d93ccef76c icedtea-2.1.4 +73455df094cba27f0f9d2b23b8666936b3100683 icedtea-2.1.5 diff -r e7d1cb36e005 -r 52029bcc00e1 make/java/java/FILES_java.gmk --- a/make/java/java/FILES_java.gmk Mon Jan 14 22:22:15 2013 +0000 +++ b/make/java/java/FILES_java.gmk Tue Feb 05 11:08:18 2013 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1996, 2012, 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 @@ -475,6 +475,7 @@ sun/misc/MessageUtils.java \ sun/misc/GC.java \ sun/misc/Service.java \ + sun/misc/JavaAWTAccess.java \ sun/misc/JavaLangAccess.java \ sun/misc/JavaIOAccess.java \ sun/misc/JavaIOFileDescriptorAccess.java \ diff -r e7d1cb36e005 -r 52029bcc00e1 src/share/bin/jli_util.h --- a/src/share/bin/jli_util.h Mon Jan 14 22:22:15 2013 +0000 +++ b/src/share/bin/jli_util.h Tue Feb 05 11:08:18 2013 +0000 @@ -55,7 +55,7 @@ #include #define JLI_StrCaseCmp(p1, p2) stricmp((p1), (p2)) #define JLI_StrNCaseCmp(p1, p2, p3) strnicmp((p1), (p2), (p3)) -#define JLI_Snprintf _snprintf +size_t JLI_Snprintf(char *buffer, size_t size, const char *format, ...); #else #include #define JLI_StrCaseCmp(p1, p2) strcasecmp((p1), (p2)) diff -r e7d1cb36e005 -r 52029bcc00e1 src/share/bin/parse_manifest.c --- a/src/share/bin/parse_manifest.c Mon Jan 14 22:22:15 2013 +0000 +++ b/src/share/bin/parse_manifest.c Tue Feb 05 11:08:18 2013 +0000 @@ -490,9 +490,9 @@ #ifdef O_BINARY | O_BINARY /* use binary mode on windows */ #endif - )) == -1) + )) == -1) { return (-1); - + } info->manifest_version = NULL; info->main_class = NULL; info->jre_version = NULL; @@ -539,12 +539,14 @@ zentry entry; void *data = NULL; - fd = open(jarfile, O_RDONLY + if ((fd = open(jarfile, O_RDONLY #ifdef O_BINARY | O_BINARY /* use binary mode on windows */ #endif - ); - if (fd != -1 && find_file(fd, &entry, filename) == 0) { + )) == -1) { + return NULL; + } + if (find_file(fd, &entry, filename) == 0) { data = inflate_file(fd, &entry, size); } close(fd); @@ -586,8 +588,9 @@ #ifdef O_BINARY | O_BINARY /* use binary mode on windows */ #endif - )) == -1) + )) == -1) { return (-1); + } if (rc = find_file(fd, &entry, manifest_name) != 0) { close(fd); diff -r e7d1cb36e005 -r 52029bcc00e1 src/share/classes/com/sun/beans/finder/MethodFinder.java --- a/src/share/classes/com/sun/beans/finder/MethodFinder.java Mon Jan 14 22:22:15 2013 +0000 +++ b/src/share/classes/com/sun/beans/finder/MethodFinder.java Tue Feb 05 11:08:18 2013 +0000 @@ -68,11 +68,14 @@ Signature signature = new Signature(type, name, args); Method method = CACHE.get(signature); - if (method != null) { + boolean cached = method != null; + if (cached && isPackageAccessible(method.getDeclaringClass())) { return method; } method = findAccessibleMethod(new MethodFinder(name, args).find(type.getMethods())); - CACHE.put(signature, method); + if (!cached) { + CACHE.put(signature, method); + } return method; } diff -r e7d1cb36e005 -r 52029bcc00e1 src/share/classes/com/sun/crypto/provider/DHKeyAgreement.java --- a/src/share/classes/com/sun/crypto/provider/DHKeyAgreement.java Mon Jan 14 22:22:15 2013 +0000 +++ b/src/share/classes/com/sun/crypto/provider/DHKeyAgreement.java Tue Feb 05 11:08:18 2013 +0000 @@ -40,6 +40,8 @@ import javax.crypto.SecretKey; import javax.crypto.spec.*; +import sun.security.util.KeyUtil; + /** * This class implements the Diffie-Hellman key agreement protocol between * any number of parties. @@ -199,6 +201,9 @@ throw new InvalidKeyException("Incompatible parameters"); } + // validate the Diffie-Hellman public key + KeyUtil.validate(dhPubKey); + // store the y value this.y = dhPubKey.getY(); diff -r e7d1cb36e005 -r 52029bcc00e1 src/share/classes/com/sun/java/util/jar/pack/BandStructure.java --- a/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java Mon Jan 14 22:22:15 2013 +0000 +++ b/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java Tue Feb 05 11:08:18 2013 +0000 @@ -1003,7 +1003,6 @@ /** Write a constant pool reference. */ public void putRef(Entry e) { - assert(index != null); addValue(encodeRefOrNull(e, index)); } public void putRef(Entry e, Index index) { @@ -1055,6 +1054,8 @@ int encodeRef(Entry e, Index ix) { + if (ix == null) + throw new RuntimeException("null index for " + e.stringValue()); int coding = ix.indexOf(e); if (verbose > 2) Utils.log.fine("putRef "+coding+" => "+e); diff -r e7d1cb36e005 -r 52029bcc00e1 src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java --- a/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java Mon Jan 14 22:22:15 2013 +0000 +++ b/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java Tue Feb 05 11:08:18 2013 +0000 @@ -1049,6 +1049,8 @@ /** Index of all CP entries of a given tag and class. */ public Index getMemberIndex(byte tag, ClassEntry classRef) { + if (classRef == null) + throw new RuntimeException("missing class reference for " + tagName(tag)); if (indexByTagAndClass == null) indexByTagAndClass = new Index[CONSTANT_Limit][]; Index allClasses = getIndexByTag(CONSTANT_Class); diff -r e7d1cb36e005 -r 52029bcc00e1 src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java --- a/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java Mon Jan 14 22:22:15 2013 +0000 +++ b/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java Tue Feb 05 11:08:18 2013 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, 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 @@ -104,6 +104,10 @@ return (p200 == null)? null: p200._nunp; } + private synchronized long getUnpackerPtr() { + return unpackerPtr; + } + // Callback from the unpacker engine to get more data. private long readInputFn(ByteBuffer pbuf, long minlen) throws IOException { if (in == null) return 0; // nothing is readable diff -r e7d1cb36e005 -r 52029bcc00e1 src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java --- a/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java Mon Jan 14 22:22:15 2013 +0000 +++ b/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java Tue Feb 05 11:08:18 2013 +0000 @@ -83,7 +83,7 @@ * @param out an OutputStream * @exception IOException if an error is encountered. */ - public void pack(JarFile in, OutputStream out) throws IOException { + public synchronized void pack(JarFile in, OutputStream out) throws IOException { assert(Utils.currentInstance.get() == null); TimeZone tz = (props.getBoolean(Utils.PACK_DEFAULT_TIMEZONE)) ? null @@ -118,7 +118,7 @@ * @param out an OutputStream * @exception IOException if an error is encountered. */ - public void pack(JarInputStream in, OutputStream out) throws IOException { + public synchronized void pack(JarInputStream in, OutputStream out) throws IOException { assert(Utils.currentInstance.get() == null); TimeZone tz = (props.getBoolean(Utils.PACK_DEFAULT_TIMEZONE)) ? null : TimeZone.getDefault(); diff -r e7d1cb36e005 -r 52029bcc00e1 src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java --- a/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java Mon Jan 14 22:22:15 2013 +0000 +++ b/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java Tue Feb 05 11:08:18 2013 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, 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 @@ -106,7 +106,7 @@ * @param out a JarOutputStream. * @exception IOException if an error is encountered. */ - public void unpack(InputStream in, JarOutputStream out) throws IOException { + public synchronized void unpack(InputStream in, JarOutputStream out) throws IOException { if (in == null) { throw new NullPointerException("null input"); } @@ -151,7 +151,7 @@ * @param out a JarOutputStream. * @exception IOException if an error is encountered. */ - public void unpack(File in, JarOutputStream out) throws IOException { + public synchronized void unpack(File in, JarOutputStream out) throws IOException { if (in == null) { throw new NullPointerException("null input"); } diff -r e7d1cb36e005 -r 52029bcc00e1 src/share/classes/com/sun/jmx/mbeanserver/Introspector.java --- a/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java Mon Jan 14 22:22:15 2013 +0000 +++ b/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java Tue Feb 05 11:08:18 2013 +0000 @@ -56,6 +56,8 @@ import java.lang.reflect.InvocationTargetException; import javax.management.AttributeNotFoundException; import javax.management.openmbean.CompositeData; +import sun.reflect.misc.MethodUtil; +import sun.reflect.misc.ReflectUtil; /** * This class contains the methods for performing all the tests needed to verify @@ -528,8 +530,10 @@ // to locate method readMethod = SimpleIntrospector.getReadMethod(clazz, element); } - if (readMethod != null) - return readMethod.invoke(complex); + if (readMethod != null) { + ReflectUtil.checkPackageAccess(readMethod.getDeclaringClass()); + return MethodUtil.invoke(readMethod, complex, new Class[0]); + } throw new AttributeNotFoundException( "Could not find the getter method for the property " + diff -r e7d1cb36e005 -r 52029bcc00e1 src/share/classes/java/awt/Dialog.java --- a/src/share/classes/java/awt/Dialog.java Mon Jan 14 22:22:15 2013 +0000 +++ b/src/share/classes/java/awt/Dialog.java Tue Feb 05 11:08:18 2013 +0000 @@ -39,6 +39,7 @@ import sun.awt.util.IdentityArrayList; import sun.awt.util.IdentityLinkedList; import sun.security.util.SecurityConstants; +import java.security.AccessControlException; /** * A Dialog is a top-level window with a title and a border @@ -128,6 +129,8 @@ */ boolean undecorated = false; + private transient boolean initialized = false; + /** * Modal dialogs block all input to some top-level windows. * Whether a particular window is blocked depends on dialog's type @@ -671,6 +674,7 @@ this.title = title; setModalityType(modalityType); SunToolkit.checkAndSetPolicy(this, false); + initialized = true; } /** @@ -722,6 +726,7 @@ this.title = title; setModalityType(modalityType); SunToolkit.checkAndSetPolicy(this, false); + initialized = true; } /** @@ -851,12 +856,9 @@ if (modalityType == type) { return; } - if (type == ModalityType.TOOLKIT_MODAL) { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - sm.checkPermission(SecurityConstants.AWT.TOOLKIT_MODALITY_PERMISSION); - } - } + + checkModalityPermission(type); + modalityType = type; modal = (modalityType != ModalityType.MODELESS); } @@ -1025,6 +1027,9 @@ */ @Deprecated public void show() { + if (!initialized) throw new IllegalStateException( + "The dialog component has not been initialized properly"); + beforeFirstShow = false; if (!isModal()) { conditionalShow(null, null); @@ -1595,18 +1600,50 @@ } } + private void checkModalityPermission(ModalityType mt) { + if (mt == ModalityType.TOOLKIT_MODAL) { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission( + SecurityConstants.AWT.TOOLKIT_MODALITY_PERMISSION + ); + } + } + } + private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException, HeadlessException { GraphicsEnvironment.checkHeadless(); - s.defaultReadObject(); + + java.io.ObjectInputStream.GetField fields = + s.readFields(); + + ModalityType localModalityType = (ModalityType)fields.get("modalityType", null); + + try { + checkModalityPermission(localModalityType); + } catch (AccessControlException ace) { + localModalityType = DEFAULT_MODALITY_TYPE; + } // in 1.5 or earlier modalityType was absent, so use "modal" instead - if (modalityType == null) { + if (localModalityType == null) { + this.modal = fields.get("modal", false); setModal(modal); } + this.resizable = fields.get("resizable", true); + this.undecorated = fields.get("undecorated", false); + this.title = (String)fields.get("title", ""); + this.modalityType = localModalityType; + blockedWindows = new IdentityArrayList(); + + SunToolkit.checkAndSetPolicy(this, false); + + initialized = true; + } /* diff -r e7d1cb36e005 -r 52029bcc00e1 src/share/classes/java/awt/EventQueue.java --- a/src/share/classes/java/awt/EventQueue.java Mon Jan 14 22:22:15 2013 +0000 +++ b/src/share/classes/java/awt/EventQueue.java Tue Feb 05 11:08:18 2013 +0000 @@ -191,7 +191,8 @@ } public void removeSourceEvents(EventQueue eventQueue, Object source, - boolean removeAllEvents) { + boolean removeAllEvents) + { eventQueue.removeSourceEvents(source, removeAllEvents); } public boolean noEvents(EventQueue eventQueue) { @@ -200,6 +201,11 @@ public void wakeup(EventQueue eventQueue, boolean isShutdown) { eventQueue.wakeup(isShutdown); } + public void invokeAndWait(Object source, Runnable r) + throws InterruptedException, InvocationTargetException + { + EventQueue.invokeAndWait(source, r); + } }); } @@ -1227,8 +1233,14 @@ * @since 1.2 */ public static void invokeAndWait(Runnable runnable) - throws InterruptedException, InvocationTargetException { + throws InterruptedException, InvocationTargetException + { + invokeAndWait(Toolkit.getDefaultToolkit(), runnable); + } + static void invokeAndWait(Object source, Runnable runnable) + throws InterruptedException, InvocationTargetException + { if (EventQueue.isDispatchThread()) { throw new Error("Cannot call invokeAndWait from the event dispatcher thread"); } @@ -1237,8 +1249,7 @@ Object lock = new AWTInvocationLock(); InvocationEvent event = - new InvocationEvent(Toolkit.getDefaultToolkit(), runnable, lock, - true); + new InvocationEvent(source, runnable, lock, true); synchronized (lock) { Toolkit.getEventQueue().postEvent(event); diff -r e7d1cb36e005 -r 52029bcc00e1 src/share/classes/java/awt/TextComponent.java --- a/src/share/classes/java/awt/TextComponent.java Mon Jan 14 22:22:15 2013 +0000 +++ b/src/share/classes/java/awt/TextComponent.java Tue Feb 05 11:08:18 2013 +0000 @@ -107,12 +107,6 @@ // the background color of non-editable TextComponents. boolean backgroundSetByClientCode = false; - /** - * True if this TextComponent has access - * to the System clipboard. - */ - transient private boolean canAccessClipboard; - transient protected TextListener textListener; /* @@ -137,7 +131,6 @@ GraphicsEnvironment.checkHeadless(); this.text = (text != null) ? text : ""; setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR)); - checkSystemClipboardAccess(); } private void enableInputMethodsIfNecessary() { @@ -727,17 +720,14 @@ /** * Assigns a valid value to the canAccessClipboard instance variable. */ - private void checkSystemClipboardAccess() { - canAccessClipboard = true; + private boolean canAccessClipboard() { SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - try { - sm.checkSystemClipboardAccess(); - } - catch (SecurityException e) { - canAccessClipboard = false; - } - } + if (sm == null) return true; + try { + sm.checkSystemClipboardAccess(); + return true; + } catch (SecurityException e) {} + return false; } /* @@ -820,7 +810,6 @@ } } enableInputMethodsIfNecessary(); - checkSystemClipboardAccess(); } diff -r e7d1cb36e005 -r 52029bcc00e1 src/share/classes/java/awt/Window.java --- a/src/share/classes/java/awt/Window.java Mon Jan 14 22:22:15 2013 +0000 +++ b/src/share/classes/java/awt/Window.java Tue Feb 05 11:08:18 2013 +0000 @@ -1200,7 +1200,7 @@ } else { try { - EventQueue.invokeAndWait(action); + EventQueue.invokeAndWait(this, action); } catch (InterruptedException e) { System.err.println("Disposal was interrupted:"); diff -r e7d1cb36e005 -r 52029bcc00e1 src/share/classes/java/io/ObjectInputStream.java --- a/src/share/classes/java/io/ObjectInputStream.java Mon Jan 14 22:22:15 2013 +0000 +++ b/src/share/classes/java/io/ObjectInputStream.java Tue Feb 05 11:08:18 2013 +0000 @@ -1750,6 +1750,12 @@ ObjectStreamClass desc = readClassDesc(false); desc.checkDeserialize(); + Class cl = desc.forClass(); + if (cl == String.class || cl == Class.class + || cl == ObjectStreamClass.class) { + throw new InvalidClassException("invalid class descriptor"); + } + Object obj; From jvanek at redhat.com Tue Feb 5 04:13:33 2013 From: jvanek at redhat.com (Jiri Vanek) Date: Tue, 05 Feb 2013 13:13:33 +0100 Subject: Request for review on German localizations for icedtea-web In-Reply-To: <201302042027.r14KRQVE005459@mail-web02.excite.co.jp> References: <201302042027.r14KRQVE005459@mail-web02.excite.co.jp> Message-ID: <5110F76D.8020407@redhat.com> Hi! Thank you very much for translation! I have walked across it and found several issues: - SPLASHchainWas was added in meanwhile, if you may, you can include it to your next version of translated files. - All four files are identical, java fall back is working fine, so I'm for add just Messages_de.properties and Messages_de_XX.properties where XX is the one you are most capable with (and pure _de. will be based on this _de_XX. for now). By this we will have covered all German locales "somehow" ( I' not familiar with differences) and one, de_XX will be covered as native as possible. - You have wrapped to 80 characters, this is not an rule for properties file. If it will be to much work for you to unwrap then I do not insists - Otherwise I would like to keep all properties unwrapped. - I'm for removing the commented original lines. IMHO they are making the file much more unmaintainable and most of the localisation software can show original lines anyway. - I have cc Alexandr, I remember he is speaking German a bit, so maybe he will be wiling to check your translation from professional and language point. (Please keep im cc, O'm not sure if he is following our mail-list) - I have not read whole file, please can you pick up all the questions/comments here by email? Otherwise the localisation is working more then fine and I'm really glad for it! I have also enhanced our testsuite - see separate email with patch if you want to check it. -------- Original Message -------- Subject: Request for review on German localizations for icedtea-web Date: Tue, 5 Feb 2013 05:27:26 +0900 From: Jacob Wisor To: distro-pkg-dev at openjdk.java.net >Hi! > >Please review the attached files. I have left the original English messages as comments for >comparison and added my comments and/or questions where I was unsure. > >Regards, >Jacob -------------- next part -------------- A non-text attachment was scrubbed... Name: Messages_de_DE.properties Type: application/octet-stream Size: 58663 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130205/deb437f5/Messages_de_DE.properties From jvanek at redhat.com Tue Feb 5 04:16:50 2013 From: jvanek at redhat.com (Jiri Vanek) Date: Tue, 05 Feb 2013 13:16:50 +0100 Subject: [fyi] [icedtea-web] enhanced locales tests for upcoming DE translation Message-ID: <5110F832.50807@redhat.com> Hi! I have enhanced our testsuite for localisation. The changes are little bit greater because I have to handle tests for "any German" and for "specific German" This should be pushed together with locales from Jacob. J. -------------- next part -------------- diff -r fd01cd1c2bbc tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java --- a/tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java Tue Feb 05 09:51:44 2013 +0100 +++ b/tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java Tue Feb 05 12:49:32 2013 +0100 @@ -36,6 +36,7 @@ package net.sourceforge.jnlp.resources; import java.util.ArrayList; +import java.util.Arrays; import java.util.Enumeration; import java.util.List; import java.util.Locale; @@ -49,61 +50,128 @@ public class MessagesPropertiesTest { - public static final String mainFile = "Messages"; - public static final String[] secondaryCountries = new String[]{"cs"}; - public static final String[] secondaryLanguages = new String[]{"CZ"}; - public static ResourceBundle main; - public static ResourceBundle[] secondary = new ResourceBundle[secondaryCountries.length]; + private final static class LocalesIdentifier { + + public static final LocalesIdentifier DEFAULT = new LocalesIdentifier("",""); + public static final LocalesIdentifier CZ_CS = new LocalesIdentifier("CZ","cs"); + public static final LocalesIdentifier DE = new LocalesIdentifier("de"); + public static final LocalesIdentifier DE_DE = new LocalesIdentifier("DE","de"); + + public static final String mainFileName = "Messages"; + public static final String pckg = "net.sourceforge.jnlp.resources"; + private final String country; + private final String language; + private final Locale locale; + private final ResourceBundle bundle; + + public LocalesIdentifier(String country, String language) { + this.country = country; + this.language = language; + if (getCountry().equals("") && getLanguage().equals("")){ + locale = new Locale("fdbgvfdbg", "ftgjhuj"); + } else { + //get default by non existing language and country + locale = new Locale(language, country); + } + bundle = ResourceBundle.getBundle(pckg+"." + mainFileName, locale); + } + + public LocalesIdentifier(String language) { + this.country = null; + this.language = language; + locale = new Locale(language); + bundle = ResourceBundle.getBundle(pckg+"." + mainFileName, locale); + } + + public String getCountry() { + if (country == null) { + return ""; + } + return country.trim(); + } + + public String getLanguage() { + if (language == null) { + return ""; + } + return language.trim(); + } + + public ResourceBundle getBundle() { + return bundle; + } + + public Locale getLocale() { + return locale; + } + + + + public String getId() { + if (getLanguage().equals("")) { + return getCountry(); + } + if (getCountry().equals("")) { + return getLanguage(); + } + return getLanguage() + "_" + getCountry(); + } + + public String getIdentifier() { + if (getId().equals("")) { + return "default"; + } + return getId(); + } + + + + + } + + public static LocalesIdentifier main; + public static LocalesIdentifier[] secondary; @BeforeClass public static void loadResourceBoundels() { - assertTrue("length of countries and languages must be same", secondaryCountries.length == secondaryLanguages.length); //get default by non existing language and country - main = ResourceBundle.getBundle("net.sourceforge.jnlp.resources." + mainFile, new Locale("dfgdfg", "gvff")); - secondary = new ResourceBundle[secondaryCountries.length]; + main = LocalesIdentifier.DEFAULT; assertNotNull(main); - for (int i = 0; i < secondaryCountries.length; i++) { - String country = secondaryCountries[i]; - String language = secondaryLanguages[i]; - secondary[i] = ResourceBundle.getBundle("net.sourceforge.jnlp.resources." + mainFile, new Locale(country, language)); + secondary= new LocalesIdentifier[] {LocalesIdentifier.CZ_CS,LocalesIdentifier.DE,LocalesIdentifier.DE_DE}; + assertNotNull(secondary); + for (int i = 0; i < secondary.length; i++) { assertNotNull(secondary[i]); + } } @Test public void allResourcesAreReallyDifferent() { - List ids = new ArrayList(secondary.length + 1); - ids.add("default"); - List bundles = new ArrayList(secondary.length + 1); + List bundles = new ArrayList(secondary.length + 1); bundles.add(main); int errors = 0; - for (int i = 0; i < secondaryCountries.length; i++) { - String country = secondaryCountries[i]; - String language = secondaryLanguages[i]; - ids.add(country + "_" + language); - bundles.add(secondary[i]); - - } + bundles.addAll(Arrays.asList(secondary)); for (int i = 0; i < bundles.size(); i++) { - ResourceBundle resourceBundle1 = bundles.get(i); - String id1 = ids.get(i); - Enumeration keys1 = resourceBundle1.getKeys(); + LocalesIdentifier resourceBundle1 = bundles.get(i); + Enumeration keys1 = resourceBundle1.getBundle().getKeys(); for (int j = 0; j < bundles.size(); j++) { - if (i == j) { + LocalesIdentifier resourceBundle2 = bundles.get(j); + if (resourceBundle1.getLanguage().equals(resourceBundle2.getLanguage())) { + //do not compare same language groups + allLog("Skipping same language " + resourceBundle1.getLocale() + " x " + resourceBundle2.getLocale() + " (should be " + resourceBundle1.getIdentifier() + " x " + resourceBundle2.getIdentifier() + ")"); break; } - ResourceBundle resourceBundle2 = bundles.get(j); - String id2 = ids.get(j); - outLog("Checking for same items between " + resourceBundle1.getLocale() + " x " + resourceBundle2.getLocale() + " (should be " + id1 + " x " + id2 + ")"); - errLog("Checking for same items between " + resourceBundle1.getLocale() + " x " + resourceBundle2.getLocale() + " (should be " + id1 + " x " + id2 + ")"); + allLog("Checking for same items between " + resourceBundle1.getLocale() + " x " + resourceBundle2.getLocale() + " (should be " + resourceBundle1.getIdentifier() + " x " + resourceBundle2.getIdentifier() + ")"); int localErrors=0; while (keys1.hasMoreElements()) { String key = (String) keys1.nextElement(); - String val1 = getMissingResourceAsEmpty(resourceBundle1, key); - String val2 = getMissingResourceAsEmpty(resourceBundle2, key); + String val1 = getMissingResourceAsEmpty(resourceBundle1.getBundle(), key); + String val2 = getMissingResourceAsEmpty(resourceBundle2.getBundle(), key); outLog("\""+val1+"\" x \""+val2); if (val1.trim().equalsIgnoreCase(val2.trim())) { - if (val1.trim().length() <= 5 /*"ok", "", ...*/ || val1.toLowerCase().contains("://") /*urls...*/) { + if (val1.trim().length() <= 5 /* short words like"ok", "", ...*/ + || val1.toLowerCase().contains("://") /*urls...*/ + || !val1.trim().contains(" ") /*one word*/) { errLog("Warning! Items equals for: " + key + " = " + val1 + " but are in allowed subset"); } else { errors++; @@ -112,7 +180,7 @@ } } } - errLog(localErrors+" errors allResourcesAreReallyDifferent fo "+id2+" x "+id1); + errLog(localErrors+" errors allResourcesAreReallyDifferent fo "+resourceBundle1.getIdentifier()+" x "+resourceBundle2.getIdentifier()); } } @@ -129,20 +197,18 @@ @Test //it is not critical that some localisations are missing, however good to know + //and actually this test sis covered by allResourcesAreReallyDifferent, because fallback is geting default value for unknnow localisation public void warnForNotLocalisedStrings() { int errors = 0; - Enumeration keys = main.getKeys(); + Enumeration keys = main.getBundle().getKeys(); for (int i = 0; i < secondary.length; i++) { int localErrors = 0; - ResourceBundle sec = secondary[i]; - String country = secondaryCountries[i]; - String language = secondaryLanguages[i]; - String id = country + "_" + language; - outLog("Checking for missing strings in " + sec.getLocale() + " (should be " + id + ") compared with default"); - errLog("Checking for missing strings in " + sec.getLocale() + " (should be " + id + ") compared with default"); + ResourceBundle sec = secondary[i].getBundle(); + String id = secondary[i].getIdentifier(); + allLog("Checking for missing strings in " + sec.getLocale() + " (should be " + id + ") compared with default"); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); - String val1 = getMissingResourceAsEmpty(main, key); + String val1 = getMissingResourceAsEmpty(main.getBundle(), key); String val2 = getMissingResourceAsEmpty(sec, key); outLog("\""+val1+"\" x \""+val2); if (val1.trim().isEmpty()) { @@ -165,24 +231,15 @@ @Test public void noEmptyResources() { - List ids = new ArrayList(secondary.length + 1); - ids.add("default"); - List bundles = new ArrayList(secondary.length + 1); + List bundles = new ArrayList(secondary.length + 1); bundles.add(main); int errors = 0; - for (int i = 0; i < secondaryCountries.length; i++) { - String country = secondaryCountries[i]; - String language = secondaryLanguages[i]; - ids.add(country + "_" + language); - bundles.add(secondary[i]); - - } + bundles.addAll(Arrays.asList(secondary)); for (int i = 0; i < bundles.size(); i++) { - ResourceBundle resourceBundle = bundles.get(i); - String id = ids.get(i); + ResourceBundle resourceBundle = bundles.get(i).getBundle(); + String id = bundles.get(i).getIdentifier(); Enumeration keys = resourceBundle.getKeys(); - outLog("Checking for empty items in " + resourceBundle.getLocale() + " (should be " + id + ")"); - errLog("Checking for empty items in " + resourceBundle.getLocale() + " (should be " + id + ")"); + allLog("Checking for empty items in " + resourceBundle.getLocale() + " (should be " + id + ")"); int localErrors=0; while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); @@ -207,16 +264,14 @@ int errors = 0; for (int i = 0; i < secondary.length; i++) { int localErrors = 0; - ResourceBundle sec = secondary[i]; + ResourceBundle sec = secondary[i].getBundle(); Enumeration keys = sec.getKeys(); - String country = secondaryCountries[i]; - String language = secondaryLanguages[i]; - String id = country + "_" + language; + String id = secondary[i].getId(); outLog("Checking for redundant keys in " + sec.getLocale() + " (should be " + id + ") compared with default"); errLog("Checking for redundant keys in " + sec.getLocale() + " (should be " + id + ") compared with default"); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); - String val2 = getMissingResourceAsEmpty(main, key); + String val2 = getMissingResourceAsEmpty(main.getBundle(), key); String val1 = getMissingResourceAsEmpty(sec, key); outLog("\""+val1+"\" x \""+val2); if (val2.trim().isEmpty() && !val1.trim().isEmpty()){ @@ -234,7 +289,13 @@ + private void allLog(String string) { + outLog(string); + errLog(string); + } private void errLog(String string) { + //used quite often :) + //System.out.println(string); ServerAccess.logErrorReprint(string); } diff -r fd01cd1c2bbc tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java --- a/tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java Tue Feb 05 09:51:44 2013 +0100 +++ b/tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java Tue Feb 05 12:49:32 2013 +0100 @@ -110,6 +110,13 @@ return l; } + private ResourceBundle getPropertiesDe() throws IOException { + return getProperties("_de"); + } + + private ResourceBundle getPropertiesDeDe() throws IOException { + return getProperties("_de_DE"); + } public ResourceBundle getPropertiesCz() throws IOException { return getProperties("_cs_CZ"); @@ -132,7 +139,9 @@ String[] l = getChangeLocalesForSubproces("en_US.UTF-8"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertEnglish(pr.stdout); - assertNotCzh(pr.stdout); + assertNotCz(pr.stdout); + assertNotDeDe(pr.stdout); + assertNotDe(pr.stdout); } @Test @@ -140,8 +149,10 @@ String[] l = getChangeLocalesForSubproces("cs_CZ"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); - assertNotCzh(pr.stdout); - iteratePropertiesForAproxCz(pr.stdout); + assertNotCz(pr.stdout); + assertNotDeDe(pr.stdout); + assertNotDe(pr.stdout); + iteratePropertiesForAproxCzCs(pr.stdout); } @Test @@ -149,16 +160,73 @@ String[] l = getChangeLocalesForSubproces("cs_CZ.UTF-8"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); + assertNotDeDe(pr.stdout); + assertNotDe(pr.stdout); assertCz(pr.stdout); - iteratePropertiesForAproxCz(pr.stdout); + iteratePropertiesForAproxCzCs(pr.stdout); + } + + @Test + public void testLocalesDeDe() throws Exception { + String[] l = getChangeLocalesForSubproces("de_DE"); + ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); + assertNotEnglish(pr.stdout); + assertNotCz(pr.stdout); + iteratePropertiesForAproxDeDe(pr.stdout); } @Test + public void testLocalesDeDeUtf() throws Exception { + String[] l = getChangeLocalesForSubproces("de_DE.UTF-8"); + ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); + assertNotEnglish(pr.stdout); + assertNotCz(pr.stdout); + assertDeDe(pr.stdout); + iteratePropertiesForAproxDeDe(pr.stdout); + } + + + @Test + public void testLocalesDe_unknowButValidDeLocale() throws Exception { + String[] l = getChangeLocalesForSubproces("de_LU"); + ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); + assertNotEnglish(pr.stdout); + assertNotCz(pr.stdout); + iteratePropertiesForAproxDe(pr.stdout); + } + + @Test + public void testLocalesDeUtf_unknowButValidDeLocale() throws Exception { + String[] l = getChangeLocalesForSubproces("de_LU.UTF-8"); + ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); + assertNotEnglish(pr.stdout); + assertNotCz(pr.stdout); + assertDe(pr.stdout); + iteratePropertiesForAproxDe(pr.stdout); + } + + + + @Test + public void testLocalesDe_globalDe() throws Exception { + String[] l = getChangeLocalesForSubproces("deutsch"); + ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); + assertNotEnglish(pr.stdout); + assertNotCz(pr.stdout); + iteratePropertiesForAproxDe(pr.stdout); + } + + + + + @Test public void testLocalesInvalid() throws Exception { String[] l = getChangeLocalesForSubproces("ax_BU"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertEnglish(pr.stdout); - assertNotCzh(pr.stdout); + assertNotCz(pr.stdout); + assertNotDeDe(pr.stdout); + assertNotDe(pr.stdout); } private void assertEnglish(String s) throws IOException { @@ -175,11 +243,29 @@ ResourceBundle props = getPropertiesCz(); iteratePropertiesFor(props, s, true, "czech"); } + + private void assertDe(String s) throws IOException { + ResourceBundle props = getPropertiesDe(); + iteratePropertiesFor(props, s, true, "de"); + } + private void assertDeDe(String s) throws IOException { + ResourceBundle props = getPropertiesDeDe(); + iteratePropertiesFor(props, s, true, "de_de"); + } - private void assertNotCzh(String s) throws IOException { + private void assertNotCz(String s) throws IOException { ResourceBundle props = getPropertiesCz(); iteratePropertiesFor(props, s, false, "czech"); } + + private void assertNotDe(String s) throws IOException { + ResourceBundle props = getPropertiesDe(); + iteratePropertiesFor(props, s, false, "de"); + } + private void assertNotDeDe(String s) throws IOException { + ResourceBundle props = getPropertiesDeDe(); + iteratePropertiesFor(props, s, false, "de_de"); + } /** * This method is iterating all keys defined in this class, geting their value in given @@ -216,10 +302,11 @@ * given output match/matchnot (depends on value of assertTrue) this string, * * @param outputToBeChecked + * @param props bundle with strings + * @param reg regexter with rules how to handle national characters * @throws IOException */ - private void iteratePropertiesForAproxCz(String outputToBeChecked) throws IOException { - ResourceBundle props = getPropertiesCz(); + private void iteratePropertiesForAprox(String outputToBeChecked, ResourceBundle props, Regexer reg) throws IOException { int keysFound = 0; for (int i = 0; i < keys.length; i++) { String string = keys[i]; @@ -227,55 +314,95 @@ if (value == null) { continue; } - value = regexIt(value); + value = reg.regexIt(value); keysFound++; { - Assert.assertTrue("Output must match cz text, failed on " + string, outputToBeChecked.matches(value)); + Assert.assertTrue("Output must match "+reg.getId() +" text, failed on " + string, outputToBeChecked.matches(value)); } } Assert.assertTrue("At least one key must be found, was not", keysFound > 0); } - String[] czEvil = { - "?", - "?", - "?", - "?", - "?", - "?", - "?", - "?", - "?", - "?", - "?", - "?", - "?", - "?", - "?", - "[", - "]", - "(", - ")"}; - /** - * This method transforms given string to asci-only regex, replacing groups of - * czech characters (defined by czEvil variable) by .+ - * - * @param value - * @return - */ - private String regexIt(String value) { - return regexIt(value, czEvil); + private void iteratePropertiesForAproxCzCs(String stdout) throws IOException { + iteratePropertiesForAprox(stdout, getPropertiesCz(), Regexer.cz); + } + private void iteratePropertiesForAproxDe(String stdout) throws IOException { + iteratePropertiesForAprox(stdout, getPropertiesDe(), Regexer.de); + } + + private void iteratePropertiesForAproxDeDe(String stdout) throws IOException { + iteratePropertiesForAprox(stdout, getPropertiesDeDe(), Regexer.de); } - private static String regexIt(String value, String[] map) { - for (int i = 0; i < map.length; i++) { - String string = map[i]; - value = value.replace(string, "."); - value = value.replace(string.toUpperCase(), "."); + + + private static final class Regexer { + + private static final String[] czEvil = { + "?", + "?", + "?", + "?", + "?", + "?", + "?", + "?", + "?", + "?", + "?", + "?", + "?", + "?", + "?", + "[", + "]", + "(", + ")"}; + private static final String[] deEvil = { + "?", + "?", + "?", + "?", + "[", + "]", + "(", + ")"}; + + private static final Regexer cz = new Regexer(czEvil,"cz"); + private static final Regexer de = new Regexer(deEvil,"de"); + + private final String[] map; + private final String id; + + public Regexer(String[] map, String id) { + this.map = map; + this.id = id; } - value = value.replaceAll("\\.+", ".+"); - value = "(?s).*" + value + ".*"; - return value; + public String getId() { + return id; + } + + + + + /** + * This method transforms given string to asci-only regex, replacing + * groups of national characters (defined by array variable) by .+ + * + * @param value + * @return + */ + public String regexIt(String value) { + for (int i = 0; i < map.length; i++) { + String string = map[i]; + value = value.replace(string, "."); + value = value.replace(string.toUpperCase(), "."); + } + + value = value.replaceAll("\\.+", ".+"); + value = "(?s).*" + value + ".*"; + return value; + } } } From adomurad at redhat.com Tue Feb 5 07:08:24 2013 From: adomurad at redhat.com (Adam Domurad) Date: Tue, 05 Feb 2013 10:08:24 -0500 Subject: [fyi][icedtea-web] backend and itw-settings for extended applets security In-Reply-To: <510E532C.8040401@redhat.com> References: <510E532C.8040401@redhat.com> Message-ID: <51112068.10608@redhat.com> On 02/03/2013 07:08 AM, Jiri Vanek wrote: > Whole troubles are described here http://icedtea.classpath.org/wiki/Extended_Applets_Security rather then in plain email. > > There is what me and adam have already achieved on this topic, what we have o achieve and where we are stil not so sure.... > > This patch is containing itw-settings part and backend for manipulating stored entries.and basic matching. > I noted this just [fyi] because adam ave already walked through the patch, and so have I across his part. So the patch should be ready for push unless someone find something malicious on implementation or even on design. > > J. Typos only / misspellings only. > diff -r e631770d76ba netx/net/sourceforge/appletextendedsecurity/AppletExtendedSecurity.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/appletextendedsecurity/AppletExtendedSecurity.java Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,84 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ > + > +package net.sourceforge.appletextendedsecurity; > + > +import javax.naming.ConfigurationException; > +import net.sourceforge.appletextendedsecurity.impl.UnsignedAppletActionStorageImpl; > +import net.sourceforge.jnlp.config.DeploymentConfiguration; > +import net.sourceforge.jnlp.runtime.JNLPRuntime; > + > + > +public class AppletExtendedSecurity { > + > + private static UnsignedAppletActionStorageImpl globalInstance; > + private static UnsignedAppletActionStorageImpl customInstance; > + > + /** > + * > + * @return storage with global items from /etc/ > + */ > + > + public static UnsignedAppletActionStorage getUnsignedAppletActionGlobalStorage(){ > + if (globalInstance == null){ > + globalInstance = new UnsignedAppletActionStorageImpl(DeploymentConfiguration.getAppletTrustGlobalSettingsPath()); > + } > + return globalInstance; > + } > + > + > + /** > + * > + * @return storage with custom items from /home/ > + */ > + public static UnsignedAppletActionStorage getUnsignedAppletActionCustomStorage(){ > + if (customInstance == null){ > + customInstance = new UnsignedAppletActionStorageImpl(DeploymentConfiguration.getAppletTrustCustomSettingsPath()); > + } > + return customInstance; > + } > + > + public static AppletSecurityLevel getDefaultSecurityLevel(){ > + return AppletSecurityLevel.getDefault(); > + } > + > + /** > + * > + * @return user-set seurity level or default one if user-set do not exists s/seurity/security/ > + */ > + public static AppletSecurityLevel getCustomSecurityLevel(){ > + DeploymentConfiguration conf = JNLPRuntime.getConfiguration(); > + if (conf==null){ > + conf = new DeploymentConfiguration(); > + try { > + conf.load(); > + } catch (ConfigurationException ex){ > + ex.printStackTrace(); > + return getDefaultSecurityLevel(); > + } > + } > + String s = conf.getProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL); > + if (s==null) { > + return getDefaultSecurityLevel(); > + } > + return AppletSecurityLevel.fromString(s); > + } > + > + > + > +} > diff -r e631770d76ba netx/net/sourceforge/appletextendedsecurity/AppletSecurityLevel.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/appletextendedsecurity/AppletSecurityLevel.java Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,83 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ > + > +package net.sourceforge.appletextendedsecurity; > + > +import net.sourceforge.jnlp.runtime.Translator; > + > +public enum AppletSecurityLevel { > + > + DENY_ALL, DENY_UNSIGNED, ASK_UNSIGNED, ALLOW_UNSIGNED; > + > + public static String allToString() { > + return DENY_ALL.toChars()+" "+DENY_UNSIGNED.toChars()+" "+ASK_UNSIGNED.toChars()+" "+ALLOW_UNSIGNED.toChars(); > + } > + > + > + > + public String toChars() { > + switch (this) { > + case DENY_ALL: > + return " DENY_ALL"; > + case DENY_UNSIGNED: > + return "DENY_UNSIGNED"; > + case ASK_UNSIGNED: > + return "ASK_UNSIGNED"; > + case ALLOW_UNSIGNED: > + return "ALLOW_UNSIGNED"; > + } > + throw new RuntimeException("Unknown AppletSecurityLevel"); > + } > + > + public String toExplanation() { > + switch (this) { > + case DENY_ALL: > + return Translator.R("APPEXTSECappletSecurityLevelExtraHighId")+" - "+Translator.R("APPEXTSECappletSecurityLevelExtraHighExplanation"); > + case DENY_UNSIGNED: > + return Translator.R("APPEXTSECappletSecurityLevelVeryHighId")+" - "+Translator.R("APPEXTSECappletSecurityLevelVeryHighExplanation"); > + case ASK_UNSIGNED: > + return Translator.R("APPEXTSECappletSecurityLevelHighId")+" - "+Translator.R("APPEXTSECappletSecurityLevelHighExplanation"); > + case ALLOW_UNSIGNED: > + return Translator.R("APPEXTSECappletSecurityLevelLowId")+" - "+Translator.R("APPEXTSECappletSecurityLevelLowExplanation"); > + } > + throw new RuntimeException("Unknown AppletSecurityLevel"); > + } > + > + public static AppletSecurityLevel fromString(String s) { > + if (s.trim().equalsIgnoreCase("DENY_ALL")) { > + return AppletSecurityLevel.DENY_ALL; > + } else if (s.trim().equalsIgnoreCase("DENY_UNSIGNED")) { > + return AppletSecurityLevel.DENY_UNSIGNED; > + } else if (s.trim().equalsIgnoreCase("ASK_UNSIGNED")) { > + return AppletSecurityLevel.ASK_UNSIGNED; > + } else if (s.trim().equalsIgnoreCase("ALLOW_UNSIGNED")) { > + return AppletSecurityLevel.ALLOW_UNSIGNED; > + } else { > + throw new RuntimeException("Unknown AppletSecurityLevel for " + s); > + } > + } > + > + @Override > + public String toString() { > + return toExplanation(); > + } > + > + public static AppletSecurityLevel getDefault(){ > + return ASK_UNSIGNED; > + } > +} > diff -r e631770d76ba netx/net/sourceforge/appletextendedsecurity/UnsignedAppletAction.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/appletextendedsecurity/UnsignedAppletAction.java Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,73 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ > + > +package net.sourceforge.appletextendedsecurity; > + > +import net.sourceforge.jnlp.runtime.Translator; > + > +public enum UnsignedAppletAction { > + > + ALWAYS, NEVER, YES, NO; > + > + public String toChar() { > + switch (this) { > + case ALWAYS: > + return "A"; > + case NEVER: > + return "N"; > + case YES: > + return "y"; > + case NO: > + return "n"; > + } > + throw new RuntimeException("Unknown UnsignedAppletAction"); > + } > + > + public String toExplanation() { > + switch (this) { > + case ALWAYS: > + return Translator.R("APPEXTSECunsignedAppletActionAlways"); > + case NEVER: > + return Translator.R("APPEXTSECunsignedAppletActionNever"); > + case YES: > + return Translator.R("APPEXTSECunsignedAppletActionYes"); > + case NO: > + return Translator.R("APPEXTSECunsignedAppletActionNo"); > + } > + throw new RuntimeException("Unknown UnsignedAppletAction"); > + } > + > + public static UnsignedAppletAction fromString(String s) { > + if (s.startsWith("A")) { > + return UnsignedAppletAction.ALWAYS; > + } else if (s.startsWith("N")) { > + return UnsignedAppletAction.NEVER; > + } else if (s.startsWith("y")) { > + return UnsignedAppletAction.YES; > + } else if (s.startsWith("n")) { > + return UnsignedAppletAction.NO; > + } else { > + throw new RuntimeException("Unknown UnsignedAppletAction for " + s); > + } > + } > + > + @Override > + public String toString() { > + return toChar() + " - " + toExplanation(); > + } > +} > diff -r e631770d76ba netx/net/sourceforge/appletextendedsecurity/UnsignedAppletActionEntry.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/appletextendedsecurity/UnsignedAppletActionEntry.java Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,169 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ > +package net.sourceforge.appletextendedsecurity; > + > +import java.io.IOException; > +import java.io.Writer; > +import java.util.ArrayList; > +import java.util.Date; > +import java.util.List; > + > +public class UnsignedAppletActionEntry { > + > + > + > + private UnsignedAppletAction unsignedAppletAction; > + private Date timeStamp; > + private UrlRegEx documentBase; > + private UrlRegEx codeBase; > + private String mainClass; > + private List archives; > + > + > + public static UnsignedAppletActionEntry createFromString(String s) { > + String[] split = s.split("\\s+"); > + UnsignedAppletActionEntry nw = new UnsignedAppletActionEntry( > + UnsignedAppletAction.fromString(split[0]), > + new Date(new Long(split[1])), > + new UrlRegEx(split[2]), > + null, > + null, > + null > + ); > + if (split.length>3){ > + nw.setCodeBase(new UrlRegEx(split[3])); > + } > + if (split.length>4){ > + nw.setMainClass(split[4]); > + } > + if (split.length>5){ > + nw.setArchives(createArchivesList(s.substring(s.indexOf(split[4])+split[4].length()).trim())); > + } > + return nw; > + } > + > + public UnsignedAppletActionEntry(UnsignedAppletAction unsignedAppletAction, Date timeStamp, UrlRegEx documentBase, UrlRegEx codeBase, String mainClass, List archives) { > + this.unsignedAppletAction = unsignedAppletAction; > + this.timeStamp = timeStamp; > + this.documentBase = documentBase; > + this.codeBase = codeBase; > + this.mainClass = mainClass; > + this.archives = archives; > + > + } > + > + > + > + @Override > + public String toString() { > + return unsignedAppletAction.toChar() + > + " " + ((timeStamp == null)?"1":timeStamp.getTime()) + > + " " + ((documentBase == null)?"":documentBase.getRegEx()) + > + " " + ((codeBase == null)?"":codeBase.getRegEx()) + > + " " + ((mainClass == null)?"":mainClass) + > + " " + createArchivesString(archives); > + > + } > + > + public void write(Writer bw) throws IOException { > + bw.write(this.toString()); > + } > + > + public Date getTimeStamp() { > + return timeStamp; > + } > + > + public UrlRegEx getDocumentBase() { > + return documentBase; > + } > + > + public void setTimeStamp(Date timeStamp) { > + this.timeStamp = timeStamp; > + } > + > + public void setDocumentBase(UrlRegEx documentBase) { > + this.documentBase = documentBase; > + } > + > + public UnsignedAppletAction getUnsignedAppletAction() { > + return unsignedAppletAction; > + } > + > + public void setUnsignedAppletAction(UnsignedAppletAction unsignedAppletAction) { > + this.unsignedAppletAction = unsignedAppletAction; > + } > + > + public UrlRegEx getCodeBase() { > + return codeBase; > + } > + > + public void setCodeBase(UrlRegEx codeBase) { > + this.codeBase = codeBase; > + } > + > + public String getMainClass() { > + return mainClass; > + } > + > + public void setMainClass(String mainClass) { > + this.mainClass = mainClass; > + } > + > + public List getArchives() { > + return archives; > + } > + > + public void setArchives(List archives) { > + this.archives = archives; > + } > + > + public static String createArchivesString(List listOfArchives) { > + if (listOfArchives == null){ > + return ""; > + } > + StringBuilder sb = new StringBuilder(); > + for (int i = 0; i < listOfArchives.size(); i++) { > + String string = listOfArchives.get(i); > + if (string.trim().isEmpty()){ > + continue; > + } > + sb.append(string).append(";"); > + } > + return sb.toString(); > + } > + public static List createArchivesList(String semicolonedArchives) { > + if (semicolonedArchives == null) return null; > + if (semicolonedArchives.trim().isEmpty()) return null; > + String[] items = semicolonedArchives.trim().split(";"); > + List r = new ArrayList(items.length); > + for (int i = 0; i < items.length; i++) { > + String string = items[i]; > + if (string.trim().isEmpty()){ > + continue; > + } > + r.add(string); > + > + } > + return r; > + > + } > + > + > + > + > +} > diff -r e631770d76ba netx/net/sourceforge/appletextendedsecurity/UnsignedAppletActionStorage.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/appletextendedsecurity/UnsignedAppletActionStorage.java Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,106 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*//* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ > +package net.sourceforge.appletextendedsecurity; > + > +import java.util.List; > + > +/** > + * > + * @author jvanek > + */ > +public interface UnsignedAppletActionStorage { > + > + > + /** > + * This methods iterates through record in DeploymentConfiguration.getAppletTrustSettingsPath(), s/record/records/ > + * and is mathing regexes saved here against params. so parameters here are NOR tegexes, s/mathing/matching/ s/NOR/NOT/ s/tegexes/regexes/ > + * but are matched against saved regexes > + * > + * Null or empty values are dangerously ignored, user, be aware of it. > + * eg: > + * match only codeBase will be null someCodeBase null null > + * match only documentBase will be someDocBase null null null > + * match only applet not regarding code or document base will be null null mainClas archives s/mainClas/mainClass/ > + * @param documentBase > + * @param codeBase > + * @param mainClass > + * @param archives > + * @return > + */ > + public UnsignedAppletActionEntry getMatchingItem(String documentBase, String codeBase, String mainClass, List archives); > + /** > + * Shortcut getMatchingItem(documentBase, null,null,null) > + * @param documentBase > + * @return > + */ > + public UnsignedAppletActionEntry getMatchingItemByDocumentBase(String documentBase); > + /** > + * Shortcut getMatchingItem(null, codeBase,null,null) > + * @param codeBase > + * @return > + */ > + public UnsignedAppletActionEntry getMatchingItemByCodeBase(String codeBase); > + /** > + * Shortcut getMatchingItem(documentBase, codeBase,null,null) > + * @param documentBase > + * @param codeBase > + * @return > + */ > + public UnsignedAppletActionEntry getMatchingItemByBases(String documentBase, String codeBase); > + > + /** > + * Will add new record. Note that regexes are stored for bases matching. > + * > + * eg UnsignedAppletActionEntry which will dany some applet no metter of page will be s/dany/deny/ s/metter/matter/ > + * new UnsignedAppletActionEntry(UnsignedAppletAction.NEVER, new Date(), null, null, someMain, someArchives) > + * > + * eg UnsignedAppletActionEntry which will allow all applets on page with same codebase will be > + * new UnsignedAppletActionEntry(UnsignedAppletAction.NEVER, new Date(), ".*", ".*", null, null); > + * > + * @param item > + */ > + public void add(final UnsignedAppletActionEntry item); > + > + /** > + * Will replace (current impl is matching by object's hashcode > + * This is not reloading the list(but still saving after), so StorageIoEception > + * can be thrown if it was not loaded before. > + * > + * Imho this should be used only to actualise timestamps or change UnsignedAppletAction > + * @param item > + */ > + public void update(final UnsignedAppletActionEntry item); > + > + > +} > diff -r e631770d76ba netx/net/sourceforge/appletextendedsecurity/UrlRegEx.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/appletextendedsecurity/UrlRegEx.java Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,47 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ > + > +package net.sourceforge.appletextendedsecurity; > + > +public class UrlRegEx { > + > + String regEx; > + //cache pattern during each set and init? > + //Pattern p > + > + public UrlRegEx(String s) { > + regEx = s; > + } > + > + @Override > + public String toString() { > + return getRegEx(); > + } > + > + public String getRegEx() { > + return regEx; > + } > + > + public String getFilteredRegEx() { > + return regEx.replaceAll("\\\\Q", "").replaceAll("\\\\E", ""); > + } > + > + public void setRegEx(String regEx) { > + this.regEx = regEx; > + } > +} > diff -r e631770d76ba netx/net/sourceforge/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,220 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ > + > +package net.sourceforge.appletextendedsecurity.impl; > + > +import java.io.BufferedWriter; > +import java.io.File; > +import java.io.IOException; > +import java.util.ArrayList; > +import java.util.Collections; > +import java.util.List; > +import net.sourceforge.appletextendedsecurity.UnsignedAppletActionEntry; > +import net.sourceforge.appletextendedsecurity.UnsignedAppletActionStorage; > +import net.sourceforge.jnlp.util.lockingfile.LockingReaderWriter; > +import net.sourceforge.jnlp.util.lockingfile.StorageIoException; > + > +public class UnsignedAppletActionStorageImpl extends LockingReaderWriter implements UnsignedAppletActionStorage{ > + > + protected List items; > + > + public UnsignedAppletActionStorageImpl(String location) { > + this(new File(location)); > + } > + > + public UnsignedAppletActionStorageImpl(File location) { > + super(location); > + } > + > + @Override > + public void writeContents() throws IOException { > + super.writeContents(); > + } > + > + @Override > + public synchronized void writeContentsLocked() throws IOException { > + super.writeContentsLocked(); > + } > + > + > + > + > + > + @Override > + protected void readContents() throws IOException { > + if (items == null) { > + items = new ArrayList(); > + } else { > + items.clear(); > + } > + super.readContents(); > + } > + > + @Override > + protected void readLine(String line) { > + if (line.trim().length() != 0) { > + this.items.add(UnsignedAppletActionEntry.createFromString(line)); > + } > + } > + > + @Override > + public void writeContent(BufferedWriter bw) throws IOException { > + for (UnsignedAppletActionEntry item : items) { > + item.write(bw); > + bw.newLine(); > + } > + } > + > + @Override > + public void add(final UnsignedAppletActionEntry item) { > + doLocked(new Runnable() { > + > + @Override > + public void run() { > + try { > + readContents(); > + items.add(item); > + writeContents(); > + } catch (IOException ex) { > + throw new StorageIoException(ex); > + } > + } > + }); > + } > + > + > + @Override > + public void update(final UnsignedAppletActionEntry item) { > + doLocked(new Runnable() { > + > + @Override > + public void run() { > + try { > + if (items == null){ > + throw new StorageIoException("Storage is not initialised, can not update"); > + } > + if (!items.contains(item)){ > + throw new StorageIoException("Storage do not contains item you are updateing. can not update"); s/do not contains/does not contain/ s/updateing/updating/ > + } > + writeContents(); > + } catch (IOException ex) { > + throw new StorageIoException(ex); > + } > + } > + }); > + } > + > + > + > + @Override > + public UnsignedAppletActionEntry getMatchingItem(String documentBase, String codeBase, String mainClass, List archives) { > + List result = getMatchingItems(documentBase, codeBase, mainClass, archives); > + if (result == null || result.isEmpty()) { > + return null; > + } > + //returns first item > + return result.get(0); > + //Or longest match?? > + } > + > + public List getMatchingItems(String documentBase, String codeBase, String mainClass, List archives ) { > + List result = new ArrayList(); > + lock(); > + try { > + readContents(); > + if (items == null) { > + return result; > + } > + for (UnsignedAppletActionEntry unsignedAppletActionEntry : items) { > + if (isMatching(unsignedAppletActionEntry,documentBase,codeBase,mainClass,archives)){ > + result.add(unsignedAppletActionEntry); > + } > + } > + return null; > + } catch (IOException e) { > + throw new StorageIoException(e); > + } finally { > + unlock(); > + return result; > + } > + } > + > + private boolean isMatching(UnsignedAppletActionEntry unsignedAppletActionEntry, String documentBase, String codeBase, String mainClass, List archives) { > + boolean result = true; > + if (documentBase != null && !documentBase.trim().isEmpty()) { > + result = result && documentBase.matches(unsignedAppletActionEntry.getDocumentBase().getRegEx()); > + } > + if (codeBase != null && !codeBase.trim().isEmpty()) { > + result = result && codeBase.matches(unsignedAppletActionEntry.getCodeBase().getRegEx()); > + } > + if (mainClass != null && !mainClass.trim().isEmpty()) { > + result = result && mainClass.equals(unsignedAppletActionEntry.getMainClass()); > + } > + > + if (archives != null) { > + result = result && comapreArchives(archives, unsignedAppletActionEntry.getArchives()); > + } > + return result; > + } > + > + @Override > + public String toString() { > + return getBackingFile()+" "+super.toString(); > + } > + > + private boolean comapreArchives(List archives, List saved) { > + if (archives.size()!=saved.size()) return false; > + Collections.sort(archives); > + Collections.sort(saved); > + for (int i = 0; i < saved.size(); i++) { > + String string1 = saved.get(i); > + String string2 = archives.get(i); > + //intentional reference compare > + if (string1==string2) { > + continue; > + } > + if (string1 == null || string2 == null){ > + return false; > + } > + if (string1.trim().equals(string2.trim())){ > + continue; > + } > + return false; > + } > + return true; > + } > + > + @Override > + public UnsignedAppletActionEntry getMatchingItemByDocumentBase(String documentBase) { > + return getMatchingItem(documentBase, null, null, null); > + } > + > + @Override > + public UnsignedAppletActionEntry getMatchingItemByCodeBase(String codeBase) { > + return getMatchingItem(null, codeBase, null, null); > + } > + > + @Override > + public UnsignedAppletActionEntry getMatchingItemByBases(String documentBase, String codeBase) { > + return getMatchingItem(documentBase, codeBase, null, null); > + } > + > + > + > + > +} > diff -r e631770d76ba netx/net/sourceforge/appletextendedsecurity/impl/UnsignedAppletActionStorageOperator.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/appletextendedsecurity/impl/UnsignedAppletActionStorageOperator.java Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,180 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ > + > +package net.sourceforge.appletextendedsecurity.impl; > + > +import java.io.File; > +import java.io.IOException; > +import java.util.Date; > +import net.sourceforge.appletextendedsecurity.UnsignedAppletAction; > +import net.sourceforge.appletextendedsecurity.UnsignedAppletActionEntry; > +import net.sourceforge.appletextendedsecurity.UrlRegEx; > +import net.sourceforge.jnlp.util.lockingfile.StorageIoException; > + > +public class UnsignedAppletActionStorageOperator extends UnsignedAppletActionStorageImpl { > + > + > + public UnsignedAppletActionStorageOperator(String location) { > + this(new File(location)); > + } > + > + public UnsignedAppletActionStorageOperator(File location) { > + super(location); > + } > + > + public UnsignedAppletActionEntry[] toArray() { > + lock(); > + try { > + readContents(); > + return items.toArray(new UnsignedAppletActionEntry[items.size()]); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } finally { > + unlock(); > + } > + } > + > + public void clear() { > + doLocked(new Runnable() { > + > + public void run() { > + try { > + items.clear(); > + writeContents(); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } > + } > + }); > + } > + > + public void removeByBehaviour(final UnsignedAppletAction unsignedAppletAction) { > + doLocked(new Runnable() { > + > + public void run() { > + try { > + readContents(); > + for (int i = 0; i < items.size(); i++) { > + UnsignedAppletActionEntry unsignedAppletActionEntry = items.get(i); > + if (unsignedAppletActionEntry.getUnsignedAppletAction() == unsignedAppletAction) { > + items.remove(i); > + i--; > + } > + > + } > + writeContents(); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } > + } > + }); > + } > + > + private void swap(final int i, final int ii) { > + doLocked(new Runnable() { > + > + public void run() { > + try { > + readContents(); > + UnsignedAppletActionEntry backup = items.get(i); > + items.set(i, items.get(ii)); > + items.set(ii, backup); > + writeContents(); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } > + } > + }); > + > + } > + > + public void moveUp(int selectedRow) { > + if (selectedRow <= 0) { > + return; > + } > + swap(selectedRow, selectedRow - 1); > + } > + > + public void moveDown(int selectedRow) { > + if (selectedRow >= items.size() - 1) { > + return; > + } > + swap(selectedRow, selectedRow + 1); > + } > + > + public void remove(final int item) { > + doLocked(new Runnable() { > + > + public void run() { > + try { > + readContents(); > + items.remove(item); > + writeContents(); > + } catch (IOException ex) { > + throw new StorageIoException(ex); > + } > + } > + }); > + } > + > + public void modify(final UnsignedAppletActionEntry source, final int columnIndex, final Object aValue) { > + Runnable r = new Runnable() { > + > + public void run() { > + > + try { > + if (!items.contains(source)){ > + throw new StorageIoException("Item to be modified not found in storage"); > + } > + > + if (columnIndex == 0) { > + source.setUnsignedAppletAction((UnsignedAppletAction) aValue); > + } > + if (columnIndex == 1) { > + source.setTimeStamp((Date) aValue); > + } > + if (columnIndex == 2) { > + source.setDocumentBase(new UrlRegEx((String) aValue)); > + } > + if (columnIndex == 3) { > + source.setCodeBase(new UrlRegEx((String) aValue)); > + } > + if (columnIndex == 4) { > + source.setMainClass((String) aValue); > + } > + if (columnIndex == 5) { > + source.setArchives(UnsignedAppletActionEntry.createArchivesList((String) aValue)); > + } > + > + writeContents(); > + } catch (IOException ex) { > + throw new StorageIoException(ex); > + } > + } > + }; > + doLocked(r); > + > + } > + > + @Override > + public synchronized void writeContentsLocked() throws IOException { > + super.writeContentsLocked(); > + } > + > + > +} > diff -r e631770d76ba netx/net/sourceforge/jnlp/config/Defaults.java > --- a/netx/net/sourceforge/jnlp/config/Defaults.java Thu Jan 31 11:12:35 2013 +0100 > +++ b/netx/net/sourceforge/jnlp/config/Defaults.java Fri Feb 01 20:55:48 2013 +0100 > @@ -42,6 +42,7 @@ > import java.io.File; > import java.util.HashMap; > import java.util.Map; > +import net.sourceforge.appletextendedsecurity.AppletSecurityLevel; > > import net.sourceforge.jnlp.ShortcutDesc; > import net.sourceforge.jnlp.runtime.JNLPProxySelector; > @@ -384,6 +385,41 @@ > DeploymentConfiguration.KEY_PLUGIN_JVM_ARGUMENTS, > null, > null > + }, > + //unsigned applet security level > + { > + DeploymentConfiguration.KEY_SECURITY_LEVEL, > + new ValueValidator() { > + > + @Override > + public void validate(Object value) throws IllegalArgumentException { > + if (value == null) { > + throw new IllegalArgumentException("Value can't be null"); > + } > + if (value instanceof AppletSecurityLevel) { > + //?? > + return; > + } > + if (!(value instanceof String)) { > + throw new IllegalArgumentException("Expected was String, was " + value.getClass()); > + } > + try { > + AppletSecurityLevel validated = AppletSecurityLevel.fromString((String) value); > + if (validated == null) { > + throw new IllegalArgumentException("Result can't be null, was"); > + } > + //thrown by fromString > + } catch (RuntimeException ex) { > + throw new IllegalArgumentException(ex); > + } > + } > + > + @Override > + public String getPossibleValues() { > + return AppletSecurityLevel.allToString(); > + } > + }, > + null > } > }; > > diff -r e631770d76ba netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java > --- a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java Thu Jan 31 11:12:35 2013 +0100 > +++ b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java Fri Feb 01 20:55:48 2013 +0100 > @@ -51,6 +51,7 @@ > public static final String DEPLOYMENT_DIR = ".icedtea"; > public static final String DEPLOYMENT_CONFIG = "deployment.config"; > public static final String DEPLOYMENT_PROPERTIES = "deployment.properties"; > + public static final String APPLET_TRUST_SETTINGS = ".appletTrustSettings"; > > public static final String DEPLOYMENT_COMMENT = "Netx deployment configuration"; > > @@ -105,6 +106,9 @@ > /** Boolean. Only show security prompts to user if true */ > public static final String KEY_SECURITY_PROMPT_USER = "deployment.security.askgrantdialog.show"; > > + //enum of AppletSecurityLevel in result > + public static final String KEY_SECURITY_LEVEL = "deployment.security.level"; > + > public static final String KEY_SECURITY_TRUSTED_POLICY = "deployment.security.trusted.policy"; > > /** Boolean. Only give AWTPermission("showWindowWithoutWarningBanner") if true */ > @@ -196,6 +200,17 @@ > load(true); > } > > + public static File getAppletTrustCustomSettingsPath() { > + return new File(System.getProperty("user.home") + File.separator + DEPLOYMENT_DIR > + + File.separator + APPLET_TRUST_SETTINGS); > + } > + > + public static File getAppletTrustGlobalSettingsPath() { > + return new File(File.separator + "etc" + File.separator + ".java" + File.separator > + + "deployment" + File.separator + APPLET_TRUST_SETTINGS); > + > + } > + > /** > * Initialize this deployment configuration by reading configuration files. > * Generally, it will try to continue and ignore errors it finds (such as file not found). > diff -r e631770d76ba netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java > --- a/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java Thu Jan 31 11:12:35 2013 +0100 > +++ b/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java Fri Feb 01 20:55:48 2013 +0100 > @@ -41,6 +41,7 @@ > import javax.swing.JFrame; > import javax.swing.JLabel; > import javax.swing.JList; > +import javax.swing.JOptionPane; > import javax.swing.JPanel; > import javax.swing.JScrollPane; > import javax.swing.SwingConstants; > @@ -230,7 +231,10 @@ > new SettingsPanel(Translator.R("CPTabNetwork"), createNetworkSettingsPanel()), > // TODO: This is commented out since this is not implemented yet > // new SettingsPanel(Translator.R("CPTabRuntimes"), createRuntimesSettingsPanel()), > - new SettingsPanel(Translator.R("CPTabSecurity"), createSecuritySettingsPanel()), }; > + new SettingsPanel(Translator.R("CPTabSecurity"), createSecuritySettingsPanel()), > + //todo refactor to work with tmp file and apply as asu designed it > + new SettingsPanel(Translator.R("APPEXTSECControlPanelExtendedAppletSecurityTitle"), new UnsignedAppletsTrustingListPanel(DeploymentConfiguration.getAppletTrustGlobalSettingsPath(),DeploymentConfiguration.getAppletTrustCustomSettingsPath(), this.config) ) > + }; > > // Add panels. > final JPanel settingsPanel = new JPanel(new CardLayout()); > @@ -360,6 +364,7 @@ > config.save(); > } catch (IOException e) { > e.printStackTrace(); > + JOptionPane.showMessageDialog(this, e); > } > } > > diff -r e631770d76ba netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,168 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ > + > +package net.sourceforge.jnlp.controlpanel; > + > +import java.util.Date; > +import javax.swing.table.AbstractTableModel; > +import net.sourceforge.appletextendedsecurity.UnsignedAppletAction; > +import net.sourceforge.appletextendedsecurity.UnsignedAppletActionEntry; > +import net.sourceforge.appletextendedsecurity.UrlRegEx; > +import net.sourceforge.appletextendedsecurity.impl.UnsignedAppletActionStorageOperator; > +import net.sourceforge.jnlp.runtime.Translator; > + > +public class UnsignedAppletActionTableModel extends AbstractTableModel { > + > + final UnsignedAppletActionStorageOperator back; > + private final String[] columns = new String[]{Translator.R("APPEXTSECguiTableModelTableColumnAction"), > + Translator.R("APPEXTSECguiTableModelTableColumnDateOfAction"), > + Translator.R("APPEXTSECguiTableModelTableColumnDocumentBase"), > + Translator.R("APPEXTSECguiTableModelTableColumnCodeBase"), > + Translator.R("APPEXTSECguiTableModelTableColumnMainClass"), > + Translator.R("APPEXTSECguiTableModelTableColumnArchives")}; > + > + public UnsignedAppletActionTableModel(UnsignedAppletActionStorageOperator back) { > + this.back = back; > + } > + > + @Override > + public int getRowCount() { > + try { > + return back.toArray().length; > + } catch (Exception ex) { > + throw new RuntimeException(ex); > + } > + } > + > + @Override > + public int getColumnCount() { > + return columns.length; > + } > + > + @Override > + public String getColumnName(int columnIndex) { > + return columns[columnIndex]; > + } > + > + @Override > + public Class getColumnClass(int columnIndex) { > + if (columnIndex == 0) { > + return UnsignedAppletAction.class; > + } > + if (columnIndex == 1) { > + return Date.class; > + } > + if (columnIndex == 2) { > + return UrlRegEx.class; > + } > + if (columnIndex == 3) { > + return UrlRegEx.class; > + } > + if (columnIndex == 3) { > + return String.class; > + } > + if (columnIndex == 3) { > + return String.class; > + } > + return Object.class; > + } > + > + @Override > + public boolean isCellEditable(int rowIndex, int columnIndex) { > + if (back.isReadOnly()){ > + return false; > + } > + if (columnIndex==1) return false; > + if (columnIndex==0) return true; > + if (getValueAt(rowIndex, columnIndex-1)==null || getValueAt(rowIndex, columnIndex-1).toString().trim().isEmpty()) return false; > + return true; > + } > + > + @Override > + public Object getValueAt(int rowIndex, int columnIndex) { > + > + UnsignedAppletActionEntry source = back.toArray()[rowIndex]; > + if (columnIndex == 0) { > + return source.getUnsignedAppletAction(); > + } > + if (columnIndex == 1) { > + return source.getTimeStamp(); > + } > + if (columnIndex == 2) { > + return source.getDocumentBase(); > + } > + if (columnIndex == 3) { > + return source.getCodeBase(); > + } > + if (columnIndex == 4) { > + return source.getMainClass(); > + } > + if (columnIndex == 5) { > + return UnsignedAppletActionEntry.createArchivesString(source.getArchives()); > + } > + return null; > + } > + > + @Override > + public void setValueAt(final Object aValue, final int rowIndex, final int columnIndex) { > + final UnsignedAppletActionEntry source = back.toArray()[rowIndex]; > + back.modify(source, columnIndex, aValue); > + > + } > + > + public void addRow() { > + int i = back.toArray().length; > + String s = "\\Qhttp://localhost:80/\\E.*"; > + back.add(new UnsignedAppletActionEntry( > + UnsignedAppletAction.NEVER, > + new Date(), > + new UrlRegEx(s), > + new UrlRegEx(s), > + null, > + null)); > + fireTableRowsInserted(i, i + 1); > + } > + > + public void removeRow(int i) { > + back.remove(i); > + fireTableRowsDeleted(i, i); > + } > + > + public void clear() { > + int i = getRowCount(); > + back.clear(); > + fireTableRowsDeleted(0, i); > + } > + > + void removeByBehaviour(UnsignedAppletAction unsignedAppletAction) { > + int i = getRowCount(); > + back.removeByBehaviour(unsignedAppletAction); > + fireTableRowsDeleted(0, i); > + } > + > + void moveUp(int selectedRow) { > + int i = getRowCount(); > + back.moveUp(selectedRow); > + fireTableRowsUpdated(i-1, i); > + } > + void moveDown(int selectedRow) { > + int i = getRowCount(); > + back.moveDown(selectedRow); > + fireTableRowsUpdated(i, i+1); > + } > +} > diff -r e631770d76ba netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,665 @@ > +/* > + Copyright (C) 2013 Red Hat > + > + This program 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 of the License, or > + (at your option) any later version. > + > + This program 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 this program; if not, write to the Free Software > + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > + */ > +package net.sourceforge.jnlp.controlpanel; > + > +import java.awt.BorderLayout; > +import java.io.BufferedWriter; > +import java.io.File; > +import java.io.FileOutputStream; > +import java.io.OutputStreamWriter; > +import java.text.DateFormat; > +import java.util.ArrayList; > +import java.util.Collections; > +import java.util.Date; > +import java.util.List; > +import java.util.regex.Pattern; > +import javax.swing.event.ChangeEvent; > +import javax.swing.event.ListSelectionEvent; > +import net.sourceforge.appletextendedsecurity.UnsignedAppletAction; > +import net.sourceforge.appletextendedsecurity.UrlRegEx; > +import javax.swing.DefaultCellEditor; > +import javax.swing.JComboBox; > +import javax.swing.JFrame; > +import javax.swing.JOptionPane; > +import javax.swing.JPanel; > +import javax.swing.JTable; > +import javax.swing.JTextField; > +import javax.swing.event.ChangeListener; > +import javax.swing.event.ListSelectionListener; > +import javax.swing.table.DefaultTableCellRenderer; > +import javax.swing.table.DefaultTableModel; > +import javax.swing.table.TableCellEditor; > +import javax.swing.table.TableCellRenderer; > +import javax.swing.table.TableModel; > +import net.sourceforge.appletextendedsecurity.UnsignedAppletActionEntry; > +import net.sourceforge.appletextendedsecurity.impl.UnsignedAppletActionStorageOperator; > +import net.sourceforge.appletextendedsecurity.AppletSecurityLevel; > +import net.sourceforge.jnlp.config.DeploymentConfiguration; > +import net.sourceforge.jnlp.runtime.Translator; > + > +public class UnsignedAppletsTrustingListPanel extends javax.swing.JPanel { > + > + private javax.swing.JButton jButton1; > + private javax.swing.JButton jButton2; > + private javax.swing.JButton jButton3; > + private javax.swing.JButton jButton4; > + private javax.swing.JButton jButton5; > + private javax.swing.JButton jButton6; > + private javax.swing.JButton jButton7; > + private javax.swing.JButton jButton8; > + private javax.swing.JCheckBox jCheckBox1; > + private javax.swing.JCheckBox jCheckBox2; > + private javax.swing.JComboBox jComboBox1; > + private javax.swing.JComboBox jComboBox2; > + private javax.swing.JLabel jLabel1; > + private javax.swing.JLabel jLabel2; > + private javax.swing.JScrollPane jScrollPane1; > + private javax.swing.JTabbedPane jTabPane1; > + private javax.swing.JTable jTable1; > + private javax.swing.JScrollPane jScrollPane2; > + private javax.swing.JTable jTable2; > + private final UnsignedAppletActionStorageOperator customBackEnd; > + private final UnsignedAppletActionStorageOperator globalBackEnd; > + private final UnsignedAppletActionTableModel customModel; > + private final UnsignedAppletActionTableModel globalModel; > + private final DeploymentConfiguration conf; > + private javax.swing.JTable currentTable; > + private UnsignedAppletActionTableModel currentModel; > + private String lastDoc; > + private String lastCode; > + > + > + /* > + * for testing and playing > + */ > + public static void main(String args[]) { > + final String defaultDir = System.getProperty("user.home") + "/Desktop/"; > + final String defaultFileName1 = "terrorList1"; > + final String defaultFileName2 = "terrorList2"; > + final String defaultFile1 = defaultDir + defaultFileName1; > + final String defaultFile2 = defaultDir + defaultFileName2; > + java.awt.EventQueue.invokeLater(new Runnable() { > + @Override > + public void run() { > + try { > + JFrame f = new JFrame(); > + f.setSize(700, 300); > + f.setLayout(new BorderLayout()); > + f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); > + DeploymentConfiguration cc = new DeploymentConfiguration(); > + cc.load(); > + File ff1 = new File(defaultFile1); > + File ff2 = new File(defaultFile2); > + f.add(new UnsignedAppletsTrustingListPanel(ff2, ff1, cc)); > + f.setVisible(true); > + } catch (Exception ex) { > + ex.printStackTrace(); > + } > + } > + }); > + } > + > + public UnsignedAppletsTrustingListPanel(File globalSettings, File customSettings, DeploymentConfiguration conf) { > + customBackEnd = new UnsignedAppletActionStorageOperator(customSettings); > + globalBackEnd = new UnsignedAppletActionStorageOperator(globalSettings); > + customModel = new UnsignedAppletActionTableModel(customBackEnd); > + globalModel = new UnsignedAppletActionTableModel(globalBackEnd); > + initComponents(); > + this.conf = conf; > + AppletSecurityLevel gs = AppletSecurityLevel.getDefault(); > + String s = conf.getProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL); > + if (s != null) { > + gs = AppletSecurityLevel.fromString(s); > + } > + jComboBox1.setSelectedItem(gs); > + jTable1.getSelectionModel().addListSelectionListener(new SingleSelectionListenerImpl(jTable1)); > + jTable2.getSelectionModel().addListSelectionListener(new SingleSelectionListenerImpl(jTable2)); > + currentTable = jTable1; > + currentModel = customModel; > + setButtons((!currentModel.back.isReadOnly())); > + } > + > + public String appletItemsToCaption(List ii, String caption) { > + StringBuilder sb = new StringBuilder(); > + for (UnsignedAppletActionEntry i : ii) { > + sb.append(appletItemToCaption(i, caption)).append("\n"); > + } > + return sb.toString(); > + } > + > + public String appletItemToCaption(UnsignedAppletActionEntry i, String caption) { > + return Translator.R("APPEXTSECguiPanelAppletInfoHederPart1", caption, i.getDocumentBase().getFilteredRegEx()) > + + "\n (" + Translator.R("APPEXTSECguiPanelAppletInfoHederPart2", i.getUnsignedAppletAction(), DateFormat.getInstance().format(i.getTimeStamp())) > + + "\n " + Translator.R("APPEXTSECguiTableModelTableColumnDocumentBase") + ": " + i.getDocumentBase().getFilteredRegEx() > + + "\n " + Translator.R("APPEXTSECguiTableModelTableColumnCodeBase") + ": " + i.getCodeBase().getFilteredRegEx() > + + "\n " + Translator.R("APPEXTSECguiTableModelTableColumnMainClass") + ": " + ((i.getMainClass() == null) ? "" : i.getMainClass()) > + + "\n " + Translator.R("APPEXTSECguiTableModelTableColumnArchives") + ": " + UnsignedAppletActionEntry.createArchivesString(i.getArchives()); > + } > + > + public void removeSelectedFromTable(JTable table) { > + int[] originalIndexes = table.getSelectedRows(); > + List newIndexes = new ArrayList(originalIndexes.length); > + for (int i = 0; i < originalIndexes.length; i++) { > + //we need to remap values first > + int modelRow = table.convertRowIndexToModel(originalIndexes[i]); > + newIndexes.add(modelRow); > + } > + //now to sort so we can incrementaly dec safely > + Collections.sort(newIndexes); > + if (jCheckBox1.isSelected()) { > + String s = Translator.R("APPEXTSECguiPanelConfirmDeletionOf", newIndexes.size()) + ": \n"; > + UnsignedAppletActionEntry[] items = currentModel.back.toArray(); > + for (int i = 0; i < newIndexes.size(); i++) { > + Integer integer = newIndexes.get(i); > + s += appletItemToCaption(items[integer], " ") + "\n"; > + } > + int a = JOptionPane.showConfirmDialog(this, s); > + if (a != JOptionPane.OK_OPTION) { > + return; > + } > + } > + int sub = 0; > + for (int i = 0; i < newIndexes.size(); i++) { > + Integer integer = newIndexes.get(i); > + currentModel.removeRow(integer.intValue() + sub); > + sub--; > + } > + } > + > + public void removeAllItemsFromTable(JTable table, UnsignedAppletActionTableModel model) { > + table.clearSelection(); > + > + if (jCheckBox1.isSelected()) { > + UnsignedAppletActionEntry[] items = model.back.toArray(); > + String s = Translator.R("APPEXTSECguiPanelConfirmDeletionOf", items.length) + ": \n"; > + for (int i = 0; i < items.length; i++) { > + s += appletItemToCaption(items[i], " ") + "\n"; > + } > + int a = JOptionPane.showConfirmDialog(this, s); > + if (a != JOptionPane.OK_OPTION) { > + return; > + } > + } > + model.clear(); > + } > + > + private void initComponents() { > + > + jScrollPane1 = new javax.swing.JScrollPane(); > + jScrollPane2 = new javax.swing.JScrollPane(); > + jTable1 = createTbale(customModel); > + jTable2 = createTbale(globalModel); > + jButton1 = new javax.swing.JButton(); > + jComboBox1 = new JComboBox(new AppletSecurityLevel[]{ > + AppletSecurityLevel.DENY_ALL, > + AppletSecurityLevel.DENY_UNSIGNED, > + AppletSecurityLevel.ASK_UNSIGNED, > + AppletSecurityLevel.ALLOW_UNSIGNED > + }); > + jComboBox1.setSelectedItem(AppletSecurityLevel.getDefault()); > + jLabel2 = new javax.swing.JLabel(); > + jLabel1 = new javax.swing.JLabel(); > + jComboBox2 = new javax.swing.JComboBox(); > + jButton2 = new javax.swing.JButton(); > + jButton5 = new javax.swing.JButton(); > + jButton3 = new javax.swing.JButton(); > + jButton4 = new javax.swing.JButton(); > + jCheckBox1 = new javax.swing.JCheckBox(); > + jCheckBox2 = new javax.swing.JCheckBox(); > + jButton6 = new javax.swing.JButton(); > + jButton7 = new javax.swing.JButton(); > + jButton8 = new javax.swing.JButton(); > + jTabPane1 = new javax.swing.JTabbedPane(); > + > + jScrollPane1.setViewportView(jTable1); > + > + jScrollPane2.setViewportView(jTable2); > + > + jButton1.setText(Translator.R("APPEXTSECguiPanelHelpButton")); > + jButton1.addActionListener(new java.awt.event.ActionListener() { > + @Override > + public void actionPerformed(java.awt.event.ActionEvent evt) { > + jButton1ActionPerformed(evt); > + } > + }); > + > + jComboBox1.addActionListener(new java.awt.event.ActionListener() { > + @Override > + public void actionPerformed(java.awt.event.ActionEvent evt) { > + jComboBox1ActionPerformed(evt); > + } > + }); > + > + jLabel2.setText(Translator.R("APPEXTSECguiPanelSecurityLevel")); > + > + jLabel1.setText(Translator.R("APPEXTSECguiPanelGlobalBehaviourCaption")); > + > + jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[]{ > + Translator.R("APPEXTSECguiPanelDeleteMenuSelected"), > + Translator.R("APPEXTSECguiPanelDeleteMenuAllA"), > + Translator.R("APPEXTSECguiPanelDeleteMenuAllN"), > + Translator.R("APPEXTSECguiPanelDeleteMenuAlly"), > + Translator.R("APPEXTSECguiPanelDeleteMenuAlln"), > + Translator.R("APPEXTSECguiPanelDeleteMenuAllAll")})); > + > + jButton2.setText(Translator.R("APPEXTSECguiPanelDeleteButton")); > + jButton2.addActionListener(new java.awt.event.ActionListener() { > + @Override > + public void actionPerformed(java.awt.event.ActionEvent evt) { > + jButton2ActionPerformed(evt); > + } > + }); > + > + jButton5.setText(Translator.R("APPEXTSECguiPanelTestUrlButton")); > + jButton5.addActionListener(new java.awt.event.ActionListener() { > + @Override > + public void actionPerformed(java.awt.event.ActionEvent evt) { > + jButton5ActionPerformed(evt); > + } > + }); > + > + jButton3.setText(Translator.R("APPEXTSECguiPanelAddRowButton")); > + jButton3.addActionListener(new java.awt.event.ActionListener() { > + @Override > + public void actionPerformed(java.awt.event.ActionEvent evt) { > + jButton3ActionPerformed(evt); > + } > + }); > + > + jButton4.setText(Translator.R("APPEXTSECguiPanelValidateTableButton")); > + jButton4.addActionListener(new java.awt.event.ActionListener() { > + @Override > + public void actionPerformed(java.awt.event.ActionEvent evt) { > + jButton4ActionPerformed(evt); > + } > + }); > + > + jCheckBox1.setSelected(true); > + jCheckBox1.setText(Translator.R("APPEXTSECguiPanelAskeforeActionBox")); > + > + jCheckBox2.setText(Translator.R("APPEXTSECguiPanelShowRegExesBox")); > + jCheckBox2.addActionListener(new java.awt.event.ActionListener() { > + @Override > + public void actionPerformed(java.awt.event.ActionEvent evt) { > + jCheckBox2ActionPerformed(evt); > + } > + }); > + > + jButton6.setText(Translator.R("APPEXTSECguiPanelInverSelection")); > + jButton6.addActionListener(new java.awt.event.ActionListener() { > + @Override > + public void actionPerformed(java.awt.event.ActionEvent evt) { > + jButton6ActionPerformed(evt); > + } > + }); > + > + jButton7.setText(Translator.R("APPEXTSECguiPanelMoveRowUp")); > + jButton7.setEnabled(false); > + jButton7.addActionListener(new java.awt.event.ActionListener() { > + @Override > + public void actionPerformed(java.awt.event.ActionEvent evt) { > + jButton7ActionPerformed(evt); > + } > + }); > + > + jButton8.setText(Translator.R("APPEXTSECguiPanelMoveRowDown")); > + jButton8.setEnabled(false); > + jButton8.addActionListener(new java.awt.event.ActionListener() { > + @Override > + public void actionPerformed(java.awt.event.ActionEvent evt) { > + jButton8ActionPerformed(evt); > + } > + }); > + > + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); > + this.setLayout(layout); > + layout.setHorizontalGroup( > + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addComponent(jTabPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 583, Short.MAX_VALUE).addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING).addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup().addComponent(jLabel2).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jComboBox1, 0, 474, Short.MAX_VALUE)).addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup().addComponent(jButton3).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jButton4).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jButton5).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 94, Short.MAX_VALUE).addComponent(jButton8).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jButton7)).addGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addComponent(jButton2).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jButton6)).addGroup(layout.createSequentialGroup().addComponent(jCheckBox1).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jCheckBox2))).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 93, Short.MAX_VALUE).addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE))).addContainerGap())); > + layout.setVerticalGroup( > + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jLabel1).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jLabel2).addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false).addComponent(jButton2).addComponent(jComboBox2).addComponent(jButton6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jCheckBox1).addComponent(jCheckBox2))).addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jTabPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 161, Short.MAX_VALUE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jButton3).addComponent(jButton4).addComponent(jButton5).addComponent(jButton7).addComponent(jButton8)).addContainerGap())); > + > + JPanel pane1 = new JPanel(new BorderLayout()); > + JPanel pane2 = new JPanel(new BorderLayout()); > + pane1.add(jScrollPane1); > + pane2.add(jScrollPane2); > + jTabPane1.add(pane1); > + jTabPane1.add(pane2); > + jTabPane1.setTitleAt(0, Translator.R("APPEXTSECguiPanelCustomDefs")); > + jTabPane1.setTitleAt(1, Translator.R("APPEXTSECguiPanelGlobalDefs")); > + jTabPane1.setToolTipTextAt(0, DeploymentConfiguration.getAppletTrustCustomSettingsPath().getAbsolutePath()); > + jTabPane1.setToolTipTextAt(1, DeploymentConfiguration.getAppletTrustGlobalSettingsPath().getAbsolutePath()); > + jTabPane1.addChangeListener(new ChangeListener() { > + @Override > + public void stateChanged(ChangeEvent e) { > + switch (jTabPane1.getSelectedIndex()) { > + case 0: > + currentModel = customModel; > + currentTable = jTable1; > + break; > + case 1: > + currentModel = globalModel; > + currentTable = jTable2; > + break; > + } > + setButtons((!currentModel.back.isReadOnly())); > + } > + }); > + } > + > + private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) { > + try { > + conf.setProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL, ((AppletSecurityLevel) jComboBox1.getSelectedItem()).toChars()); > + conf.save(); > + } catch (Exception ex) { > + ex.printStackTrace(); > + JOptionPane.showMessageDialog(this, ex); > + } > + } > + > + private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { > + > + if (jComboBox2.getSelectedIndex() == 0) { > + removeSelectedFromTable(currentTable); > + } > + if (jComboBox2.getSelectedIndex() == 1) { > + removeByBehaviour(UnsignedAppletAction.ALWAYS); > + } > + if (jComboBox2.getSelectedIndex() == 2) { > + removeByBehaviour(UnsignedAppletAction.NEVER); > + } > + if (jComboBox2.getSelectedIndex() == 3) { > + removeByBehaviour(UnsignedAppletAction.YES); > + } > + if (jComboBox2.getSelectedIndex() == 4) { > + removeByBehaviour(UnsignedAppletAction.NO); > + } > + if (jComboBox2.getSelectedIndex() == 5) { > + removeAllItemsFromTable(currentTable, customModel); > + } > + } > + > + private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) { > + > + String s1 = JOptionPane.showInputDialog(Translator.R("APPEXTSECguiPanelDocTest"), lastDoc); > + String s2 = JOptionPane.showInputDialog(Translator.R("APPEXTSECguiPanelCodeTest"), lastCode); > + lastDoc = s1; > + lastCode = s2; > + try { > + List i = currentModel.back.getMatchingItems(s1, s2, null, null); > + if (i == null || i.isEmpty()) { > + JOptionPane.showMessageDialog(this, Translator.R("APPEXTSECguiPanelNoMatch")); > + } else { > + JOptionPane.showMessageDialog(this, Translator.R("APPEXTSECguiPanelMatchingNote") + "\n" + appletItemsToCaption(i, Translator.R("APPEXTSECguiPanelMatched") + ": ")); > + } > + } catch (Exception ex) { > + ex.printStackTrace(); > + JOptionPane.showMessageDialog(this, Translator.R("APPEXTSECguiPanelMatchingError", ex)); > + } > + > + } > + > + private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { > + > + currentModel.addRow(); > + } > + > + private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) { > + > + File f = null; > + try { > + f = File.createTempFile("appletTable", "validation"); > + } catch (Exception ex) { > + ex.printStackTrace(); > + JOptionPane.showMessageDialog(this, Translator.R("APPEXTSECguiPanelCanNOtValidate", ex.toString())); > + return; > + } > + try { > + currentModel.back.writeContentsLocked(); > + BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(f), "UTF-8")); > + currentModel.back.writeContent(bw); > + bw.flush(); > + bw.close(); > + UnsignedAppletActionStorageOperator copy = new UnsignedAppletActionStorageOperator(f); > + UnsignedAppletActionEntry[] items = copy.toArray(); > + for (int i = 0; i < items.length; i++) { > + UnsignedAppletActionEntry unsignedAppletActionEntry = items[i]; > + if (unsignedAppletActionEntry.getDocumentBase() != null && !unsignedAppletActionEntry.getDocumentBase().getRegEx().trim().isEmpty()) { > + Pattern p = Pattern.compile(unsignedAppletActionEntry.getDocumentBase().getRegEx()); > + p.matcher("someInput").find(); > + } else { > + throw new RuntimeException(Translator.R("APPEXTSECguiPanelEmptyDoc")); > + } > + if (unsignedAppletActionEntry.getCodeBase() != null && !unsignedAppletActionEntry.getCodeBase().getRegEx().trim().isEmpty()) { > + Pattern p = Pattern.compile(unsignedAppletActionEntry.getCodeBase().getRegEx()); > + p.matcher("someInput").find(); > + } else { > + throw new RuntimeException(Translator.R("APPEXTSECguiPanelEmptyCode")); > + } > + UnsignedAppletActionEntry.createArchivesString(UnsignedAppletActionEntry.createArchivesList(UnsignedAppletActionEntry.createArchivesString(unsignedAppletActionEntry.getArchives()))); > + > + } > + JOptionPane.showMessageDialog(this, Translator.R("APPEXTSECguiPanelTableValid")); > + } catch (Exception ex) { > + ex.printStackTrace(); > + JOptionPane.showMessageDialog(this, Translator.R("APPEXTSECguiPanelTableInvalid ", ex.toString())); > + } finally { > + f.delete(); > + } > + > + } > + > + private void jCheckBox2ActionPerformed(java.awt.event.ActionEvent evt) { > + > + reloadTable(); > + } > + > + private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) { > + int[] selectedIndexs = currentTable.getSelectedRows(); > + currentTable.selectAll(); > + > + for (int i = 0; i < currentTable.getRowCount(); i++) { > + for (int selectedIndex : selectedIndexs) { > + if (selectedIndex == i) { > + currentTable.removeRowSelectionInterval(i, i); > + break; > + } > + } > + } > + } > + > + private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) { > + int orig = currentTable.getSelectedRow(); > + int i = currentTable.convertRowIndexToModel(orig); > + currentModel.moveUp(i); > + reloadTable(); > + if (orig >= 1) { > + currentTable.getSelectionModel().setSelectionInterval(orig - 1, orig - 1); > + } > + } > + > + private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) { > + int orig = currentTable.getSelectedRow(); > + int i = currentTable.convertRowIndexToModel(orig); > + currentModel.moveDown(i); > + reloadTable(); > + if (orig < currentModel.getRowCount()) { > + currentTable.getSelectionModel().setSelectionInterval(orig + 1, orig + 1); > + } > + } > + > + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { > + } > + > + private void setButtons(boolean b) { > + jButton2.setEnabled(b); > + jButton3.setEnabled(b); > + jButton6.setEnabled(b); > + jButton7.setEnabled(b); > + jButton8.setEnabled(b); > + } > + > + private JTable createTbale(final TableModel model) { > + JTable jt = new JTable() { > + @Override > + public TableCellEditor getCellEditor(int row, int column) { > + if (column == 0) { > + return new DefaultCellEditor(new JComboBox(new UnsignedAppletAction[]{UnsignedAppletAction.ALWAYS, UnsignedAppletAction.NEVER, UnsignedAppletAction.YES, UnsignedAppletAction.NO})); > + } > + if (column == 2) { > + return new DefaultCellEditor(new MyTextField((UrlRegEx) (model.getValueAt(row, column)))); > + } > + if (column == 3) { > + return new DefaultCellEditor(new MyTextField((UrlRegEx) (model.getValueAt(row, column)))); > + } > + return super.getCellEditor(row, column); > + } > + > + @Override > + public TableCellRenderer getCellRenderer(int row, int column) { > + if (column == 1) { > + return new UrlRegexCellRenderer.MyDateCellRenderer((Date) (model.getValueAt(row, column))); > + } > + if (column == 2) { > + if (!jCheckBox2.isSelected()) { > + return new UrlRegexCellRenderer((UrlRegEx) (model.getValueAt(row, column))); > + } > + } > + if (column == 3) { > + if (!jCheckBox2.isSelected()) { > + return new UrlRegexCellRenderer((UrlRegEx) (model.getValueAt(row, column))); > + } > + } > + return super.getCellRenderer(row, column); > + } > + }; > + jt.setRowHeight(jt.getRowHeight() + jt.getRowHeight() / 2); > + jt.setModel(model); > + return jt; > + > + } > + > + private void reloadTable() { > + currentTable.setModel(new DefaultTableModel()); > + currentTable.setModel(currentModel); > + > + } > + > + private void removeByBehaviour(UnsignedAppletAction unsignedAppletAction) { > + UnsignedAppletActionEntry[] items = currentModel.back.toArray(); > + if (jCheckBox1.isSelected()) { > + List toBeDeleted = new ArrayList(); > + for (int i = 0; i < items.length; i++) { > + UnsignedAppletActionEntry unsignedAppletActionEntry = items[i]; > + if (unsignedAppletActionEntry.getUnsignedAppletAction() == unsignedAppletAction) { > + toBeDeleted.add(unsignedAppletActionEntry); > + } > + > + } > + String s = Translator.R("APPEXTSECguiPanelConfirmDeletionOf", toBeDeleted.size())+": \n"; > + for (int i = 0; i < toBeDeleted.size(); i++) { > + s += appletItemToCaption(toBeDeleted.get(i), " ") + "\n"; > + } > + int a = JOptionPane.showConfirmDialog(this, s); > + if (a != JOptionPane.OK_OPTION) { > + return; > + } > + } > + currentModel.removeByBehaviour(unsignedAppletAction); > + } > + > + public static final class MyTextField extends JTextField { > + > + private final UrlRegEx keeper; > + > + private MyTextField(UrlRegEx urlRegEx) { > + if (urlRegEx == null) { > + keeper = new UrlRegEx(""); > + } else { > + this.keeper = urlRegEx; > + } > + setText(keeper.getFilteredRegEx()); > + } > + > + @Override > + public void setText(String t) { > + super.setText(keeper.getRegEx()); > + } > + } > + > + public static final class UrlRegexCellRenderer extends DefaultTableCellRenderer { > + > + private final UrlRegEx keeper; > + > + private UrlRegexCellRenderer(UrlRegEx urlRegEx) { > + if (urlRegEx == null) { > + keeper = new UrlRegEx(""); > + } else { > + this.keeper = urlRegEx; > + } > + setText(keeper.getFilteredRegEx()); > + } > + > + @Override > + public void setText(String t) { > + if (keeper == null) { > + super.setText(""); > + } else { > + super.setText(keeper.getFilteredRegEx()); > + } > + } > + > + public static final class MyDateCellRenderer extends DefaultTableCellRenderer { > + > + private final Date keeper; > + > + private MyDateCellRenderer(Date d) { > + this.keeper = d; > + setText(DateFormat.getInstance().format(d)); > + } > + > + @Override > + public void setText(String t) { > + if (keeper == null) { > + super.setText(""); > + } else { > + super.setText(DateFormat.getInstance().format(keeper)); > + } > + } > + } > + } > + > + private class SingleSelectionListenerImpl implements ListSelectionListener { > + > + private final JTable table; > + > + public SingleSelectionListenerImpl(JTable table) { > + this.table = table; > + } > + > + @Override > + public void valueChanged(ListSelectionEvent e) { > + if (table.getSelectedRows().length == 1) { > + jButton7.setEnabled(true); > + jButton8.setEnabled(true); > + } else { > + jButton7.setEnabled(false); > + jButton8.setEnabled(false); > + } > + } > + } > +} > diff -r e631770d76ba netx/net/sourceforge/jnlp/resources/Messages.properties > --- a/netx/net/sourceforge/jnlp/resources/Messages.properties Thu Jan 31 11:12:35 2013 +0100 > +++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Fri Feb 01 20:55:48 2013 +0100 > @@ -474,3 +474,57 @@ > SPLASHerrorInInformation = Error during loading of information element, verify source rather > SPLASHmissingInformation = Information element is missing, verify source rather > SPLASHchainWas = This is the list of exceptions that occurred launching your applet. Please note, those exceptions can be from multiple applets. For a good bug report, be sure to run only one applet. > + > +APPEXTSECappletSecurityLevelExtraHighId=Extra High Security > +APPEXTSECappletSecurityLevelVeryHighId=Very High Security > +APPEXTSECappletSecurityLevelHighId=High Security > +APPEXTSECappletSecurityLevelLowId=Low Security > +APPEXTSECappletSecurityLevelExtraHighExplanation=No applet will be run > +APPEXTSECappletSecurityLevelVeryHighExplanation=No unsigned applets will be run > +APPEXTSECappletSecurityLevelHighExplanation=User will be prompted for each unsigned applet > +APPEXTSECappletSecurityLevelLowExplanation=All, even untrusted, applets will be run OK not typo but IMO s/ applets/ unsigned applets/ > +APPEXTSECunsignedAppletActionAlways=Always trust this applet(s) OK again not typo but maybe s/this applet(s)/matching applets/ > +APPEXTSECunsignedAppletActionNever=Never trust this applet(s) > +APPEXTSECunsignedAppletActionYes=This applet was visited and allowed > +APPEXTSECunsignedAppletActionNo=This applet was visited and denied > +APPEXTSECControlPanelExtendedAppletSecurityTitle=Extended applet security > +APPEXTSECguiTableModelTableColumnAction=Action > +APPEXTSECguiTableModelTableColumnDateOfAction=Date of action > +APPEXTSECguiTableModelTableColumnDocumentBase=Document-base > +APPEXTSECguiTableModelTableColumnCodeBase=Code-base > +APPEXTSECguiTableModelTableColumnMainClass=Main class > +APPEXTSECguiTableModelTableColumnArchives=Archives > +APPEXTSECguiPanelAppletInfoHederPart1={0} {1} > +APPEXTSECguiPanelAppletInfoHederPart2={0} from {1} > +APPEXTSECguiPanelConfirmDeletionOf=Are you sure you want to delete following {0} items > +APPEXTSECguiPanelHelpButton=Help > +APPEXTSECguiPanelSecurityLevel=Security Level > +APPEXTSECguiPanelGlobalBehaviourCaption=Settings of global behaviour for applets > +APPEXTSECguiPanelDeleteMenuSelected=selected > +APPEXTSECguiPanelDeleteMenuAllA=all allowed (A) > +APPEXTSECguiPanelDeleteMenuAllN=all forbidden (N) > +APPEXTSECguiPanelDeleteMenuAlly=all approved (y) > +APPEXTSECguiPanelDeleteMenuAlln=all disaprooved (n) s/disaprooved/rejected/ :^) > +APPEXTSECguiPanelDeleteMenuAllAll=absolute all s/absolute all/all matches/ :^) > +APPEXTSECguiPanelDeleteButton=Delete > +APPEXTSECguiPanelTestUrlButton=Test url > +APPEXTSECguiPanelAddRowButton=Add new row > +APPEXTSECguiPanelValidateTableButton=Validate table > +APPEXTSECguiPanelAskeforeActionBox=Ask me before action > +APPEXTSECguiPanelShowRegExesBox=Show full regular expressions > +APPEXTSECguiPanelInverSelection=Invert selection > +APPEXTSECguiPanelMoveRowUp=Move row up > +APPEXTSECguiPanelMoveRowDown=Move row down > +APPEXTSECguiPanelCustomDefs=Custom definitions > +APPEXTSECguiPanelGlobalDefs=Global definitions > +APPEXTSECguiPanelDocTest=Type document base URL > +APPEXTSECguiPanelCodeTest=Type code base URL > +APPEXTSECguiPanelNoMatch=Nothing matched > +APPEXTSECguiPanelMatchingNote=Please note, that only first matched result will be considered as result. > +APPEXTSECguiPanelMatched=Matched > +APPEXTSECguiPanelMatchingError=Error during matching: {0} > +APPEXTSECguiPanelCanNotValidate=Can not validate, can not create tmp file - {0} > +APPEXTSECguiPanelEmptyDoc=All document-bases must be full > +APPEXTSECguiPanelEmptyCode=All code-bases must be full > +APPEXTSECguiPanelTableValid=Table looks valid > +APPEXTSECguiPanelTableInvalid=Invalid with following error: {0} > \ No newline at end of file > diff -r e631770d76ba netx/net/sourceforge/jnlp/util/lockingfile/LockingFile.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/jnlp/util/lockingfile/LockingFile.java Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,156 @@ > +/* > +Copyright (C) 2013 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.util.lockingfile; > + > +import java.nio.channels.FileChannel; > + > +import java.io.RandomAccessFile; > + > +import java.io.File; > +import java.io.IOException; > +import java.nio.channels.FileLock; > +import java.util.Map; > +import java.util.WeakHashMap; > +import java.util.concurrent.locks.ReentrantLock; > + > +/* > + * Process & thread locked access to a file. Creates file if it does not already exist. > + */ > +public class LockingFile { > + > + // The file for access > + private RandomAccessFile randomAccessFile; > + private FileChannel fileChannel; > + private File file; > + > + // A file lock will protect against locks for multiple > + // processes, while a thread lock is still needed within a single JVM. > + > + private FileLock processLock = null; > + private ReentrantLock threadLock = new ReentrantLock(); > + private boolean readOnly; > + > + private LockingFile(File file) { > + this.file = file; > + try{ > + //just try to ctreate > + this.file.createNewFile(); > + }catch(Exception ex){ > + //intentionaly silent > + } > + if (!this.file.isFile() && file.getParentFile()!=null && !file.getParentFile().canWrite() ){ > + readOnly=true; > + } else{ > + this.readOnly = !file.canWrite(); > + if (!readOnly && file.getParentFile()!=null && !file.getParentFile().canWrite()){ > + readOnly=true; > + } > + } > + } > + > + public boolean isReadOnly() { > + return readOnly; > + } > + > + > + > + // Provide shared access to LockedFile's via weak map > + static private final Map instanceCache = new WeakHashMap(); > + > + /** > + * Get a LockingFile for a given File. > + * Ensures that we share the same instance for all threads > + * @param file the file to lock > + * @return a LockingFile instance > + */ > + synchronized public static LockingFile getInstance(File file) { > + if (!instanceCache.containsKey(file)) { > + instanceCache.put(file, new LockingFile(file)); > + } > + > + return instanceCache.get(file); > + } > + > + /** > + * Get the file being locked. > + * > + * @return the file > + */ > + public File getFile() { > + return file; > + } > + > + /** > + * Lock access to the file. Lock is reentrant. > + */ > + public void lock() throws IOException { > + // Create if does not already exist, cannot lock non-existing file > + if (!readOnly){ > + this.file.createNewFile(); > + } > + > + this.threadLock.lock(); > + String rw="rws"; > + if (isReadOnly()){ > + rw="r"; > + } > + if (file.exists()){ > + this.randomAccessFile = new RandomAccessFile(this.file, rw); > + this.fileChannel = randomAccessFile.getChannel(); > + } > + > + if (!isReadOnly()) this.processLock = this.fileChannel.lock(); > + } > + > + /** > + * Unlock access to the file. Lock is reentrant. > + */ > + public void unlock() throws IOException { > + boolean releaseProcessLock = (this.threadLock.getHoldCount() == 1); > + try { > + if (releaseProcessLock && this.processLock != null) { > + this.processLock.release(); > + this.randomAccessFile.close(); > + this.fileChannel.close(); > + } > + } finally { > + this.processLock = null; > + } > + this.threadLock.unlock(); > + } > +} > \ No newline at end of file > diff -r e631770d76ba netx/net/sourceforge/jnlp/util/lockingfile/LockingReaderWriter.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/jnlp/util/lockingfile/LockingReaderWriter.java Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,201 @@ > +/* > +Copyright (C) 2013 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.util.lockingfile; > + > +import java.io.BufferedWriter; > + > +import java.io.BufferedReader; > +import java.io.File; > +import java.io.FileInputStream; > +import java.io.FileOutputStream; > +import java.io.IOException; > +import java.io.InputStreamReader; > +import java.io.OutputStreamWriter; > + > +/** > + * Process-locked string storage backed by a file. > + * Each string is stored on its own line. > + * Any new-lines must be encoded somehow if they are to be stored. > + */ > +public abstract class LockingReaderWriter { > + > + private LockingFile lockedFile; > + > + /** > + * Create locking file-backed storage. > + * @param file the storage file > + */ > + public LockingReaderWriter(File file) { > + this.lockedFile = LockingFile.getInstance(file); > + } > + > + /** > + * Get the underlying file. > + * Any access to this file should use lock() & unlock(). > + * > + * @return the file > + */ > + public File getBackingFile() { > + return this.lockedFile.getFile(); > + } > + > + public boolean isReadOnly() { > + return this.lockedFile.isReadOnly(); > + } > + > + /** > + * Lock the underlying storage. Lock is reentrant. > + */ > + public void lock() { > + try { > + lockedFile.lock(); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } > + } > + > + /** > + * Unlock the underlying storage. Lock is reentrant. > + */ > + public void unlock() { > + try { > + lockedFile.unlock(); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } > + } > + > + /** > + * Writes stored contents to file. Assumes lock is held. > + * @throws IOException > + */ > + protected void writeContents() throws IOException { > + if (!getBackingFile().isFile()){ > + return; > + } > + if (isReadOnly()){ > + return; > + } > + BufferedWriter writer = null; > + try { > + writer = new BufferedWriter(new OutputStreamWriter( > + new FileOutputStream(getBackingFile()), "UTF-8")); > + writeContent(writer); > + writer.flush(); > + } finally { > + if (writer != null) { > + writer.close(); > + } > + } > + } > + > + protected abstract void writeContent(BufferedWriter writer) throws IOException; > + > + /** > + * Reads contents from file. Assumes lock is held. > + * @throws IOException > + */ > + protected void readContents() throws IOException { > + if (!getBackingFile().isFile()){ > + return; > + } > + BufferedReader reader = null; > + try { > + reader = new BufferedReader(new InputStreamReader( > + new FileInputStream(getBackingFile()), "UTF-8")); > + > + while (true) { > + String line = reader.readLine(); > + if (line == null) { > + break; > + } > + readLine(line); > + } > + } finally { > + if (reader != null) { > + reader.close(); > + } > + } > + } > + > + /** > + * Reads contents from file. creating is lock . I have already proofread this ! 'Reads contents from the file, first acquring a lock.' > + * @throws IOException > + */ > + protected synchronized void readContentsLocked() throws IOException { > + doLocked(new Runnable() { > + > + @Override > + public void run() { > + try { > + readContents(); > + } catch (IOException ex) { > + throw new StorageIoException(ex); > + } > + } > + }); > + } > + > + /** > + * Reads contents from file. creating is lock . 'Write contents to the file, first acquring a lock.' > + * @throws IOException > + */ > + protected synchronized void writeContentsLocked() throws IOException { > + doLocked(new Runnable() { > + > + public void run() { > + try { > + writeContents(); > + } catch (IOException ex) { > + throw new StorageIoException(ex); > + } > + } > + }); > + > + } > + > + protected void doLocked(Runnable r) { > + lock(); > + try { > + r.run(); > + } finally { > + unlock(); > + } > + } > + > + protected abstract void readLine(String line); > +} > diff -r e631770d76ba netx/net/sourceforge/jnlp/util/lockingfile/StorageIoException.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/jnlp/util/lockingfile/StorageIoException.java Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,22 @@ > +package net.sourceforge.jnlp.util.lockingfile; > + > +/** > + * Thrown when an exception occurs using the storage (namely IOException) > + */ > +public class StorageIoException extends RuntimeException { > + > + LockingReaderWriter outer; > + > + public StorageIoException(Exception e) { > + super(e); > + } > + > + public StorageIoException(String e) { > + super(e); > + } > + > + public StorageIoException(Exception e, LockingReaderWriter outer) { > + super(e); > + this.outer = outer; > + } > +} > diff -r e631770d76ba tests/netx/unit/net/sourceforge/appletextendedsecurity/impl/UnsignedAppletActionStorageImplTest.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/tests/netx/unit/net/sourceforge/appletextendedsecurity/impl/UnsignedAppletActionStorageImplTest.java Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,97 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ > + > +package net.sourceforge.appletextendedsecurity.impl; > + > +import net.sourceforge.appletextendedsecurity.UnsignedAppletActionEntry; > +import java.io.File; > +import java.io.IOException; > +import java.util.Arrays; > +import net.sourceforge.jnlp.ServerAccess; > +import org.junit.Assert; > +import org.junit.BeforeClass; > +import org.junit.Test; > + > +public class UnsignedAppletActionStorageImplTest { > + > + private static File f1; > + private static File f2; > + private static File f3; > + private static File f4; > + > + @BeforeClass > + public static void preapreTestFiles() throws IOException { > + f1 = File.createTempFile("itwMatching", "testFile1"); > + f2 = File.createTempFile("itwMatching", "testFile2"); > + f3 = File.createTempFile("itwMatching", "testFile3"); > + f4 = File.createTempFile("itwMatching", "testFile4"); > + ServerAccess.saveFile("A 123456 .* .* main jar1;jar2", f1); > + ServerAccess.saveFile("A 123456 .* \\Qbla\\E main jar1;jar2", f2); > + } > + > + @Test > + public void allMatchingDocAndCode() { > + UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(f1); > + UnsignedAppletActionEntry r1 = i1.getMatchingItem("bla", "blaBla", "main", Arrays.asList(new String[]{"jar1", "jar2"})); > + Assert.assertNotNull("r1 should be found", r1); > + UnsignedAppletActionEntry r3 = i1.getMatchingItem("blah", "blaBla", "main", Arrays.asList(new String[]{"jar2", "jar1"})); > + Assert.assertNotNull("r3 should be found", r1); > + UnsignedAppletActionEntry r2 = i1.getMatchingItem("bla", "blaBlam", "wrong_main", Arrays.asList(new String[]{"jar1", "jar2"})); > + Assert.assertNull("r2 should NOT be found", r2); > + UnsignedAppletActionEntry r4 = i1.getMatchingItem("blha", "blaBlam", "main", Arrays.asList(new String[]{"jar2", "wrong_jar"})); > + Assert.assertNull("r4 should NOT be found", r4); > + UnsignedAppletActionEntry r5 = i1.getMatchingItem("blaBla", "blaBlaBla", "main", Arrays.asList(new String[]{"jar2"})); > + Assert.assertNull("r5 should NOT be found", r5); > + > + } > + > + @Test > + public void allMatchingDocAndStrictCode() { > + UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(f2); > + UnsignedAppletActionEntry r1 = i1.getMatchingItem("whatever", "bla", "main", Arrays.asList(new String[]{"jar1", "jar2"})); > + Assert.assertNotNull("r1 should be found", r1); > + UnsignedAppletActionEntry r3 = i1.getMatchingItem("whatever", null, "main", Arrays.asList(new String[]{"jar2", "jar1"})); > + Assert.assertNotNull("r3 should be found", r1); > + UnsignedAppletActionEntry r2 = i1.getMatchingItem("bla", "blaBlam", "main", Arrays.asList(new String[]{"jar1", "jar2"})); > + Assert.assertNull("r2 should NOT be found", r2); > + UnsignedAppletActionEntry r4 = i1.getMatchingItem(null, "blaBlam", null, null); > + Assert.assertNull("r4 should NOT be found", r4); > + > + } > + > + @Test > + public void allMatchingDocAndCodeWithNulls() { > + UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(f1); > + UnsignedAppletActionEntry r1 = i1.getMatchingItem("bla", "blaBla", null, null); > + Assert.assertNotNull("r1 should be found", r1); > + UnsignedAppletActionEntry r3 = i1.getMatchingItem("bla", "whatever", "", null); > + Assert.assertNotNull("r3 should be found", r1); > + UnsignedAppletActionEntry r2 = i1.getMatchingItem("bla", "blaBla", null, Arrays.asList(new String[]{"jar2", "jar1"})); > + Assert.assertNotNull("r2 should be found", r2); > + UnsignedAppletActionEntry r4 = i1.getMatchingItem("bla", "blaBla", "main", null); > + Assert.assertNotNull("r4 should be found", r4); > + UnsignedAppletActionEntry r5 = i1.getMatchingItem("", "blaBla", "main", Arrays.asList(new String[]{"jar2", "jar1"})); > + Assert.assertNotNull("r5 should be found", r5); > + UnsignedAppletActionEntry r6 = i1.getMatchingItem(null, null, "main", Arrays.asList(new String[]{"jar2", "jar1"})); > + Assert.assertNotNull("r6 should be found", r6); > + UnsignedAppletActionEntry r7 = i1.getMatchingItem(null, null, "main", Arrays.asList(new String[]{"jar2", "jar11"})); > + Assert.assertNull("r7 should NOT be found", r7); > + > + > + } > +} > diff -r e631770d76ba tests/netx/unit/net/sourceforge/jnlp/util/lockingfile/LockingStringListStorageTest.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/tests/netx/unit/net/sourceforge/jnlp/util/lockingfile/LockingStringListStorageTest.java Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,385 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ > + > +package net.sourceforge.jnlp.util.lockingfile; > + > +import static org.junit.Assert.assertFalse; > +import static org.junit.Assert.assertTrue; > +import org.junit.Before; > +import java.io.BufferedWriter; > +import java.io.File; > +import java.io.IOException; > +import java.util.ArrayList; > +import java.util.List; > +import org.junit.Assert; > +import org.junit.Test; > + > + > + > +public class LockingStringListStorageTest { > + > +/** > + * Process-locked string storage backed by a file. > + * Each string is stored on its own line. > + * Any new-lines must be encoded somehow if they are to be stored. > + */ > +public static class LockingStringListStorage extends LockingReaderWriter { > + > + private List cachedContents = new ArrayList(); > + > + //To sutisfy testengine, void constructor and dummy testmethod > + public LockingStringListStorage() throws IOException { > + this(createTmpBackend()); > + } > + > + @Test > + public void lockingStringListStorageCanBeInstantiated(){ > + Assert.assertNotNull(this); > + } > + > + > + private static File createTmpBackend() throws IOException{ > + File f = File.createTempFile("forTests","emptyConstructor"); > + f.deleteOnExit(); > + return f; > + } > + > + > + /** > + * Create locking file-backed storage. > + * @param file the storage file > + */ > + public LockingStringListStorage(File file) { > + super(file); > + } > + > + /** > + * Get the underlying string list cache. Should lock > + * before using. > + * @return the cache > + */ > + final protected List getCachedContents() { > + return cachedContents; > + } > + > + @Override > + public void writeContent(BufferedWriter writer) throws IOException { > + for (String string : cachedContents) { > + writer.write(string); > + writer.newLine(); > + } > + } > + > + @Override > + protected void readLine(String line) { > + this.cachedContents.add(line); > + } > + > + @Override > + protected void readContents() throws IOException { > + cachedContents.clear(); > + super.readContents(); > + } > + > + /* > + * Atomic container abstraction methods. These all allow the file-backed > + * string list to be treated as a convenient in-memory object. > + */ > + /** > + * Appends the specified line to the end of the storage. > + * > + * @param line the line to add > + */ > + synchronized public void add(final String line) { > + doLocked(new Runnable() { > + > + public void run() { > + try { > + readContents(); > + cachedContents.add(line); > + writeContents(); > + } catch (IOException ex) { > + throw new StorageIoException(ex); > + } > + } > + }); > + } > + > + /** > + * Returns an array containing all of the lines in the storage. > + * > + * @return an array of the stored strings > + */ > + synchronized public String[] toArray() { > + lock(); > + try { > + readContents(); > + return cachedContents.toArray(new String[]{}); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } finally { > + unlock(); > + } > + } > + > + /** > + * Returns amount of lines in the storage. > + * > + * @return amount of stored strings > + */ > + synchronized public int size() { > + lock(); > + try { > + readContents(); > + return cachedContents.size(); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } finally { > + unlock(); > + } > + } > + > + /** > + * Returns 'i'th line > + * > + * @return the line > + */ > + synchronized public String get(int i) { > + lock(); > + try { > + readContents(); > + return cachedContents.get(i); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } finally { > + unlock(); > + } > + } > + > + /** > + * Set the 'i'th line > + * > + * @param line the new line > + */ > + synchronized public String set(int i, String line) { > + lock(); > + try { > + readContents(); > + return cachedContents.set(i, line); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } finally { > + unlock(); > + } > + } > + > + /** > + * Returns a copied list containing all of the lines in the storage. > + * > + * @return a list of the stored strings > + */ > + synchronized public List toList() { > + lock(); > + try { > + readContents(); > + return new ArrayList(cachedContents); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } finally { > + unlock(); > + } > + } > + > + /** > + * Returns true if the storage contains the specified element. > + * > + * @param line > + * @return true if the storage contains the line > + */ > + synchronized public boolean contains(String line) { > + lock(); > + try { > + readContents(); > + return cachedContents.contains(line); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } finally { > + unlock(); > + } > + } > + > + /** > + * Empty the storage. > + */ > + synchronized public void clear() { > + lock(); > + try { > + cachedContents.clear(); > + writeContents(); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } finally { > + unlock(); > + } > + } > + > + /** > + * Removes the first occurrence of the specified element from this list, > + * if it is present (optional operation). If this list does not contain > + * the element, it is unchanged. > + * > + * @param line string to be removed from this list, if present > + * @return true if the storage contained the line > + */ > + synchronized public boolean remove(String line) { > + boolean didRemove; > + > + lock(); > + try { > + readContents(); > + didRemove = cachedContents.remove(line); > + writeContents(); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } finally { > + unlock(); > + } > + > + return didRemove; > + } > +} > + > + > + private static File storagefile; > + > + private static LockingStringListStorage newInstance() { > + return new LockingStringListStorage(storagefile); > + } > + > + @Before > + public void setUp() throws IOException { > + storagefile = File.createTempFile("foo", "bar"); > + } > + > + @Test > + public void testSimpleActions() throws IOException { > + LockingStringListStorage storage = newInstance(); > + > + storage.add("teststring"); > + assertTrue(storage.contains("teststring")); > + storage.remove("teststring"); > + assertFalse(storage.contains("teststring")); > + } > + > + @Test > + public void testInterleavedActions() throws IOException { > + LockingStringListStorage storage1 = newInstance(); > + LockingStringListStorage storage2 = newInstance(); > + > + storage1.add("teststring"); > + assertTrue(storage2.contains("teststring")); > + storage2.remove("teststring"); > + assertFalse(storage1.contains("teststring")); > + } > + > + static class TestThread extends Thread { > + String testString; > + int iterations; > + Throwable error = null; > + > + TestThread(String testString, int iterations) { > + this.testString = testString; > + this.iterations = iterations; > + } > + > + @Override > + public void run() { > + try { > + LockingStringListStorage storage = newInstance(); > + for (int i = 0; i < iterations; i++) { > + assertTrue(storage.contains(this.testString)); > + storage.add(this.testString); > + storage.remove(this.testString); > + assertTrue(storage.contains(this.testString)); > + } > + } catch (Throwable error) { > + error.printStackTrace(); > + this.error = error; > + } > + } > + } > + > + private void concurrentReadWrites(int threadAmount, int iterations, > + String testString) throws InterruptedException { > + LockingStringListStorage storage = newInstance(); > + > + storage.add(testString); > + > + List testThreads = new ArrayList(); > + > + for (int i = 0; i < threadAmount; i++) { > + TestThread thread = new TestThread(testString, iterations); > + testThreads.add(thread); > + thread.start(); > + } > + > + for (int i = 0; i < threadAmount; i++) { > + testThreads.get(i).join(); > + } > + > + assertTrue(storage.contains(testString)); > + storage.remove(testString); > + > + // So long as number adds == number writes, we should be left with > + // nothing at end. > + assertFalse(storage.contains(testString)); > + } > + > + // Long testing string, the contents are not important > + private String makeLongTestString() { > + StringBuilder sb = new StringBuilder(); > + for (int i = 0; i < 1000; i++) { > + sb.append(Integer.toString(i)); > + } > + return sb.toString(); > + } > + > + @Test > + public void testManyReadWrite() throws Exception { > + int oneThread = 1; > + String shortString = "teststring"; > + > + // This was causing 'too many open files' because FileUtils#getFileLock > + // leaks file descriptors. No longer used. > + concurrentReadWrites(oneThread, 500 /* iterations */, > + shortString); > + } > + > + @Test > + public void testManyThreads() throws Exception { > + int threadAmount = 25; > + String shortString = "teststring"; > + String longString = makeLongTestString(); > + > + concurrentReadWrites(threadAmount, 10 /* per-thread iterations */, > + shortString); > + concurrentReadWrites(threadAmount, 2 /* per-thread iterations */, > + longString); > + } > + > +} Happy hacking, -Adam From adomurad at redhat.com Tue Feb 5 07:43:56 2013 From: adomurad at redhat.com (Adam Domurad) Date: Tue, 05 Feb 2013 10:43:56 -0500 Subject: [fyi] [icedtea-web] enhanced locales tests for upcoming DE translation In-Reply-To: <5110F832.50807@redhat.com> References: <5110F832.50807@redhat.com> Message-ID: <511128BC.1060406@redhat.com> On 02/05/2013 07:16 AM, Jiri Vanek wrote: > Hi! > > I have enhanced our testsuite for localisation. The changes are little > bit greater because I have to handle tests for "any German" and for > "specific German" > > > This should be pushed together with locales from Jacob. > > J. > diff -r fd01cd1c2bbc > tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java > --- > a/tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java > Tue Feb 05 09:51:44 2013 +0100 > +++ > b/tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java > Tue Feb 05 12:49:32 2013 +0100 > @@ -36,6 +36,7 @@ > package net.sourceforge.jnlp.resources; > > import java.util.ArrayList; > +import java.util.Arrays; > import java.util.Enumeration; > import java.util.List; > import java.util.Locale; > @@ -49,61 +50,128 @@ > > public class MessagesPropertiesTest { > > - public static final String mainFile = "Messages"; > - public static final String[] secondaryCountries = new String[]{"cs"}; > - public static final String[] secondaryLanguages = new String[]{"CZ"}; > - public static ResourceBundle main; > - public static ResourceBundle[] secondary = new > ResourceBundle[secondaryCountries.length]; > + private final static class LocalesIdentifier { > + > + public static final LocalesIdentifier DEFAULT = new > LocalesIdentifier("",""); > + public static final LocalesIdentifier CZ_CS = new > LocalesIdentifier("CZ","cs"); > + public static final LocalesIdentifier DE = new > LocalesIdentifier("de"); > + public static final LocalesIdentifier DE_DE = new > LocalesIdentifier("DE","de"); > + > + public static final String mainFileName = "Messages"; > + public static final String pckg = > "net.sourceforge.jnlp.resources"; > + private final String country; > + private final String language; > + private final Locale locale; > + private final ResourceBundle bundle; > + > + public LocalesIdentifier(String country, String language) { > + this.country = country; > + this.language = language; > + if (getCountry().equals("") && getLanguage().equals("")){ > + locale = new Locale("fdbgvfdbg", "ftgjhuj"); > + } else { > + //get default by non existing language and country > + locale = new Locale(language, country); > + } > + bundle = ResourceBundle.getBundle(pckg+"." + > mainFileName, locale); > + } > + > + public LocalesIdentifier(String language) { > + this.country = null; > + this.language = language; > + locale = new Locale(language); > + bundle = ResourceBundle.getBundle(pckg+"." + > mainFileName, locale); > + } > + > + public String getCountry() { > + if (country == null) { > + return ""; > + } > + return country.trim(); > + } > + > + public String getLanguage() { > + if (language == null) { > + return ""; > + } > + return language.trim(); > + } > + > + public ResourceBundle getBundle() { > + return bundle; > + } > + > + public Locale getLocale() { > + return locale; > + } > + > + > + > + public String getId() { > + if (getLanguage().equals("")) { > + return getCountry(); > + } > + if (getCountry().equals("")) { > + return getLanguage(); > + } > + return getLanguage() + "_" + getCountry(); > + } > + > + public String getIdentifier() { > + if (getId().equals("")) { > + return "default"; > + } > + return getId(); > + } > + > + > + > + > + } > + > + public static LocalesIdentifier main; > + public static LocalesIdentifier[] secondary; > > @BeforeClass > public static void loadResourceBoundels() { > - assertTrue("length of countries and languages must be same", > secondaryCountries.length == secondaryLanguages.length); > //get default by non existing language and country > - main = > ResourceBundle.getBundle("net.sourceforge.jnlp.resources." + mainFile, > new Locale("dfgdfg", "gvff")); > - secondary = new ResourceBundle[secondaryCountries.length]; > + main = LocalesIdentifier.DEFAULT; > assertNotNull(main); > - for (int i = 0; i < secondaryCountries.length; i++) { > - String country = secondaryCountries[i]; > - String language = secondaryLanguages[i]; > - secondary[i] = > ResourceBundle.getBundle("net.sourceforge.jnlp.resources." + mainFile, > new Locale(country, language)); > + secondary= new LocalesIdentifier[] > {LocalesIdentifier.CZ_CS,LocalesIdentifier.DE,LocalesIdentifier.DE_DE}; > + assertNotNull(secondary); > + for (int i = 0; i < secondary.length; i++) { > assertNotNull(secondary[i]); > + > } > } > > @Test > public void allResourcesAreReallyDifferent() { > - List ids = new ArrayList(secondary.length + 1); > - ids.add("default"); > - List bundles = new > ArrayList(secondary.length + 1); > + List bundles = new > ArrayList(secondary.length + 1); > bundles.add(main); > int errors = 0; > - for (int i = 0; i < secondaryCountries.length; i++) { > - String country = secondaryCountries[i]; > - String language = secondaryLanguages[i]; > - ids.add(country + "_" + language); > - bundles.add(secondary[i]); > - > - } > + bundles.addAll(Arrays.asList(secondary)); > for (int i = 0; i < bundles.size(); i++) { > - ResourceBundle resourceBundle1 = bundles.get(i); > - String id1 = ids.get(i); > - Enumeration keys1 = resourceBundle1.getKeys(); > + LocalesIdentifier resourceBundle1 = bundles.get(i); > + Enumeration keys1 = > resourceBundle1.getBundle().getKeys(); > for (int j = 0; j < bundles.size(); j++) { > - if (i == j) { > + LocalesIdentifier resourceBundle2 = bundles.get(j); > + if > (resourceBundle1.getLanguage().equals(resourceBundle2.getLanguage())) { > + //do not compare same language groups > + allLog("Skipping same language " + > resourceBundle1.getLocale() + " x " + resourceBundle2.getLocale() + " > (should be " + resourceBundle1.getIdentifier() + " x " + > resourceBundle2.getIdentifier() + ")"); > break; > } > - ResourceBundle resourceBundle2 = bundles.get(j); > - String id2 = ids.get(j); > - outLog("Checking for same items between " + > resourceBundle1.getLocale() + " x " + resourceBundle2.getLocale() + " > (should be " + id1 + " x " + id2 + ")"); > - errLog("Checking for same items between " + > resourceBundle1.getLocale() + " x " + resourceBundle2.getLocale() + " > (should be " + id1 + " x " + id2 + ")"); > + allLog("Checking for same items between " + > resourceBundle1.getLocale() + " x " + resourceBundle2.getLocale() + " > (should be " + resourceBundle1.getIdentifier() + " x " + > resourceBundle2.getIdentifier() + ")"); > int localErrors=0; > while (keys1.hasMoreElements()) { > String key = (String) keys1.nextElement(); > - String val1 = > getMissingResourceAsEmpty(resourceBundle1, key); > - String val2 = > getMissingResourceAsEmpty(resourceBundle2, key); > + String val1 = > getMissingResourceAsEmpty(resourceBundle1.getBundle(), key); > + String val2 = > getMissingResourceAsEmpty(resourceBundle2.getBundle(), key); > outLog("\""+val1+"\" x \""+val2); > if (val1.trim().equalsIgnoreCase(val2.trim())) { > - if (val1.trim().length() <= 5 /*"ok", "", > ...*/ || val1.toLowerCase().contains("://") /*urls...*/) { > + if (val1.trim().length() <= 5 /* short words > like"ok", "", ...*/ > + || val1.toLowerCase().contains("://") > /*urls...*/ > + || !val1.trim().contains(" ") /*one > word*/) { > errLog("Warning! Items equals for: " + > key + " = " + val1 + " but are in allowed subset"); > } else { > errors++; > @@ -112,7 +180,7 @@ > } > } > } > - errLog(localErrors+" errors > allResourcesAreReallyDifferent fo "+id2+" x "+id1); > + errLog(localErrors+" errors > allResourcesAreReallyDifferent fo "+resourceBundle1.getIdentifier()+" > x "+resourceBundle2.getIdentifier()); > > } > } > @@ -129,20 +197,18 @@ > > @Test > //it is not critical that some localisations are missing, however > good to know > + //and actually this test sis covered by > allResourcesAreReallyDifferent, because fallback is geting default > value for unknnow localisation > public void warnForNotLocalisedStrings() { > int errors = 0; > - Enumeration keys = main.getKeys(); > + Enumeration keys = main.getBundle().getKeys(); > for (int i = 0; i < secondary.length; i++) { > int localErrors = 0; > - ResourceBundle sec = secondary[i]; > - String country = secondaryCountries[i]; > - String language = secondaryLanguages[i]; > - String id = country + "_" + language; > - outLog("Checking for missing strings in " + > sec.getLocale() + " (should be " + id + ") compared with default"); > - errLog("Checking for missing strings in " + > sec.getLocale() + " (should be " + id + ") compared with default"); > + ResourceBundle sec = secondary[i].getBundle(); > + String id = secondary[i].getIdentifier(); > + allLog("Checking for missing strings in " + > sec.getLocale() + " (should be " + id + ") compared with default"); > while (keys.hasMoreElements()) { > String key = (String) keys.nextElement(); > - String val1 = getMissingResourceAsEmpty(main, key); > + String val1 = > getMissingResourceAsEmpty(main.getBundle(), key); > String val2 = getMissingResourceAsEmpty(sec, key); > outLog("\""+val1+"\" x \""+val2); > if (val1.trim().isEmpty()) { > @@ -165,24 +231,15 @@ > > @Test > public void noEmptyResources() { > - List ids = new ArrayList(secondary.length + 1); > - ids.add("default"); > - List bundles = new > ArrayList(secondary.length + 1); > + List bundles = new > ArrayList(secondary.length + 1); > bundles.add(main); > int errors = 0; > - for (int i = 0; i < secondaryCountries.length; i++) { > - String country = secondaryCountries[i]; > - String language = secondaryLanguages[i]; > - ids.add(country + "_" + language); > - bundles.add(secondary[i]); > - > - } > + bundles.addAll(Arrays.asList(secondary)); > for (int i = 0; i < bundles.size(); i++) { > - ResourceBundle resourceBundle = bundles.get(i); > - String id = ids.get(i); > + ResourceBundle resourceBundle = bundles.get(i).getBundle(); > + String id = bundles.get(i).getIdentifier(); > Enumeration keys = resourceBundle.getKeys(); > - outLog("Checking for empty items in " + > resourceBundle.getLocale() + " (should be " + id + ")"); > - errLog("Checking for empty items in " + > resourceBundle.getLocale() + " (should be " + id + ")"); > + allLog("Checking for empty items in " + > resourceBundle.getLocale() + " (should be " + id + ")"); > int localErrors=0; > while (keys.hasMoreElements()) { > String key = (String) keys.nextElement(); > @@ -207,16 +264,14 @@ > int errors = 0; > for (int i = 0; i < secondary.length; i++) { > int localErrors = 0; > - ResourceBundle sec = secondary[i]; > + ResourceBundle sec = secondary[i].getBundle(); > Enumeration keys = sec.getKeys(); > - String country = secondaryCountries[i]; > - String language = secondaryLanguages[i]; > - String id = country + "_" + language; > + String id = secondary[i].getId(); > outLog("Checking for redundant keys in " + > sec.getLocale() + " (should be " + id + ") compared with default"); > errLog("Checking for redundant keys in " + > sec.getLocale() + " (should be " + id + ") compared with default"); > while (keys.hasMoreElements()) { > String key = (String) keys.nextElement(); > - String val2 = getMissingResourceAsEmpty(main, key); > + String val2 = > getMissingResourceAsEmpty(main.getBundle(), key); > String val1 = getMissingResourceAsEmpty(sec, key); > outLog("\""+val1+"\" x \""+val2); > if (val2.trim().isEmpty() && !val1.trim().isEmpty()){ > @@ -234,7 +289,13 @@ > > > > + private void allLog(String string) { > + outLog(string); > + errLog(string); > + } > private void errLog(String string) { > + //used quite often :) > + //System.out.println(string); > ServerAccess.logErrorReprint(string); > } > > diff -r fd01cd1c2bbc > tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java > --- > a/tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java > Tue Feb 05 09:51:44 2013 +0100 > +++ > b/tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java > Tue Feb 05 12:49:32 2013 +0100 > @@ -110,6 +110,13 @@ > return l; > } > > + private ResourceBundle getPropertiesDe() throws IOException { > + return getProperties("_de"); > + } > + > + private ResourceBundle getPropertiesDeDe() throws IOException { > + return getProperties("_de_DE"); > + } > public ResourceBundle getPropertiesCz() throws IOException { > return getProperties("_cs_CZ"); > > @@ -132,7 +139,9 @@ > String[] l = getChangeLocalesForSubproces("en_US.UTF-8"); > ProcessResult pr = ServerAccess.executeProcess(javaws, null, > null, l); > assertEnglish(pr.stdout); > - assertNotCzh(pr.stdout); > + assertNotCz(pr.stdout); > + assertNotDeDe(pr.stdout); > + assertNotDe(pr.stdout); > } > > @Test > @@ -140,8 +149,10 @@ > String[] l = getChangeLocalesForSubproces("cs_CZ"); > ProcessResult pr = ServerAccess.executeProcess(javaws, null, > null, l); > assertNotEnglish(pr.stdout); > - assertNotCzh(pr.stdout); > - iteratePropertiesForAproxCz(pr.stdout); > + assertNotCz(pr.stdout); > + assertNotDeDe(pr.stdout); > + assertNotDe(pr.stdout); > + iteratePropertiesForAproxCzCs(pr.stdout); > } > > @Test > @@ -149,16 +160,73 @@ > String[] l = getChangeLocalesForSubproces("cs_CZ.UTF-8"); > ProcessResult pr = ServerAccess.executeProcess(javaws, null, > null, l); > assertNotEnglish(pr.stdout); > + assertNotDeDe(pr.stdout); > + assertNotDe(pr.stdout); > assertCz(pr.stdout); > - iteratePropertiesForAproxCz(pr.stdout); > + iteratePropertiesForAproxCzCs(pr.stdout); > + } > + > + @Test > + public void testLocalesDeDe() throws Exception { > + String[] l = getChangeLocalesForSubproces("de_DE"); > + ProcessResult pr = ServerAccess.executeProcess(javaws, null, > null, l); > + assertNotEnglish(pr.stdout); > + assertNotCz(pr.stdout); > + iteratePropertiesForAproxDeDe(pr.stdout); > } > > @Test > + public void testLocalesDeDeUtf() throws Exception { > + String[] l = getChangeLocalesForSubproces("de_DE.UTF-8"); > + ProcessResult pr = ServerAccess.executeProcess(javaws, null, > null, l); > + assertNotEnglish(pr.stdout); > + assertNotCz(pr.stdout); > + assertDeDe(pr.stdout); > + iteratePropertiesForAproxDeDe(pr.stdout); > + } > + > + > + @Test > + public void testLocalesDe_unknowButValidDeLocale() throws Exception { > + String[] l = getChangeLocalesForSubproces("de_LU"); > + ProcessResult pr = ServerAccess.executeProcess(javaws, null, > null, l); > + assertNotEnglish(pr.stdout); > + assertNotCz(pr.stdout); > + iteratePropertiesForAproxDe(pr.stdout); > + } > + > + @Test > + public void testLocalesDeUtf_unknowButValidDeLocale() throws > Exception { > + String[] l = getChangeLocalesForSubproces("de_LU.UTF-8"); > + ProcessResult pr = ServerAccess.executeProcess(javaws, null, > null, l); > + assertNotEnglish(pr.stdout); > + assertNotCz(pr.stdout); > + assertDe(pr.stdout); > + iteratePropertiesForAproxDe(pr.stdout); > + } > + > + > + > + @Test > + public void testLocalesDe_globalDe() throws Exception { > + String[] l = getChangeLocalesForSubproces("deutsch"); > + ProcessResult pr = ServerAccess.executeProcess(javaws, null, > null, l); > + assertNotEnglish(pr.stdout); > + assertNotCz(pr.stdout); > + iteratePropertiesForAproxDe(pr.stdout); > + } > + > + > + > + > + @Test > public void testLocalesInvalid() throws Exception { > String[] l = getChangeLocalesForSubproces("ax_BU"); > ProcessResult pr = ServerAccess.executeProcess(javaws, null, > null, l); > assertEnglish(pr.stdout); > - assertNotCzh(pr.stdout); > + assertNotCz(pr.stdout); > + assertNotDeDe(pr.stdout); > + assertNotDe(pr.stdout); > } > > private void assertEnglish(String s) throws IOException { > @@ -175,11 +243,29 @@ > ResourceBundle props = getPropertiesCz(); > iteratePropertiesFor(props, s, true, "czech"); > } > + > + private void assertDe(String s) throws IOException { > + ResourceBundle props = getPropertiesDe(); > + iteratePropertiesFor(props, s, true, "de"); > + } > + private void assertDeDe(String s) throws IOException { > + ResourceBundle props = getPropertiesDeDe(); > + iteratePropertiesFor(props, s, true, "de_de"); > + } > > - private void assertNotCzh(String s) throws IOException { > + private void assertNotCz(String s) throws IOException { > ResourceBundle props = getPropertiesCz(); > iteratePropertiesFor(props, s, false, "czech"); > } > + > + private void assertNotDe(String s) throws IOException { > + ResourceBundle props = getPropertiesDe(); > + iteratePropertiesFor(props, s, false, "de"); > + } > + private void assertNotDeDe(String s) throws IOException { > + ResourceBundle props = getPropertiesDeDe(); > + iteratePropertiesFor(props, s, false, "de_de"); > + } > > /** > * This method is iterating all keys defined in this class, > geting their value in given > @@ -216,10 +302,11 @@ > * given output match/matchnot (depends on value of assertTrue) > this string, > * > * @param outputToBeChecked > + * @param props bundle with strings > + * @param reg regexter with rules how to handle national characters > * @throws IOException > */ > - private void iteratePropertiesForAproxCz(String > outputToBeChecked) throws IOException { > - ResourceBundle props = getPropertiesCz(); > + private void iteratePropertiesForAprox(String outputToBeChecked, > ResourceBundle props, Regexer reg) throws IOException { > int keysFound = 0; > for (int i = 0; i < keys.length; i++) { > String string = keys[i]; > @@ -227,55 +314,95 @@ > if (value == null) { > continue; > } > - value = regexIt(value); > + value = reg.regexIt(value); > keysFound++; > { > - Assert.assertTrue("Output must match cz text, failed > on " + string, outputToBeChecked.matches(value)); > + Assert.assertTrue("Output must match "+reg.getId() +" > text, failed on " + string, outputToBeChecked.matches(value)); > } > } > Assert.assertTrue("At least one key must be found, was not", > keysFound > 0); > } > - String[] czEvil = { > - "?", > - "?", > - "?", > - "?", > - "?", > - "?", > - "?", > - "?", > - "?", > - "?", > - "?", > - "?", > - "?", > - "?", > - "?", > - "[", > - "]", > - "(", > - ")"}; > > - /** > - * This method transforms given string to asci-only regex, > replacing groups of > - * czech characters (defined by czEvil variable) by .+ > - * > - * @param value > - * @return > - */ > - private String regexIt(String value) { > - return regexIt(value, czEvil); > + private void iteratePropertiesForAproxCzCs(String stdout) throws > IOException { > + iteratePropertiesForAprox(stdout, getPropertiesCz(), Regexer.cz); > + } > + private void iteratePropertiesForAproxDe(String stdout) throws > IOException { > + iteratePropertiesForAprox(stdout, getPropertiesDe(), Regexer.de); > + } > + > + private void iteratePropertiesForAproxDeDe(String stdout) > throws IOException { > + iteratePropertiesForAprox(stdout, getPropertiesDeDe(), > Regexer.de); > } > > - private static String regexIt(String value, String[] map) { > - for (int i = 0; i < map.length; i++) { > - String string = map[i]; > - value = value.replace(string, "."); > - value = value.replace(string.toUpperCase(), "."); > + > + > + private static final class Regexer { > + > + private static final String[] czEvil = { > + "?", > + "?", > + "?", > + "?", > + "?", > + "?", > + "?", > + "?", > + "?", > + "?", > + "?", > + "?", > + "?", > + "?", > + "?", > + "[", > + "]", > + "(", > + ")"}; > + private static final String[] deEvil = { > + "?", > + "?", > + "?", > + "?", > + "[", > + "]", > + "(", > + ")"}; I notice a pattern in your naming :-) > + > + private static final Regexer cz = new Regexer(czEvil,"cz"); > + private static final Regexer de = new Regexer(deEvil,"de"); > + > + private final String[] map; > + private final String id; > + > + public Regexer(String[] map, String id) { > + this.map = map; > + this.id = id; > } > > - value = value.replaceAll("\\.+", ".+"); > - value = "(?s).*" + value + ".*"; > - return value; > + public String getId() { > + return id; > + } > + > + > + > + > + /** > + * This method transforms given string to asci-only regex, > replacing > + * groups of national characters (defined by array variable) > by .+ > + * > + * @param value > + * @return > + */ > + public String regexIt(String value) { > + for (int i = 0; i < map.length; i++) { > + String string = map[i]; > + value = value.replace(string, "."); > + value = value.replace(string.toUpperCase(), "."); > + } > + > + value = value.replaceAll("\\.+", ".+"); > + value = "(?s).*" + value + ".*"; > + return value; > + } > } > } Looks fine overall. -Adam From adomurad at redhat.com Tue Feb 5 07:46:47 2013 From: adomurad at redhat.com (Adam Domurad) Date: Tue, 05 Feb 2013 10:46:47 -0500 Subject: [rfc][icedtea-web] Provide names for all unnamed threads In-Reply-To: <510B7E82.6080508@redhat.com> References: <510AE6DF.8000408@redhat.com> <510B7E82.6080508@redhat.com> Message-ID: <51112967.7010406@redhat.com> On 02/01/2013 03:36 AM, Jiri Vanek wrote: > On 01/31/2013 10:49 PM, Adam Domurad wrote: >> Simple patch, but very nice for debugging/ tooling. This will make it >> easier to track down specific threads while debugging or using >> Thermostat. An absolute must IMO for sane debugging of problems >> occurring in multiple threads. > > Agree, after one question patch is ok for head and should go also to > branches to avoid future patching conflicts. I will push as-is, OK ? >> >> 2013-XX-XX Adam Domurad >> >> Name threads for easier debugging/tooling. Remove 2 erroneous >> VoidPluginCallRequest header comments. >> * netx/net/sourceforge/jnlp/NetxPanel.java: >> Provide name for thread that calls (run). >> * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: >> Provide name for shutdown hook thread. >> * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java: >> Remove erroneous VoidPluginCallRequest comment. Provide name for >> ConsumerThread thread. >> * plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java: >> Provide name for worker thread. >> * plugin/icedteanp/java/sun/applet/PluginStreamHandler.java: >> Remove erroneous VoidPluginCallRequest comment. Provide name for >> stream listener thread. >> > ... > >> +++ b/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java >> @@ -1,4 +1,4 @@ >> -/* VoidPluginCallRequest -- represent Java-to-JavaScript requests >> +/* > VoidPluginCallRequest is supicious, > > However this, represent Java-to-JavaScript requests looks like it > could be right. Asking just for clarification. as it can be useful if > it is correct. This is definitely not right, it is a comment meant for another class. PluginMessageConsumer is not javascript specific nor does it 'represent requests'. > >> Copyright (C) 2008 Red Hat >> >> This file is part of IcedTea. >> @@ -131,6 +131,10 @@ class PluginMessageConsumer { >> >> protected class ConsumerThread extends Thread { >> >> + public ConsumerThread() { >> + super("PluginMessageConsumer.ConsumerThread"); >> + } >> + > > J. -Adam From adomurad at redhat.com Tue Feb 5 08:16:38 2013 From: adomurad at redhat.com (Adam Domurad) Date: Tue, 05 Feb 2013 11:16:38 -0500 Subject: [icedtea-web][rfc] Fix for PR580: http://www.horaoficial.cl/ loads improperly In-Reply-To: <510943EA.7070100@redhat.com> References: <51084252.60607@redhat.com> <510943EA.7070100@redhat.com> Message-ID: <51113066.4050605@redhat.com> On 01/30/2013 11:01 AM, Adam Domurad wrote: > On 01/29/2013 04:42 PM, Adam Domurad wrote: >> Hi all -- so this was a fix that I was working on for the unsigned >> applet confirmation pop-up dialogue (similar to Oracle's security >> levels). >> >> Turns out this applet is a pretty a good stress test. Basically it >> causes 13 createApplet calls, which is a good way to reveal >> concurrency issues in getInstance. >> >> Prior to patch: >> - Some or all of the 3 times that show up never finish loading, >> except after refresh >> After patch: >> - All times show without needing to refresh, as expected >> >> So why did it work mysteriously after refreshing ? After refresh, the >> shared classloader is still around (although it -should- be cleared! >> thats another bug!), and on the second round of loading all applets >> latch on to the correct classloader. >> >> There was some basic synchronization on urlToLoader, but not enough. >> It needs to synchronize all instances of the unique key for the >> entire duration of the get/put. >> >> The first approach I took was to simply make >> JNLPClassLoader#getInstance 'synchronized' -- however parallel >> loading of different-unique-key applets would suffer. While >> same-unique-key applets must load sequentially for correct behaviour, >> a long-loading applet could make a short-loading applet wait a long >> time if getInstance was simply synchronized. >> >> JNLPClassLoader continues to get more complicated, unfortunately ... >> but this fix is needed. >> I have also removed a try ... catch that did nothing but re-threw the >> exception -- although I know this is unrelated, it allowed the diff >> to be cleaner :-) Feel free to force it back ... >> >> Fix changelog: >> 2013-XX-XX Adam Domurad >> >> Fix PR580: http://www.horaoficial.cl/ loads improperly. Applets that >> must share a class-loader now load sequentially. >> * NEWS: >> Mention the fix. >> * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java >> (getUniqueKeyLock): New, atomically grabs or creates a lock for the >> unique key. >> (getInstance): Ensure classloader initialization is locked by unique >> key. >> (decrementLoaderUseCount): Ensure classloader deinitialization is >> locked by unique key, get rid of no-longer used locks. > > > Sorry originally I had: > > - private static Map urlToLoader = > - new HashMap(); // never garbage > collected! > + /** map from JNLPFile unique key to shared classloader */ > + private static Map uniqueKeyToLoader = > new ConcurrentHashMap(); > > the ConcurrentHashMap is needed for correct behaviour. It got lost in > patch reworking. Please consider patch as if it had it. > > -Adam Ping? Thoughts? -Adam From adomurad at redhat.com Tue Feb 5 08:46:40 2013 From: adomurad at redhat.com (Adam Domurad) Date: Tue, 05 Feb 2013 11:46:40 -0500 Subject: [rfc][icedtea-web] Ensure applet shutdown finishes without exceptions - 1 - npe In-Reply-To: <510B8851.80604@redhat.com> References: <510AEAC0.2010104@redhat.com> <510B8851.80604@redhat.com> Message-ID: <51113770.307@redhat.com> On 02/01/2013 04:18 AM, Jiri Vanek wrote: > On 01/31/2013 11:05 PM, Adam Domurad wrote: >> Hi all. Another round of what I think could be important stability >> fixes for icedtea-web. >> >> I noticed while doing my unsigned-applet-confirmation patch that >> JNLPClassLoader instances did not always reach reference-count == 0 >> when all their instances should have been destroyed. The first part >> of that was the applet synchronization issue, that I have posted a >> patch for. >> >> 3 additional problems fixed here: >> >> Fixed in npe-fix-and-wait-for-init.patch: >> 1.) There was a sometimes-occurring NPE in >> JNLPClassLoader#getPermisions, when a CodeSource did not have an >> associated location when an applet was destroyed. This could cause >> the destroyApplet code to not finish. This was fixed with a simple >> null check guard. This fixes some spurious exceptions being printed >> out during shutdown (causing some noise in reproducer system). >> >> 2.) Applets can actually be destroyed from one thread *in the middle >> of initialization*, while somewhat hard to reproduce, spamming >> refresh on a many-applet page inevitably caused it. Luckily a >> mechanism was already in place for efficiently waiting for applets to >> initialize. >> >> >> npe-fix-and-wait-for-init.patch changes: >> 2013-XX-XX Adam Domurad >> >> Ensure applet destruction cannot in the middle of initialization. >> Prevent NPE that can sometimes occurs (especially with this >> change). >> * netx/net/sourceforge/jnlp/NetxPanel.java >> (destroyApplet): wait for applet initialization >> * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java >> (getPermissions): avoid potential NPE if code source location is >> missing >> > >> >> >> npe-fix-and-wait-for-init.patch >> >> >> diff --git a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java >> b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java >> --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java >> +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java >> @@ -1144,7 +1144,7 @@ public class JNLPClassLoader extends URL >> } >> >> // Class from host X should be allowed to connect to >> host X >> - if (cs.getLocation().getHost().length()> 0) >> + if (cs.getLocation() != null&& >> cs.getLocation().getHost().length()> 0) > > Here I'm curious, is NPE here because location was not yet > initalised, have no chance to get in, its initialisation was > corrupted, or is NPE here because its it wa forgotten to be assigned > or its creation was somehow skipped? > > It it is first case then I'm for NPE guard. > If it is the second then I'm against, because the consequence is > healed and the cause will be rotten later. However still the NPE guard > can be last and only hope. I'll admit I don't know the exact situation that causes this, but it only occurred during shutdown. Seeing as I can't reproduce it ATM I'm fine having this or not, but I don't think it would hide any problems. > >> result.add(new >> SocketPermission(cs.getLocation().getHost(), >> "connect, accept")); >> >> diff --git a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java >> b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java >> --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java >> +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java >> @@ -587,6 +587,10 @@ public class PluginAppletViewer extends >> >> private static synchronized void destroyApplet(int identifier) { >> >> + // We should not try to destroy an applet during >> + // initialization. It may cause an inconsistent state. >> + waitForAppletInit( applets.get(identifier).panel ); > > Ok, this have sense. >> + >> PluginDebug.debug("DestroyApplet called for ", identifier); >> >> PAV_INIT_STATUS prev = updateStatus(identifier, >> PAV_INIT_STATUS.DESTROYED); >> -Adam From adomurad at redhat.com Tue Feb 5 09:32:59 2013 From: adomurad at redhat.com (Adam Domurad) Date: Tue, 05 Feb 2013 12:32:59 -0500 Subject: [rfc][icedtea-web] tests for hanging firefox In-Reply-To: <510A71A2.4090404@redhat.com> References: <510A71A2.4090404@redhat.com> Message-ID: <5111424B.9020507@redhat.com> On 01/31/2013 08:29 AM, Jiri Vanek wrote: > Following tests are testing now fixed, hanging of firefox after the > LaunchExceeption. > To achieve this I have missused AddShutDown test. It was one of the > most stable test... So I'm looking forward how my changes will > destabilize it :) (not expected!) > > 2013-01-31 Jiri Vanek > > Added test for hanging firefox by LaunchException and Improved > AddShutdownHookTest > * > tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook.html: > new file to launch applet with RuntimeException as result. > * > tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook_wrong.html: > new file to launch applet with LaunchException as result. > * > tests/reproducers/simple/AddShutdownHook/srcs/AddShutdownHook.java: is > now also applet. > * > tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java: > Added test (AddShutdownHookApplet)for applet, removed duplicate > code by rules. > * > tests/reproducers/simple/AddShutdownHook/testcases/HangFirefoxTests.java: > New test set which is launching exception throwing applet, and > after exception > is thrown then it tries jsut stdou-ing applet. Second applet have > to be > launched. Thanks very much for tackling the test! It seems to work well, when firefox does hang. Some thoughts: - Does the test fail for you before my fix ? I have to apply also my 'pseudo-reproducer' to coax it to hang. - If this test ever does come up as a failure it will probably be necessary to apply this patch to properly diagnose it, as it seems it can pass/fail randomly. Patch: > diff -r e631770d76ba > tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook.html > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook.html > Thu Jan 31 14:26:40 2013 +0100 > @@ -0,0 +1,42 @@ > + > + > +

codebase="." width="800" height="600"> > +

> + > + > \ No newline at end of file > diff -r e631770d76ba > tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook_wrong.html > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook_wrong.html > Thu Jan 31 14:26:40 2013 +0100 > @@ -0,0 +1,42 @@ > + > + > +

archive="NotExisitngArchive.jar" codebase="." width="800" height="600"> Nit: s/Exisitng/Existing/ > +

> + > + > \ No newline at end of file > diff -r e631770d76ba > tests/reproducers/simple/AddShutdownHook/srcs/AddShutdownHook.java > --- > a/tests/reproducers/simple/AddShutdownHook/srcs/AddShutdownHook.java > Thu Jan 31 11:12:35 2013 +0100 > +++ > b/tests/reproducers/simple/AddShutdownHook/srcs/AddShutdownHook.java > Thu Jan 31 14:26:40 2013 +0100 > @@ -1,3 +1,6 @@ > + > +import java.applet.Applet; > + > /* AddShutdownHook.java > Copyright (C) 2011 Red Hat, Inc. > > @@ -35,7 +38,7 @@ > exception statement from your version. > */ > > -public class AddShutdownHook { > +public class AddShutdownHook extends Applet { > public static void main(String[] args) { > > Runtime.getRuntime().addShutdownHook(new Thread() { > @@ -45,4 +48,11 @@ > }); > > } > + > + @Override > + public void start() { > + main(null); > + } > + > + > } > diff -r e631770d76ba > tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java > --- > a/tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java > Thu Jan 31 11:12:35 2013 +0100 > +++ > b/tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java > Thu Jan 31 14:26:40 2013 +0100 > @@ -1,58 +1,74 @@ > /* AddShutdownHookTest.java > -Copyright (C) 2011 Red Hat, Inc. > + Copyright (C) 2011 Red Hat, Inc. > > -This file is part of IcedTea. > + 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 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. > + 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. > + 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. > + 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. > + 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. > */ > > -import net.sourceforge.jnlp.ServerAccess; > +import net.sourceforge.jnlp.ClosingListener; > +import net.sourceforge.jnlp.ProcessResult; > +import net.sourceforge.jnlp.annotations.TestInBrowsers; > +import net.sourceforge.jnlp.browsertesting.BrowserTest; > +import net.sourceforge.jnlp.browsertesting.Browsers; > +import > net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; > +import net.sourceforge.jnlp.closinglisteners.StringMatchClosingListener; > import org.junit.Assert; > > import org.junit.Test; > > -public class AddShutdownHookTest { > +public class AddShutdownHookTest extends BrowserTest { > > - private static ServerAccess server = new ServerAccess(); > + public static final String s = > "(?s).*java.security.AccessControlException.{0,5}access > denied.{0,5}java.lang.RuntimePermission.{0,5}" + "shutdownHooks" + ".*"; > + public static final String cnfString = "ClassNotFoundException"; > + public static final RulesFolowingClosingListener.MatchesRule mr = > new RulesFolowingClosingListener.MatchesRule(s); > + public static final RulesFolowingClosingListener.ContainsRule cnf > = new RulesFolowingClosingListener.ContainsRule(cnfString); > + public static final RulesFolowingClosingListener rfc = new > RulesFolowingClosingListener(mr); > > @Test > public void AddShutdownHookTestLunch1() throws Exception { > - ServerAccess.ProcessResult pr = > server.executeJavawsHeadless(null, "/AddShutdownHook.jnlp"); > - String s = > "(?s).*java.security.AccessControlException.{0,5}access > denied.{0,5}java.lang.RuntimePermission.{0,5}" + "shutdownHooks" + ".*"; > - Assert.assertTrue("stderr should match "+s+" but > didn't",pr.stderr.matches(s)); > - String cc="ClassNotFoundException"; > - Assert.assertFalse("stderr should NOT contains `"+cc+"`, but > did",pr.stderr.contains(cc)); > - Assert.assertFalse("stdout length should be <=2, but was > "+pr.stdout.length(),pr.stdout.length()>2); > - Assert.assertFalse("AddShutdownHookTestLunch1 should not be > terminated, but was",pr.wasTerminated); > + ProcessResult pr = server.executeJavawsHeadless(null, > "/AddShutdownHook.jnlp"); > + Assert.assertTrue("stderr " + mr.toPassingString(), > mr.evaluate(pr.stderr)); > + Assert.assertFalse("stderr " + cnf.toFailingString(), > cnf.evaluate(pr.stderr)); > + Assert.assertFalse("stdout length should be <=2, but was " + > pr.stdout.length(), pr.stdout.length() > 2); > + Assert.assertFalse("AddShutdownHookTestLunch1 should not be > terminated, but was", pr.wasTerminated); > Assert.assertEquals((Integer) 0, pr.returnValue); > } > + > + @Test > + @TestInBrowsers(testIn = Browsers.one) > + public void AddShutdownHookApplet() throws Exception { > + ProcessResult pr = > server.executeBrowser("/AddShutdownHook.html", null, rfc); > + Assert.assertTrue("stderr " + mr.toPassingString(), > mr.evaluate(pr.stderr)); > + Assert.assertFalse("stderr " + cnf.toFailingString(), > cnf.evaluate(pr.stderr)); > + } > } > diff -r e631770d76ba > tests/reproducers/simple/AddShutdownHook/testcases/HangFirefoxTests.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ > b/tests/reproducers/simple/AddShutdownHook/testcases/HangFirefoxTests.java > Thu Jan 31 14:26:40 2013 +0100 > @@ -0,0 +1,111 @@ > +/* AddShutdownHookTest.java > + Copyright (C) 2011 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. > + */ > + > +import net.sourceforge.jnlp.ProcessResult; > +import net.sourceforge.jnlp.annotations.TestInBrowsers; > +import net.sourceforge.jnlp.browsertesting.BrowserTest; > +import net.sourceforge.jnlp.browsertesting.Browsers; > +import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; > +import > net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; > +import org.junit.Assert; > + > +import org.junit.Test; > + > +public class HangFirefoxTests extends BrowserTest { > + > + String leString = "LaunchException"; > + ; > + String startedString = "applet was started"; > + RulesFolowingClosingListener.ContainsRule leRule = new > RulesFolowingClosingListener.ContainsRule(leString); > + RulesFolowingClosingListener.ContainsRule appleStartedRule = new > RulesFolowingClosingListener.ContainsRule(startedString); > + > + @Test > + @TestInBrowsers(testIn = Browsers.firefox) > + public void HangFirefoxWithRuntimeExceptionTests() throws Exception { > + ProcessResult pr = > server.executeBrowser("/AddShutdownHook.html", new > RulesFolowingClosingListener(appleStartedRule), new > CountingClosingListener() { > + private boolean launched = false; > + > + @Override > + protected boolean isAlowedToFinish(String content) { s/Alowed/Allowed/ > + if (AddShutdownHookTest.mr.evaluate(content) && > !launched) { > + launched = true; > + try { > + server.executeBrowser("/appletAutoTests2.html", null, > (CountingClosingListener) null); > + } catch (Exception ex) { > + throw new RuntimeException(ex); > + } > + } > + return false; > + } > + }); > + Assert.assertTrue("stderr " + > AddShutdownHookTest.mr.toPassingString(), > AddShutdownHookTest.mr.evaluate(pr.stderr)); > + Assert.assertTrue("stdout " + > appleStartedRule.toPassingString(), appleStartedRule.evaluate(pr.stdout)); > + Assert.assertFalse("stderr " + > AddShutdownHookTest.cnf.toFailingString(), > AddShutdownHookTest.cnf.evaluate(pr.stderr)); > + } > + > + @Test > + @TestInBrowsers(testIn = Browsers.firefox) > + public void HangFirefoxWithLaunchException() throws Exception { > + ProcessResult pr = > server.executeBrowser("/AddShutdownHook_wrong.html", new > RulesFolowingClosingListener(appleStartedRule), new > CountingClosingListener() { > + private boolean launched = false; > + > + @Override > + protected boolean isAlowedToFinish(String content) { s/Alowed/Allowed/ > + if (leRule.evaluate(content) && !launched) { > + launched = true; > + try { > + server.executeBrowser("/appletAutoTests2.html", null, > (CountingClosingListener) null); > + } catch (Exception ex) { > + throw new RuntimeException(ex); > + } > + } > + return false; > + } > + }); > + Assert.assertTrue("stderr " + leRule.toPassingString(), > leRule.evaluate(pr.stderr)); > + Assert.assertTrue("stdout " + > appleStartedRule.toPassingString(), appleStartedRule.evaluate(pr.stdout)); > + Assert.assertFalse("stderr " + > AddShutdownHookTest.cnf.toFailingString(), > AddShutdownHookTest.cnf.evaluate(pr.stderr)); > + } > + > + @Test > + @TestInBrowsers(testIn = Browsers.one) > + public void TestAddShutdownHookWrong() throws Exception { > + ProcessResult pr = > server.executeBrowser("/AddShutdownHook_wrong.html", null, new > RulesFolowingClosingListener(leRule)); > + Assert.assertTrue("stderr " + leRule.toPassingString(), > leRule.evaluate(pr.stderr)); > + Assert.assertFalse("stderr " + > AddShutdownHookTest.cnf.toFailingString(), > AddShutdownHookTest.cnf.evaluate(pr.stderr)); > + } > +} Otherwise looks good for HEAD. Maybe add a comment somewhere in the reproducer that says eg "If this test has failed, you may try the following to reproduce the problem more consistently: - private static final int MAX_WORKERS = MAX_PARALLEL_INITS * 4; - private static final int PRIORITY_WORKERS = MAX_PARALLEL_INITS * 2; + private static final int MAX_WORKERS = MAX_PARALLEL_INITS * 2; + private static final int PRIORITY_WORKERS = MAX_PARALLEL_INITS * 1; in PluginMessageConsumer.java" -Adam From adomurad at redhat.com Tue Feb 5 12:11:30 2013 From: adomurad at redhat.com (Adam Domurad) Date: Tue, 05 Feb 2013 15:11:30 -0500 Subject: [rfc][icedtea-web] modifications to JSToJSet reproducer for Liveconnect In-Reply-To: <50FD0BEA.3040806@redhat.com> References: <50FD0BEA.3040806@redhat.com> Message-ID: <51116772.4010904@redhat.com> On 01/21/2013 04:35 AM, Jana Fabrikova wrote: > Hello, > > i am sending a patch that modifies the JSToJSet reproducer (adding two > KnownToFail annotations and adding one testcase - setting a variable > of the JSObject type), > > comments on the attached patch are very welcome, > Jana > > 2013-01-21 Jana Fabrikova > > * /tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java: > adding 1 testcase setting applets variable of type JSObject from JS, > adding KnownToFail anotation to (AppletJSToJSet_intArrayElement_Test) > and (AppletJSToJSet_DoubleArrayElement_Test) methods > > * /tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js: > adding the JSObject case to (doSetTests) function > > * /tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java: > adding the JSObject variable to the applet and modifying > (printNewValueAndFinish) method in order to output new values of > JSObject variable (Just a note, make sure the ChangeLog is in proper ChangeLog format -- ie explanation lines dont exceed 80 lines, and must start with a tab) > diff --git > a/tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js > b/tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js > --- a/tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js > +++ b/tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js > @@ -1,3 +1,9 @@ > +//dummy javascript class whose instance is passed as JSObject parameter: > +function JSCar(mph,color){ > + this.mph = mph; > + this.color = color; > +} > + > function doSetTests( ){ > > var urlArgs = document.URL.split("?"); > @@ -18,12 +24,16 @@ > if( field === "_specialString"){ > value = "????$????"; > } > + > + if( field === "_JSObject"){ > + value = new JSCar(100,"red"); > + } > + > }else if(value.indexOf('[') != -1){ > > var elem = value.substring(1); > value = new Array(); > eval('value[0] = elem'); > - > } > > eval('applet.' + field + '= value'); > diff --git a/tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java > b/tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java > --- a/tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java > +++ b/tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java > @@ -1,7 +1,7 @@ > -import java.applet.*; > -import java.awt.*; > +import java.applet.Applet; > import java.lang.reflect.Array; > import java.lang.reflect.Field; > +import netscape.javascript.JSObject; > > public class JSToJSet extends Applet { > > @@ -27,6 +27,7 @@ > public Double[] _DoubleArray2; > public char[] _charArray = new char[1]; > public Character[] _CharacterArray = new Character[1]; > + public JSObject _JSObject; > > public void init() { > String initStr = "JSToJSet applet initialized."; > @@ -36,7 +37,12 @@ > public void printNewValueAndFinish(String fieldname) throws Exception { > Field field = getClass().getDeclaredField(fieldname); > Object value = field.get(this); > - if (value != null && value.getClass().isArray()) { > + > + if( fieldname.equals("_JSObject") ){ > + Integer mph = (Integer)_JSObject.getMember("mph"); > + String color = (String)_JSObject.getMember("color"); > + System.out.println("New value is: "+mph+", "+color); > + }else if (value != null && value.getClass().isArray()) { > System.out.println("New array value is: " + Array.get(value, 0)); > } else { > System.out.println("New value is: " + value); > diff --git > a/tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java > b/tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java > --- a/tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java > +++ b/tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java > @@ -40,6 +40,7 @@ > import net.sourceforge.jnlp.browsertesting.BrowserTest; > import net.sourceforge.jnlp.browsertesting.Browsers; > import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; > +import net.sourceforge.jnlp.annotations.KnownToFail; > import net.sourceforge.jnlp.annotations.NeedsDisplay; > import net.sourceforge.jnlp.annotations.TestInBrowsers; > import org.junit.Assert; > @@ -71,7 +72,7 @@ > > // Assert that the values set by JavaScript are ok > Assert.assertTrue("JSToJSet: the output should include: > "+expectedStdout+", but it didnt.", > - pr.stdout.contains(expectedStdout)); > + pr.stdout.contains(expectedStdout)); > > } > > @@ -83,23 +84,23 @@ > } > > private void jsToJavaSetSpecialTest(String fieldStr, String valueStr, > int testType) throws Exception { > - String strURL = "/JSToJSet.html?"; > - String expectedStdout = ""; > - switch( testType ){ > + String strURL = "/JSToJSet.html?"; > + String expectedStdout = ""; > + switch( testType ){ > case 0://array element > - strURL += fieldStr + ";" + valueStr; > - expectedStdout = "New array value is: "+valueStr; > + strURL += fieldStr + ";" + valueStr; > + expectedStdout = "New array value is: "+valueStr; > break; > case 1://whole array, set 1st element > - strURL += fieldStr + ";[" + valueStr; > - expectedStdout = "New array value is: "+valueStr; > - break; > + strURL += fieldStr + ";[" + valueStr; > + expectedStdout = "New array value is: "+valueStr; > + break; > case 2://char et al - to be set at JS side > - strURL += fieldStr + ";JavaScript"; > - expectedStdout = "New value is: "+valueStr; > + strURL += fieldStr + ";JavaScript"; > + expectedStdout = "New value is: "+valueStr; > break; > default: > - break; > + break; > } Can you change this 0,1,2 to an enum ? eg enum TestType { ARRAY_ELEMENT, WHOLE_ARRAY, NORMAL_VALUE } Or something, and use those in the switch statement instead. > > ProcessResult pr = server.executeBrowser(strURL, new > CountingClosingListenerImpl(), new CountingClosingListenerImpl()); > @@ -158,6 +159,7 @@ > @Test > @TestInBrowsers(testIn = { Browsers.all }) > @NeedsDisplay > + @KnownToFail > public void AppletJSToJSet_intArrayElement_Test() throws Exception { > jsToJavaSetSpecialTest("_intArray[0]", "1", 0); > } > @@ -235,6 +237,7 @@ > @Test > @TestInBrowsers(testIn = { Browsers.all }) > @NeedsDisplay > + @KnownToFail Interesting, would you mind filing a bug report at http://icedtea.classpath.org/bugzilla if one doesn't exist yet ? Thanks! I looked into it a bit and it indeed seems to be a bug, but do you have any insight into what's causing it ? > public void AppletJSToJSet_DoubleArrayElement_Test() throws Exception { > jsToJavaSetSpecialTest("_DoubleArray[0]", "1.1", 0); > } > @@ -246,4 +249,10 @@ > jsToJavaSetSpecialTest("_DoubleArray2", "0.1", 1); > } > > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJSet_JSObject_Test() throws Exception { > + jsToJavaSetSpecialTest("_JSObject", "100, red", 2); > + } > } Looks good otherwise! -Adam From adomurad at redhat.com Tue Feb 5 13:49:23 2013 From: adomurad at redhat.com (Adam Domurad) Date: Tue, 05 Feb 2013 16:49:23 -0500 Subject: [rfc][icedtea-web] modifications to JSToJGet reproducer for Liveconnect In-Reply-To: <50F6CDCF.6010706@redhat.com> References: <50F6CDCF.6010706@redhat.com> Message-ID: <51117E63.6010301@redhat.com> On 01/16/2013 10:57 AM, Jana Fabrikova wrote: > Hi, > > i am sending a patch that modifies the JSToJGet reproducer (removing > one KnownToFail and adding one testcase), > > thank you for any comments, > Jana > > 2013-01-16 Jana Fabrikova > > * /tests/reproducers/simple/JSToJGet/resources/JSToJGet.html: > adding 1 testcase reading applets variable of type JSObject from JS > > * /tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java: > adding 1 testcase reading applets variable of type JSObject from JS, > small changes to evaluation of the applet's stdout methods, removing > KnownToFail anotation from (AppletJSToJGet_DoubleFullArray_Test) method > > * /tests/reproducers/simple/JSToJGet/resources/JSToJ_auxiliary.js: > removing two lines of comment that are no longer true > > * /tests/reproducers/simple/JSToJGet/resources/JSToJava_Get.js: > adding (test_get_JSObject) function also to the JS part of test > > * /tests/reproducers/simple/JSToJGet/srcs/JSToJGet.java: > adding the JSObject variable to the applet Be sure to format like rest of ChangeLog > > > diff --git a/tests/reproducers/simple/JSToJGet/resources/JSToJGet.html > b/tests/reproducers/simple/JSToJGet/resources/JSToJGet.html > --- a/tests/reproducers/simple/JSToJGet/resources/JSToJGet.html > +++ b/tests/reproducers/simple/JSToJGet/resources/JSToJGet.html > @@ -92,6 +92,9 @@ > break; > case "DoubleFullArray": > test_get_DoubleFullArray(); > + break;a > + case "JSObject": > + test_get_JSObject();a > break; > default: > appletStdOutLn('jstojGetApplet', "No argument in URL! > Should be e.g. JSToJGet.html?int"); > diff --git > a/tests/reproducers/simple/JSToJGet/resources/JSToJ_auxiliary.js > b/tests/reproducers/simple/JSToJGet/resources/JSToJ_auxiliary.js > --- a/tests/reproducers/simple/JSToJGet/resources/JSToJ_auxiliary.js > +++ b/tests/reproducers/simple/JSToJGet/resources/JSToJ_auxiliary.js > @@ -3,8 +3,6 @@ > This file contains auxiliary JavaScript functions for LiveConnect > tests output, > the following reproducers have this file as a common resource: > - JSToJGet > -- JSToJSet > -- JSToJFuncParam > - JSToJFuncReturn > - JSToJFuncResol > - JSToJTypeConv > diff --git > a/tests/reproducers/simple/JSToJGet/resources/JSToJava_Get.js > b/tests/reproducers/simple/JSToJGet/resources/JSToJava_Get.js > --- a/tests/reproducers/simple/JSToJGet/resources/JSToJava_Get.js > +++ b/tests/reproducers/simple/JSToJGet/resources/JSToJava_Get.js > @@ -245,5 +245,17 @@ > appendMessageDiv(e); > } > } > + > +function test_get_JSObject(){ > + var appletName = 'jstojGetApplet'; > + try{ > + var javao = new Object(document.getElementById(appletName).jso); > + check(javao.key1, "value1", "string", "22 - (JSObject)", > appletName); > + }catch(e){ > + appletStdOut( appletName, e ); > + appendMessageDiv(e); > + } > + > +} > > > diff --git a/tests/reproducers/simple/JSToJGet/srcs/JSToJGet.java > b/tests/reproducers/simple/JSToJGet/srcs/JSToJGet.java > --- a/tests/reproducers/simple/JSToJGet/srcs/JSToJGet.java > +++ b/tests/reproducers/simple/JSToJGet/srcs/JSToJGet.java > @@ -1,5 +1,7 @@ > -import java.applet.*; > -import java.awt.*; > +import java.applet.Applet; > +import java.awt.Label; > +import java.awt.BorderLayout; > +import netscape.javascript.JSObject; > > public class JSToJGet extends Applet { > > @@ -27,9 +29,22 @@ > > public char[] ca = new char[3]; > public Character[] Ca = new Character[3]; > + public JSObject jso; > > private Label statusLabel; > > + public void start(){ > + JSObject win = JSObject.getWindow(this); > + jso = (JSObject) win.getMember("document"); > + jso.setMember("key1","value1"); > + ia[4] = 1024; > + Da1[9] = D; > + > + String setupStr = "JSToJGet applet set up for GET tests."; > + System.out.println(setupStr); > + statusLabel.setText(setupStr); > + } > + > public void init() { > setLayout(new BorderLayout()); > statusLabel = new Label(); > @@ -37,14 +52,6 @@ > String initStr = "JSToJGet applet initialized."; > System.out.println(initStr); > statusLabel.setText(initStr); > - > - ia[4] = 1024; > - Da1[9] = D; > - > - String setupStr = "JSToJGet applet set up for GET tests."; > - System.out.println(setupStr); > - statusLabel.setText(setupStr); > - > } > > // auxiliary method for setting the statusLabel text: > diff --git > a/tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java > b/tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java > --- a/tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java > +++ b/tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java > @@ -56,7 +56,6 @@ > public String foundStr = "] found:["; > public String endStr = "]."; > > - private final String exceptionStr = "xception"; > private final String initStr = "JSToJGet applet initialized."; > private final String setupStr = "JSToJGet applet set up for GET > tests."; > private final String afterStr = "afterTests"; > @@ -65,9 +64,6 @@ > > @Override > protected boolean isAlowedToFinish(String s) { > - if (s.contains(exceptionStr)) { > - return true; > - } > return (s.contains(initStr) && s.contains(setupStr) && s > .contains(afterStr)); > } > @@ -86,12 +82,10 @@ > String s0 = testStr + passStr; > String s1 = testStr + failValStr; > String s2 = testStr + failTypeStr; > - String s3 = "Error on Java side"; > > int ind0 = pr.stdout.indexOf(s0); > int ind1 = pr.stdout.indexOf(s1); > int ind2 = pr.stdout.indexOf(s2); > - int ind3 = pr.stdout.indexOf(s3); > int indBegin = pr.stdout.indexOf(setupStr); > if (indBegin != -1) { > indBegin += setupStr.length(); > @@ -116,11 +110,6 @@ > failStr = "JSToJGet: type mismatch in "+testStr; > } > > - if (ind3 != -1) { > - failStr = "JSToJGet: an error occured during " + testStr; > - } > - > - Assert.assertTrue(failStr, (ind3 == -1));// no error on Java side > Assert.assertTrue(failStr, (ind1 == -1));// no value mismatch > Assert.assertTrue(failStr, (ind2 == -1));// no type mismatch > Assert.assertTrue(failStr, (ind0 != -1));// test passed > @@ -288,9 +277,14 @@ > @Test > @TestInBrowsers(testIn = { Browsers.all }) > @NeedsDisplay > - @KnownToFail > public void AppletJSToJGet_DoubleFullArray_Test() throws Exception { > jsToJavaGetTest("DoubleFullArray", "Test no.21 - (Double[] - > full array)"); > } > > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJGet_JSObject_Test() throws Exception { > + jsToJavaGetTest("JSObject", "Test no.22 - (JSObject)"); > + } > } Looks OK for HEAD, -Adam From omajid at redhat.com Tue Feb 5 15:22:14 2013 From: omajid at redhat.com (Omair Majid) Date: Tue, 05 Feb 2013 18:22:14 -0500 Subject: [fyi][icedtea-web] backend and itw-settings for extended applets security In-Reply-To: <510E532C.8040401@redhat.com> References: <510E532C.8040401@redhat.com> Message-ID: <51119426.9090000@redhat.com> Hi Jiri, On 02/03/2013 07:08 AM, Jiri Vanek wrote: > Whole troubles are described here > http://icedtea.classpath.org/wiki/Extended_Applets_Security rather > then in plain email. Thanks for adding this to the wiki. I have a few thoughts and some questions. Would it be clearer if "Extra High Security" was renamed to "Disable All Applets"? For matching, I think it might be good to follow the same rule that is used to decide whether to share classloaders between applets. What's the motivation behind keeping codebase and document-bases as regexes? > There is what me and adam have already achieved on this topic, what we > have o achieve and where we are stil not so sure.... > > This patch is containing itw-settings part and backend for manipulating > stored entries.and basic matching. > I noted this just [fyi] because adam ave already walked through the > patch, and so have I across his part. So the patch should be ready for > push unless someone find something malicious on > implementation or even on design. Some comments/questions and suggestions below. > diff -r e631770d76ba netx/net/sourceforge/appletextendedsecurity/AppletExtendedSecurity.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/appletextendedsecurity/AppletExtendedSecurity.java Fri Feb 01 20:55:48 2013 +0100 Hm... I would have expected this to be for the plugin. Why netx? If it's in netx, why not the existing net/sourceforge/jnlp/security package? > @@ -0,0 +1,84 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ We generally use GPL+Classpath exception license (see [1] for an example). Is there a specific reason for using the GPL? This same issue is with other classes too. > +public class AppletExtendedSecurity { To me this name sounds like it extends another class (the existing AppletSecurity class, even). Maybe call it something else, like AppletStartupSecuritySettings? (not a great name either, but slightly more descriptive) Any reason for making this class mostly static? I would prefer it if was instantiated. Maybe JNLPRuntime can be used to obtain an instance of this? > + public static AppletSecurityLevel getDefaultSecurityLevel(){ > + return AppletSecurityLevel.getDefault(); > + } I am trying to see what is the advantage of this method, but I am having trouble. > + /** > + * > + * @return user-set seurity level or default one if user-set do not exists > + */ > + public static AppletSecurityLevel getCustomSecurityLevel(){ > + DeploymentConfiguration conf = JNLPRuntime.getConfiguration(); > + if (conf==null){ > + conf = new DeploymentConfiguration(); > + try { > + conf.load(); > + } catch (ConfigurationException ex){ > + ex.printStackTrace(); > + return getDefaultSecurityLevel(); > + } > + } I think it would be much more robust if this method threw an exception instead of instantiating a new DeploymentConfiguration object. I would so far as to require a DeploymentConfiguration parameter in the constructor. > + String s = conf.getProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL); > + if (s==null) { > + return getDefaultSecurityLevel(); > + } > + return AppletSecurityLevel.fromString(s); > + } There are two methods that use the word 'custom' in the name. But moth mean different things. I would prefer it if both methods were renamed (custom is not a very descriptive term): getUnsignedAppletActionCustomStorage -> getUnsignedAppletActionUserStorage getCustomSecurityLevel -> getCurrentSecurityLevel > diff -r e631770d76ba netx/net/sourceforge/appletextendedsecurity/AppletSecurityLevel.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/appletextendedsecurity/AppletSecurityLevel.java Fri Feb 01 20:55:48 2013 +0100 > +public enum AppletSecurityLevel { > + > + DENY_ALL, DENY_UNSIGNED, ASK_UNSIGNED, ALLOW_UNSIGNED; > + > + public static String allToString() { > + return DENY_ALL.toChars()+" "+DENY_UNSIGNED.toChars()+" "+ASK_UNSIGNED.toChars()+" "+ALLOW_UNSIGNED.toChars(); > + } If you just need this for debugging, try: Arrays.toString(AppletSecurityLevel.values()) And you wont have to change this code if you add another enum value. > + public String toChars() { > + switch (this) { > + case DENY_ALL: > + return " DENY_ALL"; > + case DENY_UNSIGNED: > + return "DENY_UNSIGNED"; > + case ASK_UNSIGNED: > + return "ASK_UNSIGNED"; > + case ALLOW_UNSIGNED: > + return "ALLOW_UNSIGNED"; > + } > + throw new RuntimeException("Unknown AppletSecurityLevel"); > + } I think you can replace this with the name() method of the enum (unless you really want the space in the beginning of DENY_ALL): DENY_ALL.name(). > + public static AppletSecurityLevel fromString(String s) { > + if (s.trim().equalsIgnoreCase("DENY_ALL")) { > + return AppletSecurityLevel.DENY_ALL; > + } else if (s.trim().equalsIgnoreCase("DENY_UNSIGNED")) { > + return AppletSecurityLevel.DENY_UNSIGNED; > + } else if (s.trim().equalsIgnoreCase("ASK_UNSIGNED")) { > + return AppletSecurityLevel.ASK_UNSIGNED; > + } else if (s.trim().equalsIgnoreCase("ALLOW_UNSIGNED")) { > + return AppletSecurityLevel.ALLOW_UNSIGNED; > + } else { > + throw new RuntimeException("Unknown AppletSecurityLevel for " + s); > + } > + } AppletSecurityLevel.valueOf(String.toUpperCase()) does what fromString does, I think. > diff -r e631770d76ba netx/net/sourceforge/appletextendedsecurity/UnsignedAppletAction.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/appletextendedsecurity/UnsignedAppletAction.java Fri Feb 01 20:55:48 2013 +0100 > +public enum UnsignedAppletAction { Maybe call it ExecuteUnsignedApplet? > + ALWAYS, NEVER, YES, NO; > + > + public String toChar() { > + switch (this) { > + case ALWAYS: > + return "A"; > + case NEVER: > + return "N"; > + case YES: > + return "y"; > + case NO: > + return "n"; > + } > + throw new RuntimeException("Unknown UnsignedAppletAction"); > + } > + I think name() already does this. > + public String toExplanation() { > + switch (this) { > + case ALWAYS: > + return Translator.R("APPEXTSECunsignedAppletActionAlways"); > + case NEVER: > + return Translator.R("APPEXTSECunsignedAppletActionNever"); > + case YES: > + return Translator.R("APPEXTSECunsignedAppletActionYes"); > + case NO: > + return Translator.R("APPEXTSECunsignedAppletActionNo"); > + } > + throw new RuntimeException("Unknown UnsignedAppletAction"); > + } Do you expect the explanation to be visible to the user? Maybe it belongs with the rest of the UI, not in here with the logic. Just something to think about. > + public static UnsignedAppletAction fromString(String s) { > + if (s.startsWith("A")) { > + return UnsignedAppletAction.ALWAYS; > + } else if (s.startsWith("N")) { > + return UnsignedAppletAction.NEVER; > + } else if (s.startsWith("y")) { > + return UnsignedAppletAction.YES; > + } else if (s.startsWith("n")) { > + return UnsignedAppletAction.NO; > + } else { > + throw new RuntimeException("Unknown UnsignedAppletAction for " + s); > + } > + } Maybe use Enum.valueOf() can replace this fromString method. > diff -r e631770d76ba netx/net/sourceforge/appletextendedsecurity/UnsignedAppletActionEntry.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/appletextendedsecurity/UnsignedAppletActionEntry.java Fri Feb 01 20:55:48 2013 +0100 > + @Override > + public String toString() { > + return unsignedAppletAction.toChar() + > + " " + ((timeStamp == null)?"1":timeStamp.getTime()) + > + " " + ((documentBase == null)?"":documentBase.getRegEx()) + > + " " + ((codeBase == null)?"":codeBase.getRegEx()) + > + " " + ((mainClass == null)?"":mainClass) + > + " " + createArchivesString(archives); > + > + } > + > + public void write(Writer bw) throws IOException { > + bw.write(this.toString()); > + } This may not be a good idea. toString() is generally meant for humans to read, not for machines: * Returns a string representation of the object. In general, the * {@code toString} method returns a string that * "textually represents" this object. The result should * be a concise but informative representation that is easy for a * person to read. I would encourage you to serialize the data for writing to a file in write(), but only serialize it for debugging/display in toString(). > + public static String createArchivesString(List listOfArchives) { > + if (listOfArchives == null){ > + return ""; > + } > + StringBuilder sb = new StringBuilder(); > + for (int i = 0; i < listOfArchives.size(); i++) { > + String string = listOfArchives.get(i); As a sanity check, maybe you can check that the input string does not contain any semicolons? I ran into a URL last week that had a semicolon :( > + if (string.trim().isEmpty()){ > + continue; > + } > + sb.append(string).append(";"); > + } > + return sb.toString(); > diff -r e631770d76ba netx/net/sourceforge/appletextendedsecurity/UnsignedAppletActionStorage.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/appletextendedsecurity/UnsignedAppletActionStorage.java Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,106 @@ > +/* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*//* > +Copyright (C) 2013 Red Hat > + > +This program 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 of the License, or > +(at your option) any later version. > + > +This program 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 this program; if not, write to the Free Software > +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +*/ This file has 2 licenses. > +/** > + * > + * @author jvanek > + */ Javadocs on what this class does would be nice to have. > diff -r e631770d76ba netx/net/sourceforge/appletextendedsecurity/UrlRegEx.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/appletextendedsecurity/UrlRegEx.java Fri Feb 01 20:55:48 2013 +0100 > +public class UrlRegEx { I don't follow the motivation for having this class. > + public String getFilteredRegEx() { > + return regEx.replaceAll("\\\\Q", "").replaceAll("\\\\E", ""); > + } Uh.. do you expect someone to use quote things in the strings? IMHO, if you are exposing a "regex" to the users, don't try and sanitize/modify/"fix" it. > diff -r e631770d76ba netx/net/sourceforge/appletextendedsecurity/impl/UnsignedAppletActionStorageOperator.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/appletextendedsecurity/impl/UnsignedAppletActionStorageOperator.java Fri Feb 01 20:55:48 2013 +0100 > +public class UnsignedAppletActionStorageOperator extends UnsignedAppletActionStorageImpl { The name "operator" at the end of the name makes it sound like it should be using UnsignedAppletActionStorage, not extending it. > diff -r e631770d76ba netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java > --- a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java Thu Jan 31 11:12:35 2013 +0100 > +++ b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java Fri Feb 01 20:55:48 2013 +0100 > + public static File getAppletTrustCustomSettingsPath() { > + return new File(System.getProperty("user.home") + File.separator + DEPLOYMENT_DIR > + + File.separator + APPLET_TRUST_SETTINGS); > + } Please avoid 'custom'. It's not very indicative of the purpose. I think "User" might be more apporpriate than Custom. > + public static File getAppletTrustGlobalSettingsPath() { > + return new File(File.separator + "etc" + File.separator + ".java" + File.separator > + + "deployment" + File.separator + APPLET_TRUST_SETTINGS); > + > + } > + > /** > * Initialize this deployment configuration by reading configuration files. > * Generally, it will try to continue and ignore errors it finds (such as file not found). > diff -r e631770d76ba netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java Fri Feb 01 20:55:48 2013 +0100 > + jButton1.setText(Translator.R("APPEXTSECguiPanelHelpButton")); > + jButton1.addActionListener(new java.awt.event.ActionListener() { > + @Override > + public void actionPerformed(java.awt.event.ActionEvent evt) { > + jButton1ActionPerformed(evt); > + } > + }); Uh.. can you better names than "jButton#" ? > diff -r e631770d76ba netx/net/sourceforge/jnlp/util/lockingfile/LockingFile.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/jnlp/util/lockingfile/LockingFile.java Fri Feb 01 20:55:48 2013 +0100 > +public class LockingFile { Maybe call it LockedFile? > + private LockingFile(File file) { > + this.file = file; > + try{ > + //just try to ctreate > + this.file.createNewFile(); > + }catch(Exception ex){ > + //intentionaly silent Are you sure about the semantics here? Maybe we can chek if the file exists and is writiable before doing this? > + // Provide shared access to LockedFile's via weak map > + static private final Map instanceCache = new WeakHashMap(); > + > + /** > + * Get a LockingFile for a given File. > + * Ensures that we share the same instance for all threads > + * @param file the file to lock > + * @return a LockingFile instance > + */ > + synchronized public static LockingFile getInstance(File file) { > + if (!instanceCache.containsKey(file)) { > + instanceCache.put(file, new LockingFile(file)); > + } > + > + return instanceCache.get(file); > + } Nice! > diff -r e631770d76ba netx/net/sourceforge/jnlp/util/lockingfile/LockingReaderWriter.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/jnlp/util/lockingfile/LockingReaderWriter.java Fri Feb 01 20:55:48 2013 +0100 > +public abstract class LockingReaderWriter { > + private LockingFile lockedFile; I am going to point to as support for my argument that LockingFile should be renamed to LockedFile :) > diff -r e631770d76ba netx/net/sourceforge/jnlp/util/lockingfile/StorageIoException.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/netx/net/sourceforge/jnlp/util/lockingfile/StorageIoException.java Fri Feb 01 20:55:48 2013 +0100 > @@ -0,0 +1,22 @@ Please add a license header. > +package net.sourceforge.jnlp.util.lockingfile; > + > +/** > + * Thrown when an exception occurs using the storage (namely IOException) > + */ > +public class StorageIoException extends RuntimeException { > diff -r e631770d76ba tests/netx/unit/net/sourceforge/jnlp/util/lockingfile/LockingStringListStorageTest.java > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/tests/netx/unit/net/sourceforge/jnlp/util/lockingfile/LockingStringListStorageTest.java Fri Feb 01 20:55:48 2013 +0100 > +public class LockingStringListStorageTest { Copy-paste mistake, I hope. > +public static class LockingStringListStorage extends LockingReaderWriter { > + > + private List cachedContents = new ArrayList(); > + > + //To sutisfy testengine, void constructor and dummy testmethod > + public LockingStringListStorage() throws IOException { > + this(createTmpBackend()); > + } Please dont do this! Someone will end up using this constructor. I assume this is for unit tests? Just have the unit test itself create a temp file and pass it along to the real constructor. > + @Test > + public void lockingStringListStorageCanBeInstantiated(){ > + Assert.assertNotNull(this); > + } Please move tests to separate files. > + > + private static File createTmpBackend() throws IOException{ > + File f = File.createTempFile("forTests","emptyConstructor"); > + f.deleteOnExit(); > + return f; > + } Please dont do this! > + /** > + * Create locking file-backed storage. > + * @param file the storage file > + */ > + public LockingStringListStorage(File file) { > + super(file); > + } > + > + /** > + * Get the underlying string list cache. Should lock > + * before using. > + * @return the cache > + */ > + final protected List getCachedContents() { > + return cachedContents; > + } > + > + @Override > + public void writeContent(BufferedWriter writer) throws IOException { > + for (String string : cachedContents) { > + writer.write(string); > + writer.newLine(); > + } > + } > + > + @Override > + protected void readLine(String line) { > + this.cachedContents.add(line); > + } > + > + @Override > + protected void readContents() throws IOException { > + cachedContents.clear(); > + super.readContents(); > + } I am not a huge fan of this. The javadoc for the parent says "read contents from file", but nothing bout refresing. This class overrides it and clears the old contents. If an instance of this class is returned as a LockingReaderWriter, all sorts of glitches can happen because of the undexpected clear() call. This method should probably be called reloadContents() or something. My suggestions is to remove the inheritence completely and make LockingStringListStorage use a LockingReaderWriter instead. > + /** > + * Removes the first occurrence of the specified element from this list, > + * if it is present (optional operation). If this list does not contain > + * the element, it is unchanged. > + * > + * @param line string to be removed from this list, if present > + * @return true if the storage contained the line > + */ > + synchronized public boolean remove(String line) { > + boolean didRemove; > + > + lock(); > + try { > + readContents(); > + didRemove = cachedContents.remove(line); > + writeContents(); > + } catch (IOException e) { > + throw new StorageIoException(e); > + } finally { > + unlock(); > + } > + > + return didRemove; > + } > +} I hope there was a mistake in the patch and the test code below goes in separate classes. > + private static File storagefile; > + > + private static LockingStringListStorage newInstance() { > + return new LockingStringListStorage(storagefile); > + } > + > + @Before > + public void setUp() throws IOException { > + storagefile = File.createTempFile("foo", "bar"); > + } [1] http://icedtea.classpath.org/hg/icedtea-web/file/fd01cd1c2bbc/netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java#l1 -- PGP Key: 66484681 (http://pgp.mit.edu/) Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681 From gitne at excite.co.jp Tue Feb 5 15:26:40 2013 From: gitne at excite.co.jp (=?ISO-2022-JP?B?SmFjb2IgV2lzb3I=?=) Date: Wed, 6 Feb 2013 08:26:40 +0900 Subject: =?ISO-2022-JP?B?UmU6IFJlcXVlc3QgZm9yIHJldmlldyBvbiBHZXJtYW4gbG9jYWxpemF0aW9ucyBmb3IgaWNlZHRlYS13ZWI=?= Message-ID: <201302052326.r15NQeWA029744@mail-web03.excite.co.jp> "Jiri Vanek" wrote: > Hi! > > Thank you very much for translation! > I have walked across it and found several issues: > - SPLASHchainWas was added in meanwhile, if you may, you can include it to your next version of > translated files. Yes, I am going to catch up on this. > - All four files are identical, java fall back is working fine, so I'm for add just > Messages_de.properties and Messages_de_XX.properties where XX is the one you are most capable with > (and pure _de. will be based on this _de_XX. for now). By this we will have covered all German > locales "somehow" ( I' not familiar with differences) and one, de_XX will be covered as native as > possible. Then it will probably be best to have Messages_de.properties only, since there is nothing really region specific. I have checked that with a special dictionary for at least DE, AT, and CH. LI is usually equal to CH, BE and LU to DE. When it comes to technical language, there are no differences anyway. Hence, I assumed it has been expected to have identical files for spcific locales because cz_CZ is a specific locale too. To be precise, in some EU countries there are officially recognized Geman-speaking minorites, e.g. like in CZ, IT, or PL. But, German is not an official language on the national level in those countries. Yet, it is an official language in those regions only. I do not think that we should go that far to cover those explicitly as well, since the EU or the national authorities do not do it either. > - You have wrapped to 80 characters, this is not an rule for properties file. If it will be to much > work for you to unwrap then I do not insists - Otherwise I would like to keep all properties unwrapped. There are some Java Platform implementations that have problems reading long properties, most often J2ME implementations. And, some of them have even a hard limit of 65535 bytes per line. I do not know how relevant that might become in the future, so I just wanted to avoid future repercussions. Btw, it is easier to read even tough many good editors can do line-preserved word wrapping. If it is really bothering you, I can easily remove them. > - I'm for removing the commented original lines. IMHO they are making the file much more > unmaintainable and most of the localisation software can show original lines anyway. Sure, I have left them for review and as a request for comments only before delivering the final version. > - I have not read whole file, please can you pick up all the questions/comments here by email? I will do that, but as an answer to my initial request for review posting, so that people do not get confused. > Otherwise the localisation is working more then fine and I'm really glad for it! I am glad to hear it. :) > I have also enhanced our testsuite - see separate email with patch if you want to check it. I will take a look at it. Regards, Jacob From ptisnovs at icedtea.classpath.org Wed Feb 6 01:01:16 2013 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Wed, 06 Feb 2013 09:01:16 +0000 Subject: /hg/gfx-test: Added eight new tests to this test suite. Message-ID: changeset 21fc45f09ecb in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=21fc45f09ecb author: Pavel Tisnovsky date: Wed Feb 06 10:04:18 2013 +0100 Added eight new tests to this test suite. diffstat: ChangeLog | 5 + src/org/gfxtest/testsuites/BitBltUsingBgColor.java | 120 +++++++++++++++++++++ 2 files changed, 125 insertions(+), 0 deletions(-) diffs (142 lines): diff -r fe1337158c95 -r 21fc45f09ecb ChangeLog --- a/ChangeLog Tue Feb 05 10:59:03 2013 +0100 +++ b/ChangeLog Wed Feb 06 10:04:18 2013 +0100 @@ -1,3 +1,8 @@ +2013-02-06 Pavel Tisnovsky + + * src/org/gfxtest/testsuites/BitBltUsingBgColor.java: + Added eight new tests to this test suite. + 2013-02-05 Pavel Tisnovsky * src/org/gfxtest/framework/CommonBitmapOperations.java: diff -r fe1337158c95 -r 21fc45f09ecb src/org/gfxtest/testsuites/BitBltUsingBgColor.java --- a/src/org/gfxtest/testsuites/BitBltUsingBgColor.java Tue Feb 05 10:59:03 2013 +0100 +++ b/src/org/gfxtest/testsuites/BitBltUsingBgColor.java Wed Feb 06 10:04:18 2013 +0100 @@ -1126,6 +1126,126 @@ } /** + * Test basic BitBlt operation for empty buffered image with type TYPE_BYTE_BINARY. + * Background color is set to Color.black. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageTypeByteBinaryBackgroundBlack(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageTypeByteBinary(image, graphics2d, Color.black); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_BYTE_BINARY. + * Background color is set to Color.blue. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageTypeByteBinaryBackgroundBlue(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageTypeByteBinary(image, graphics2d, Color.blue); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_BYTE_BINARY. + * Background color is set to Color.green. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageTypeByteBinaryBackgroundGreen(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageTypeByteBinary(image, graphics2d, Color.green); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_BYTE_BINARY. + * Background color is set to Color.cyan. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageTypeByteBinaryBackgroundCyan(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageTypeByteBinary(image, graphics2d, Color.cyan); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_BYTE_BINARY. + * Background color is set to Color.red. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageTypeByteBinaryBackgroundRed(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageTypeByteBinary(image, graphics2d, Color.red); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_BYTE_BINARY. + * Background color is set to Color.magenta. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageTypeByteBinaryBackgroundMagenta(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageTypeByteBinary(image, graphics2d, Color.magenta); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_BYTE_BINARY. + * Background color is set to Color.yellow. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageTypeByteBinaryBackgroundYellow(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageTypeByteBinary(image, graphics2d, Color.yellow); + } + + /** + * Test basic BitBlt operation for empty buffered image with type TYPE_BYTE_BINARY. + * Background color is set to Color.white. + * + * @param image + * image to used as a destination for BitBlt-type operations + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testBitBltEmptyBufferedImageTypeByteBinaryBackgroundWhite(TestImage image, Graphics2D graphics2d) + { + return doBitBltEmptyBufferedImageTypeByteBinary(image, graphics2d, Color.white); + } + + /** * Entry point to the test suite. * * @param args not used in this case From ptisnovs at icedtea.classpath.org Wed Feb 6 01:26:46 2013 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Wed, 06 Feb 2013 09:26:46 +0000 Subject: /hg/rhino-tests: Four new tests added into this test suite: test... Message-ID: changeset a9f65433ce81 in /hg/rhino-tests details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=a9f65433ce81 author: Pavel Tisnovsky date: Wed Feb 06 10:29:46 2013 +0100 Four new tests added into this test suite: testGetClasses(), testGetDeclaredClasses(), testGetComponentType() and testGetAnnotation(). diffstat: ChangeLog | 7 ++++ src/org/RhinoTests/InvocableClassTest.java | 49 ++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 0 deletions(-) diffs (73 lines): diff -r 3a438f8082f6 -r a9f65433ce81 ChangeLog --- a/ChangeLog Tue Feb 05 11:08:40 2013 +0100 +++ b/ChangeLog Wed Feb 06 10:29:46 2013 +0100 @@ -1,3 +1,10 @@ +2013-02-06 Pavel Tisnovsky + + * src/org/RhinoTests/InvocableClassTest.java: + Four new tests added into this test suite: testGetClasses(), + testGetDeclaredClasses(), testGetComponentType() and + testGetAnnotation(). + 2013-02-05 Pavel Tisnovsky * src/org/RhinoTests/SimpleScriptContextClassTest.java: diff -r 3a438f8082f6 -r a9f65433ce81 src/org/RhinoTests/InvocableClassTest.java --- a/src/org/RhinoTests/InvocableClassTest.java Tue Feb 05 11:08:40 2013 +0100 +++ b/src/org/RhinoTests/InvocableClassTest.java Wed Feb 06 10:29:46 2013 +0100 @@ -568,6 +568,55 @@ } /** + * Test for method javax.script.Invocable.getClass().getAnnotation() + */ + protected void testGetAnnotation() { + Annotation annotation; + annotation = this.invocableClass.getAnnotation(java.lang.annotation.Annotation.class); + assertNull(annotation, "annotation java.lang.annotation.Annotation should not be returned"); + annotation = this.invocableClass.getAnnotation(java.lang.annotation.Documented.class); + assertNull(annotation, "annotation java.lang.annotation.Documented should not be returned"); + annotation = this.invocableClass.getAnnotation(java.lang.annotation.Inherited.class); + assertNull(annotation, "annotation java.lang.annotation.Inherited should not be returned"); + annotation = this.invocableClass.getAnnotation(java.lang.annotation.Retention.class); + assertNull(annotation, "annotation java.lang.annotation.Retention should not be returned"); + annotation = this.invocableClass.getAnnotation(java.lang.annotation.Target.class); + assertNull(annotation, "annotation java.lang.annotation.Target should not be returned"); + annotation = this.invocableClass.getAnnotation(java.lang.Deprecated.class); + assertNull(annotation, "annotation java.lang.Deprecated should not be returned"); + annotation = this.invocableClass.getAnnotation(java.lang.Override.class); + assertNull(annotation, "annotation java.lang.Override should not be returned"); + annotation = this.invocableClass.getAnnotation(java.lang.SuppressWarnings.class); + assertNull(annotation, "annotation java.lang.SuppressWarnings should not be returned"); + } + + /** + * Test for method javax.script.Invocable.getClass().getComponentType() + */ + protected void testGetComponentType() { + Class cls = this.invocableClass.getComponentType(); + assertNull(cls, "getComponentType() should returns null"); + } + + /** + * Test for method javax.script.Invocable.getClass().getClasses() + */ + protected void testGetClasses() { + Class[] cls = this.invocableClass.getClasses(); + assertNotNull(cls, "getClasses() returns null"); + assertEquals(cls.length, 0, "getClasses() returns wrong value!"); + } + + /** + * Test for method javax.script.Invocable.getClass().getDeclaredClasses() + */ + protected void testGetDeclaredClasses() { + Class[] cls = this.invocableClass.getDeclaredClasses(); + assertNotNull(cls, "getDeclaredClasses() returns null"); + assertEquals(cls.length, 0, "getDeclaredClasses() returns wrong value!"); + } + + /** * Test for instanceof operator applied to a class javax.script.Invocable */ @SuppressWarnings("cast") From jvanek at redhat.com Wed Feb 6 03:34:49 2013 From: jvanek at redhat.com (Jiri Vanek) Date: Wed, 06 Feb 2013 12:34:49 +0100 Subject: [rfc][icedtea-web] Ensure applet shutdown finishes without exceptions - 1 - npe In-Reply-To: <51113770.307@redhat.com> References: <510AEAC0.2010104@redhat.com> <510B8851.80604@redhat.com> <51113770.307@redhat.com> Message-ID: <51123FD9.5030407@redhat.com> On 02/05/2013 05:46 PM, Adam Domurad wrote: > On 02/01/2013 04:18 AM, Jiri Vanek wrote: >> On 01/31/2013 11:05 PM, Adam Domurad wrote: >>> Hi all. Another round of what I think could be important stability fixes for icedtea-web. >>> >>> I noticed while doing my unsigned-applet-confirmation patch that JNLPClassLoader instances did >>> not always reach reference-count == 0 when all their instances should have been destroyed. The >>> first part of that was the applet synchronization issue, that I have posted a patch for. >>> >>> 3 additional problems fixed here: >>> >>> Fixed in npe-fix-and-wait-for-init.patch: >>> 1.) There was a sometimes-occurring NPE in JNLPClassLoader#getPermisions, when a CodeSource did >>> not have an associated location when an applet was destroyed. This could cause the destroyApplet >>> code to not finish. This was fixed with a simple null check guard. This fixes some spurious >>> exceptions being printed out during shutdown (causing some noise in reproducer system). >>> >>> 2.) Applets can actually be destroyed from one thread *in the middle of initialization*, while >>> somewhat hard to reproduce, spamming refresh on a many-applet page inevitably caused it. Luckily >>> a mechanism was already in place for efficiently waiting for applets to initialize. >>> >>> >>> npe-fix-and-wait-for-init.patch changes: >>> 2013-XX-XX Adam Domurad >>> >>> Ensure applet destruction cannot in the middle of initialization. >>> Prevent NPE that can sometimes occurs (especially with this change). >>> * netx/net/sourceforge/jnlp/NetxPanel.java >>> (destroyApplet): wait for applet initialization >>> * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java >>> (getPermissions): avoid potential NPE if code source location is >>> missing >>> >> >>> >>> >>> npe-fix-and-wait-for-init.patch >>> >>> >>> diff --git a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java >>> b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java >>> --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java >>> +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java >>> @@ -1144,7 +1144,7 @@ public class JNLPClassLoader extends URL >>> } >>> >>> // Class from host X should be allowed to connect to host X >>> - if (cs.getLocation().getHost().length()> 0) >>> + if (cs.getLocation() != null&& cs.getLocation().getHost().length()> 0) >> >> Here I'm curious, is NPE here because location was not yet initalised, have no chance to get >> in, its initialisation was corrupted, or is NPE here because its it wa forgotten to be assigned or >> its creation was somehow skipped? >> >> It it is first case then I'm for NPE guard. >> If it is the second then I'm against, because the consequence is healed and the cause will be >> rotten later. However still the NPE guard can be last and only hope. > > I'll admit I don't know the exact situation that causes this, but it only occurred during shutdown. > Seeing as I can't reproduce it ATM I'm fine having this or not, but I don't think it would hide any > problems. I was afraid there will be reply like this :( If it have sense to push alone, please go on. The part two still eed confirmation from Pavel. > >> >>> result.add(new SocketPermission(cs.getLocation().getHost(), >>> "connect, accept")); >>> >>> diff --git a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java >>> b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java >>> --- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java >>> +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java >>> @@ -587,6 +587,10 @@ public class PluginAppletViewer extends >>> >>> private static synchronized void destroyApplet(int identifier) { >>> >>> + // We should not try to destroy an applet during >>> + // initialization. It may cause an inconsistent state. >>> + waitForAppletInit( applets.get(identifier).panel ); >> >> Ok, this have sense. >>> + >>> PluginDebug.debug("DestroyApplet called for ", identifier); >>> >>> PAV_INIT_STATUS prev = updateStatus(identifier, PAV_INIT_STATUS.DESTROYED); >>> > > -Adam From jvanek at redhat.com Wed Feb 6 03:38:31 2013 From: jvanek at redhat.com (Jiri Vanek) Date: Wed, 06 Feb 2013 12:38:31 +0100 Subject: [rfc][icedtea-web] tests for hanging firefox In-Reply-To: <5111424B.9020507@redhat.com> References: <510A71A2.4090404@redhat.com> <5111424B.9020507@redhat.com> Message-ID: <511240B7.3080308@redhat.com> On 02/05/2013 06:32 PM, Adam Domurad wrote: > On 01/31/2013 08:29 AM, Jiri Vanek wrote: >> Following tests are testing now fixed, hanging of firefox after the LaunchExceeption. >> To achieve this I have missused AddShutDown test. It was one of the most stable test... So I'm >> looking forward how my changes will destabilize it :) (not expected!) >> >> 2013-01-31 Jiri Vanek >> >> Added test for hanging firefox by LaunchException and Improved AddShutdownHookTest >> * tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook.html: >> new file to launch applet with RuntimeException as result. >> * tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook_wrong.html: >> new file to launch applet with LaunchException as result. >> * tests/reproducers/simple/AddShutdownHook/srcs/AddShutdownHook.java: is >> now also applet. >> * tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java: >> Added test (AddShutdownHookApplet)for applet, removed duplicate code by rules. >> * tests/reproducers/simple/AddShutdownHook/testcases/HangFirefoxTests.java: >> New test set which is launching exception throwing applet, and after exception >> is thrown then it tries jsut stdou-ing applet. Second applet have to be >> launched. > > Thanks very much for tackling the test! It seems to work well, when firefox does hang. > > Some thoughts: > - Does the test fail for you before my fix ? I have to apply also my 'pseudo-reproducer' to coax it > to hang. Nope :(( On my old f14 jdk6 it si hanging always, on my second 10.34.2.200 miraculous machine it is always passing. > - If this test ever does come up as a failure it will probably be necessary to apply this patch to > properly diagnose it, as it seems it can pass/fail randomly. It it will START to fail then we will at least know when this happened. (well idea connected more to daily report then to anything else). Eg some of the freezing problems just occurred :/ And now after several month we have no idea when :( I hope this test can track it. > > Patch: > >> diff -r e631770d76ba tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook.html >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook.html Thu Jan 31 14:26:40 >> 2013 +0100 >> @@ -0,0 +1,42 @@ >> + >> + >> +

> height="600"> >> +

>> + >> + >> \ No newline at end of file >> diff -r e631770d76ba tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook_wrong.html >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook_wrong.html Thu Jan 31 >> 14:26:40 2013 +0100 >> @@ -0,0 +1,42 @@ >> + >> + >> +

> height="600"> > > Nit: s/Exisitng/Existing/ > >> +

>> + >> + >> \ No newline at end of file >> diff -r e631770d76ba tests/reproducers/simple/AddShutdownHook/srcs/AddShutdownHook.java >> --- a/tests/reproducers/simple/AddShutdownHook/srcs/AddShutdownHook.java Thu Jan 31 11:12:35 2013 >> +0100 >> +++ b/tests/reproducers/simple/AddShutdownHook/srcs/AddShutdownHook.java Thu Jan 31 14:26:40 2013 >> +0100 >> @@ -1,3 +1,6 @@ >> + >> +import java.applet.Applet; >> + >> /* AddShutdownHook.java >> Copyright (C) 2011 Red Hat, Inc. >> >> @@ -35,7 +38,7 @@ >> exception statement from your version. >> */ >> >> -public class AddShutdownHook { >> +public class AddShutdownHook extends Applet { >> public static void main(String[] args) { >> >> Runtime.getRuntime().addShutdownHook(new Thread() { >> @@ -45,4 +48,11 @@ >> }); >> >> } >> + >> + @Override >> + public void start() { >> + main(null); >> + } >> + >> + >> } >> diff -r e631770d76ba tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java >> --- a/tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java Thu Jan 31 >> 11:12:35 2013 +0100 >> +++ b/tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java Thu Jan 31 >> 14:26:40 2013 +0100 >> @@ -1,58 +1,74 @@ >> /* AddShutdownHookTest.java >> -Copyright (C) 2011 Red Hat, Inc. >> + Copyright (C) 2011 Red Hat, Inc. >> >> -This file is part of IcedTea. >> + 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 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. >> + 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. >> + 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. >> + 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. >> + 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. >> */ >> >> -import net.sourceforge.jnlp.ServerAccess; >> +import net.sourceforge.jnlp.ClosingListener; >> +import net.sourceforge.jnlp.ProcessResult; >> +import net.sourceforge.jnlp.annotations.TestInBrowsers; >> +import net.sourceforge.jnlp.browsertesting.BrowserTest; >> +import net.sourceforge.jnlp.browsertesting.Browsers; >> +import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; >> +import net.sourceforge.jnlp.closinglisteners.StringMatchClosingListener; >> import org.junit.Assert; >> >> import org.junit.Test; >> >> -public class AddShutdownHookTest { >> +public class AddShutdownHookTest extends BrowserTest { >> >> - private static ServerAccess server = new ServerAccess(); >> + public static final String s = "(?s).*java.security.AccessControlException.{0,5}access >> denied.{0,5}java.lang.RuntimePermission.{0,5}" + "shutdownHooks" + ".*"; >> + public static final String cnfString = "ClassNotFoundException"; >> + public static final RulesFolowingClosingListener.MatchesRule mr = new >> RulesFolowingClosingListener.MatchesRule(s); >> + public static final RulesFolowingClosingListener.ContainsRule cnf = new >> RulesFolowingClosingListener.ContainsRule(cnfString); >> + public static final RulesFolowingClosingListener rfc = new RulesFolowingClosingListener(mr); >> >> @Test >> public void AddShutdownHookTestLunch1() throws Exception { >> - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/AddShutdownHook.jnlp"); >> - String s = "(?s).*java.security.AccessControlException.{0,5}access >> denied.{0,5}java.lang.RuntimePermission.{0,5}" + "shutdownHooks" + ".*"; >> - Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s)); >> - String cc="ClassNotFoundException"; >> - Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc)); >> - Assert.assertFalse("stdout length should be <=2, but was >> "+pr.stdout.length(),pr.stdout.length()>2); >> - Assert.assertFalse("AddShutdownHookTestLunch1 should not be terminated, but >> was",pr.wasTerminated); >> + ProcessResult pr = server.executeJavawsHeadless(null, "/AddShutdownHook.jnlp"); >> + Assert.assertTrue("stderr " + mr.toPassingString(), mr.evaluate(pr.stderr)); >> + Assert.assertFalse("stderr " + cnf.toFailingString(), cnf.evaluate(pr.stderr)); >> + Assert.assertFalse("stdout length should be <=2, but was " + pr.stdout.length(), >> pr.stdout.length() > 2); >> + Assert.assertFalse("AddShutdownHookTestLunch1 should not be terminated, but was", >> pr.wasTerminated); >> Assert.assertEquals((Integer) 0, pr.returnValue); >> } >> + >> + @Test >> + @TestInBrowsers(testIn = Browsers.one) >> + public void AddShutdownHookApplet() throws Exception { >> + ProcessResult pr = server.executeBrowser("/AddShutdownHook.html", null, rfc); >> + Assert.assertTrue("stderr " + mr.toPassingString(), mr.evaluate(pr.stderr)); >> + Assert.assertFalse("stderr " + cnf.toFailingString(), cnf.evaluate(pr.stderr)); >> + } >> } >> diff -r e631770d76ba tests/reproducers/simple/AddShutdownHook/testcases/HangFirefoxTests.java >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/tests/reproducers/simple/AddShutdownHook/testcases/HangFirefoxTests.java Thu Jan 31 >> 14:26:40 2013 +0100 >> @@ -0,0 +1,111 @@ >> +/* AddShutdownHookTest.java >> + Copyright (C) 2011 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. >> + */ >> + >> +import net.sourceforge.jnlp.ProcessResult; >> +import net.sourceforge.jnlp.annotations.TestInBrowsers; >> +import net.sourceforge.jnlp.browsertesting.BrowserTest; >> +import net.sourceforge.jnlp.browsertesting.Browsers; >> +import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; >> +import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; >> +import org.junit.Assert; >> + >> +import org.junit.Test; >> + >> +public class HangFirefoxTests extends BrowserTest { >> + >> + String leString = "LaunchException"; >> + ; >> + String startedString = "applet was started"; >> + RulesFolowingClosingListener.ContainsRule leRule = new >> RulesFolowingClosingListener.ContainsRule(leString); >> + RulesFolowingClosingListener.ContainsRule appleStartedRule = new >> RulesFolowingClosingListener.ContainsRule(startedString); >> + >> + @Test >> + @TestInBrowsers(testIn = Browsers.firefox) >> + public void HangFirefoxWithRuntimeExceptionTests() throws Exception { >> + ProcessResult pr = server.executeBrowser("/AddShutdownHook.html", new >> RulesFolowingClosingListener(appleStartedRule), new CountingClosingListener() { >> + private boolean launched = false; >> + >> + @Override >> + protected boolean isAlowedToFinish(String content) { > > s/Alowed/Allowed/ > >> + if (AddShutdownHookTest.mr.evaluate(content) && !launched) { >> + launched = true; >> + try { >> + server.executeBrowser("/appletAutoTests2.html", null, (CountingClosingListener) null); >> + } catch (Exception ex) { >> + throw new RuntimeException(ex); >> + } >> + } >> + return false; >> + } >> + }); >> + Assert.assertTrue("stderr " + AddShutdownHookTest.mr.toPassingString(), >> AddShutdownHookTest.mr.evaluate(pr.stderr)); >> + Assert.assertTrue("stdout " + appleStartedRule.toPassingString(), >> appleStartedRule.evaluate(pr.stdout)); >> + Assert.assertFalse("stderr " + AddShutdownHookTest.cnf.toFailingString(), >> AddShutdownHookTest.cnf.evaluate(pr.stderr)); >> + } >> + >> + @Test >> + @TestInBrowsers(testIn = Browsers.firefox) >> + public void HangFirefoxWithLaunchException() throws Exception { >> + ProcessResult pr = server.executeBrowser("/AddShutdownHook_wrong.html", new >> RulesFolowingClosingListener(appleStartedRule), new CountingClosingListener() { >> + private boolean launched = false; >> + >> + @Override >> + protected boolean isAlowedToFinish(String content) { > > s/Alowed/Allowed/ > >> + if (leRule.evaluate(content) && !launched) { >> + launched = true; >> + try { >> + server.executeBrowser("/appletAutoTests2.html", null, (CountingClosingListener) null); >> + } catch (Exception ex) { >> + throw new RuntimeException(ex); >> + } >> + } >> + return false; >> + } >> + }); >> + Assert.assertTrue("stderr " + leRule.toPassingString(), leRule.evaluate(pr.stderr)); >> + Assert.assertTrue("stdout " + appleStartedRule.toPassingString(), >> appleStartedRule.evaluate(pr.stdout)); >> + Assert.assertFalse("stderr " + AddShutdownHookTest.cnf.toFailingString(), >> AddShutdownHookTest.cnf.evaluate(pr.stderr)); >> + } >> + >> + @Test >> + @TestInBrowsers(testIn = Browsers.one) >> + public void TestAddShutdownHookWrong() throws Exception { >> + ProcessResult pr = server.executeBrowser("/AddShutdownHook_wrong.html", null, new >> RulesFolowingClosingListener(leRule)); >> + Assert.assertTrue("stderr " + leRule.toPassingString(), leRule.evaluate(pr.stderr)); >> + Assert.assertFalse("stderr " + AddShutdownHookTest.cnf.toFailingString(), >> AddShutdownHookTest.cnf.evaluate(pr.stderr)); >> + } >> +} > Thanx for the nits, will be fixec. > Otherwise looks good for HEAD. Maybe add a comment somewhere in the reproducer that says eg > > "If this test has failed, you may try the following to reproduce the problem more consistently: > - private static final int MAX_WORKERS = MAX_PARALLEL_INITS * 4; > - private static final int PRIORITY_WORKERS = MAX_PARALLEL_INITS * 2; > + private static final int MAX_WORKERS = MAX_PARALLEL_INITS * 2; > + private static final int PRIORITY_WORKERS = MAX_PARALLEL_INITS * 1; > in PluginMessageConsumer.java" Great idea. Will do! Still ok to push? > > -Adam From jvanek at redhat.com Wed Feb 6 03:40:10 2013 From: jvanek at redhat.com (Jiri Vanek) Date: Wed, 06 Feb 2013 12:40:10 +0100 Subject: [rfc][icedtea-web] Provide names for all unnamed threads In-Reply-To: <51112967.7010406@redhat.com> References: <510AE6DF.8000408@redhat.com> <510B7E82.6080508@redhat.com> <51112967.7010406@redhat.com> Message-ID: <5112411A.2090207@redhat.com> On 02/05/2013 04:46 PM, Adam Domurad wrote: > On 02/01/2013 03:36 AM, Jiri Vanek wrote: >> On 01/31/2013 10:49 PM, Adam Domurad wrote: >>> Simple patch, but very nice for debugging/ tooling. This will make it easier to track down >>> specific threads while debugging or using Thermostat. An absolute must IMO for sane debugging of >>> problems occurring in multiple threads. >> >> Agree, after one question patch is ok for head and should go also to branches to avoid future >> patching conflicts. > > I will push as-is, OK ? yy., > >>> >>> 2013-XX-XX Adam Domurad >>> >>> Name threads for easier debugging/tooling. Remove 2 erroneous >>> VoidPluginCallRequest header comments. >>> * netx/net/sourceforge/jnlp/NetxPanel.java: >>> Provide name for thread that calls (run). >>> * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: >>> Provide name for shutdown hook thread. >>> * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java: >>> Remove erroneous VoidPluginCallRequest comment. Provide name for >>> ConsumerThread thread. >>> * plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java: >>> Provide name for worker thread. >>> * plugin/icedteanp/java/sun/applet/PluginStreamHandler.java: >>> Remove erroneous VoidPluginCallRequest comment. Provide name for >>> stream listener thread. >>> >> ... >> >>> +++ b/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java >>> @@ -1,4 +1,4 @@ >>> -/* VoidPluginCallRequest -- represent Java-to-JavaScript requests >>> +/* >> VoidPluginCallRequest is supicious, >> >> However this, represent Java-to-JavaScript requests looks like it could be right. Asking just for >> clarification. as it can be useful if it is correct. > > This is definitely not right, it is a comment meant for another class. > PluginMessageConsumer is not javascript specific nor does it 'represent requests'. > >> >>> Copyright (C) 2008 Red Hat >>> >>> This file is part of IcedTea. >>> @@ -131,6 +131,10 @@ class PluginMessageConsumer { >>> >>> protected class ConsumerThread extends Thread { >>> >>> + public ConsumerThread() { >>> + super("PluginMessageConsumer.ConsumerThread"); >>> + } >>> + >> >> J. > > -Adam From adomurad at redhat.com Wed Feb 6 05:55:49 2013 From: adomurad at redhat.com (Adam Domurad) Date: Wed, 06 Feb 2013 08:55:49 -0500 Subject: [rfc][icedtea-web] tests for hanging firefox In-Reply-To: <511240B7.3080308@redhat.com> References: <510A71A2.4090404@redhat.com> <5111424B.9020507@redhat.com> <511240B7.3080308@redhat.com> Message-ID: <511260E5.6060006@redhat.com> On 02/06/2013 06:38 AM, Jiri Vanek wrote: > On 02/05/2013 06:32 PM, Adam Domurad wrote: >> On 01/31/2013 08:29 AM, Jiri Vanek wrote: >>> Following tests are testing now fixed, hanging of firefox after the >>> LaunchExceeption. >>> To achieve this I have missused AddShutDown test. It was one of the >>> most stable test... So I'm >>> looking forward how my changes will destabilize it :) (not expected!) >>> >>> 2013-01-31 Jiri Vanek >>> >>> Added test for hanging firefox by LaunchException and Improved >>> AddShutdownHookTest >>> * >>> tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook.html: >>> >>> new file to launch applet with RuntimeException as result. >>> * >>> tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook_wrong.html: >>> new file to launch applet with LaunchException as result. >>> * >>> tests/reproducers/simple/AddShutdownHook/srcs/AddShutdownHook.java: is >>> now also applet. >>> * >>> tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java: >>> Added test (AddShutdownHookApplet)for applet, removed duplicate >>> code by rules. >>> * >>> tests/reproducers/simple/AddShutdownHook/testcases/HangFirefoxTests.java: >>> New test set which is launching exception throwing applet, and >>> after exception >>> is thrown then it tries jsut stdou-ing applet. Second applet >>> have to be >>> launched. >> >> Thanks very much for tackling the test! It seems to work well, when >> firefox does hang. >> >> Some thoughts: >> - Does the test fail for you before my fix ? I have to apply also my >> 'pseudo-reproducer' to coax it >> to hang. > > Nope :(( On my old f14 jdk6 it si hanging always, on my second > 10.34.2.200 miraculous machine it is always passing. > >> - If this test ever does come up as a failure it will probably be >> necessary to apply this patch to >> properly diagnose it, as it seems it can pass/fail randomly. > > It it will START to fail then we will at least know when this > happened. (well idea connected more to daily report then to anything > else). Eg some of the freezing problems just occurred :/ And now after > several month we have no idea when :( > I hope this test can track it. >> >> Patch: >> >>> diff -r e631770d76ba >>> tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook.html >>> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >>> +++ >>> b/tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook.html >>> Thu Jan 31 14:26:40 >>> 2013 +0100 >>> @@ -0,0 +1,42 @@ >>> + >>> + >>> +

>> archive="AddShutdownHook.jar" codebase="." width="800" >>> height="600"> >>> +

>>> + >>> + >>> \ No newline at end of file >>> diff -r e631770d76ba >>> tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook_wrong.html >>> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >>> +++ >>> b/tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook_wrong.html >>> Thu Jan 31 >>> 14:26:40 2013 +0100 >>> @@ -0,0 +1,42 @@ >>> + >>> + >>> +

>> archive="NotExisitngArchive.jar" codebase="." width="800" >>> height="600"> >> >> Nit: s/Exisitng/Existing/ >> >>> +

>>> + >>> + >>> \ No newline at end of file >>> diff -r e631770d76ba >>> tests/reproducers/simple/AddShutdownHook/srcs/AddShutdownHook.java >>> --- >>> a/tests/reproducers/simple/AddShutdownHook/srcs/AddShutdownHook.java >>> Thu Jan 31 11:12:35 2013 >>> +0100 >>> +++ >>> b/tests/reproducers/simple/AddShutdownHook/srcs/AddShutdownHook.java >>> Thu Jan 31 14:26:40 2013 >>> +0100 >>> @@ -1,3 +1,6 @@ >>> + >>> +import java.applet.Applet; >>> + >>> /* AddShutdownHook.java >>> Copyright (C) 2011 Red Hat, Inc. >>> >>> @@ -35,7 +38,7 @@ >>> exception statement from your version. >>> */ >>> >>> -public class AddShutdownHook { >>> +public class AddShutdownHook extends Applet { >>> public static void main(String[] args) { >>> >>> Runtime.getRuntime().addShutdownHook(new Thread() { >>> @@ -45,4 +48,11 @@ >>> }); >>> >>> } >>> + >>> + @Override >>> + public void start() { >>> + main(null); >>> + } >>> + >>> + >>> } >>> diff -r e631770d76ba >>> tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java >>> --- >>> a/tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java >>> Thu Jan 31 >>> 11:12:35 2013 +0100 >>> +++ >>> b/tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java >>> Thu Jan 31 >>> 14:26:40 2013 +0100 >>> @@ -1,58 +1,74 @@ >>> /* AddShutdownHookTest.java >>> -Copyright (C) 2011 Red Hat, Inc. >>> + Copyright (C) 2011 Red Hat, Inc. >>> >>> -This file is part of IcedTea. >>> + 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 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. >>> + 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. >>> + 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. >>> + 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. >>> + 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. >>> */ >>> >>> -import net.sourceforge.jnlp.ServerAccess; >>> +import net.sourceforge.jnlp.ClosingListener; >>> +import net.sourceforge.jnlp.ProcessResult; >>> +import net.sourceforge.jnlp.annotations.TestInBrowsers; >>> +import net.sourceforge.jnlp.browsertesting.BrowserTest; >>> +import net.sourceforge.jnlp.browsertesting.Browsers; >>> +import >>> net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; >>> +import >>> net.sourceforge.jnlp.closinglisteners.StringMatchClosingListener; >>> import org.junit.Assert; >>> >>> import org.junit.Test; >>> >>> -public class AddShutdownHookTest { >>> +public class AddShutdownHookTest extends BrowserTest { >>> >>> - private static ServerAccess server = new ServerAccess(); >>> + public static final String s = >>> "(?s).*java.security.AccessControlException.{0,5}access >>> denied.{0,5}java.lang.RuntimePermission.{0,5}" + "shutdownHooks" + >>> ".*"; >>> + public static final String cnfString = "ClassNotFoundException"; >>> + public static final RulesFolowingClosingListener.MatchesRule mr >>> = new >>> RulesFolowingClosingListener.MatchesRule(s); >>> + public static final RulesFolowingClosingListener.ContainsRule >>> cnf = new >>> RulesFolowingClosingListener.ContainsRule(cnfString); >>> + public static final RulesFolowingClosingListener rfc = new >>> RulesFolowingClosingListener(mr); >>> >>> @Test >>> public void AddShutdownHookTestLunch1() throws Exception { >>> - ServerAccess.ProcessResult pr = >>> server.executeJavawsHeadless(null, "/AddShutdownHook.jnlp"); >>> - String s = >>> "(?s).*java.security.AccessControlException.{0,5}access >>> denied.{0,5}java.lang.RuntimePermission.{0,5}" + "shutdownHooks" + >>> ".*"; >>> - Assert.assertTrue("stderr should match "+s+" but >>> didn't",pr.stderr.matches(s)); >>> - String cc="ClassNotFoundException"; >>> - Assert.assertFalse("stderr should NOT contains `"+cc+"`, >>> but did",pr.stderr.contains(cc)); >>> - Assert.assertFalse("stdout length should be <=2, but was >>> "+pr.stdout.length(),pr.stdout.length()>2); >>> - Assert.assertFalse("AddShutdownHookTestLunch1 should not be >>> terminated, but >>> was",pr.wasTerminated); >>> + ProcessResult pr = server.executeJavawsHeadless(null, >>> "/AddShutdownHook.jnlp"); >>> + Assert.assertTrue("stderr " + mr.toPassingString(), >>> mr.evaluate(pr.stderr)); >>> + Assert.assertFalse("stderr " + cnf.toFailingString(), >>> cnf.evaluate(pr.stderr)); >>> + Assert.assertFalse("stdout length should be <=2, but was " >>> + pr.stdout.length(), >>> pr.stdout.length() > 2); >>> + Assert.assertFalse("AddShutdownHookTestLunch1 should not be >>> terminated, but was", >>> pr.wasTerminated); >>> Assert.assertEquals((Integer) 0, pr.returnValue); >>> } >>> + >>> + @Test >>> + @TestInBrowsers(testIn = Browsers.one) >>> + public void AddShutdownHookApplet() throws Exception { >>> + ProcessResult pr = >>> server.executeBrowser("/AddShutdownHook.html", null, rfc); >>> + Assert.assertTrue("stderr " + mr.toPassingString(), >>> mr.evaluate(pr.stderr)); >>> + Assert.assertFalse("stderr " + cnf.toFailingString(), >>> cnf.evaluate(pr.stderr)); >>> + } >>> } >>> diff -r e631770d76ba >>> tests/reproducers/simple/AddShutdownHook/testcases/HangFirefoxTests.java >>> >>> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >>> +++ >>> b/tests/reproducers/simple/AddShutdownHook/testcases/HangFirefoxTests.java >>> Thu Jan 31 >>> 14:26:40 2013 +0100 >>> @@ -0,0 +1,111 @@ >>> +/* AddShutdownHookTest.java >>> + Copyright (C) 2011 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. >>> + */ >>> + >>> +import net.sourceforge.jnlp.ProcessResult; >>> +import net.sourceforge.jnlp.annotations.TestInBrowsers; >>> +import net.sourceforge.jnlp.browsertesting.BrowserTest; >>> +import net.sourceforge.jnlp.browsertesting.Browsers; >>> +import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; >>> +import >>> net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; >>> +import org.junit.Assert; >>> + >>> +import org.junit.Test; >>> + >>> +public class HangFirefoxTests extends BrowserTest { >>> + >>> + String leString = "LaunchException"; >>> + ; >>> + String startedString = "applet was started"; >>> + RulesFolowingClosingListener.ContainsRule leRule = new >>> RulesFolowingClosingListener.ContainsRule(leString); >>> + RulesFolowingClosingListener.ContainsRule appleStartedRule = new >>> RulesFolowingClosingListener.ContainsRule(startedString); >>> + >>> + @Test >>> + @TestInBrowsers(testIn = Browsers.firefox) >>> + public void HangFirefoxWithRuntimeExceptionTests() throws >>> Exception { >>> + ProcessResult pr = >>> server.executeBrowser("/AddShutdownHook.html", new >>> RulesFolowingClosingListener(appleStartedRule), new >>> CountingClosingListener() { >>> + private boolean launched = false; >>> + >>> + @Override >>> + protected boolean isAlowedToFinish(String content) { >> >> s/Alowed/Allowed/ >> >>> + if (AddShutdownHookTest.mr.evaluate(content) && >>> !launched) { >>> + launched = true; >>> + try { >>> + server.executeBrowser("/appletAutoTests2.html", null, >>> (CountingClosingListener) null); >>> + } catch (Exception ex) { >>> + throw new RuntimeException(ex); >>> + } >>> + } >>> + return false; >>> + } >>> + }); >>> + Assert.assertTrue("stderr " + >>> AddShutdownHookTest.mr.toPassingString(), >>> AddShutdownHookTest.mr.evaluate(pr.stderr)); >>> + Assert.assertTrue("stdout " + >>> appleStartedRule.toPassingString(), >>> appleStartedRule.evaluate(pr.stdout)); >>> + Assert.assertFalse("stderr " + >>> AddShutdownHookTest.cnf.toFailingString(), >>> AddShutdownHookTest.cnf.evaluate(pr.stderr)); >>> + } >>> + >>> + @Test >>> + @TestInBrowsers(testIn = Browsers.firefox) >>> + public void HangFirefoxWithLaunchException() throws Exception { >>> + ProcessResult pr = >>> server.executeBrowser("/AddShutdownHook_wrong.html", new >>> RulesFolowingClosingListener(appleStartedRule), new >>> CountingClosingListener() { >>> + private boolean launched = false; >>> + >>> + @Override >>> + protected boolean isAlowedToFinish(String content) { >> >> s/Alowed/Allowed/ >> >>> + if (leRule.evaluate(content) && !launched) { >>> + launched = true; >>> + try { >>> + server.executeBrowser("/appletAutoTests2.html", null, >>> (CountingClosingListener) null); >>> + } catch (Exception ex) { >>> + throw new RuntimeException(ex); >>> + } >>> + } >>> + return false; >>> + } >>> + }); >>> + Assert.assertTrue("stderr " + leRule.toPassingString(), >>> leRule.evaluate(pr.stderr)); >>> + Assert.assertTrue("stdout " + >>> appleStartedRule.toPassingString(), >>> appleStartedRule.evaluate(pr.stdout)); >>> + Assert.assertFalse("stderr " + >>> AddShutdownHookTest.cnf.toFailingString(), >>> AddShutdownHookTest.cnf.evaluate(pr.stderr)); >>> + } >>> + >>> + @Test >>> + @TestInBrowsers(testIn = Browsers.one) >>> + public void TestAddShutdownHookWrong() throws Exception { >>> + ProcessResult pr = >>> server.executeBrowser("/AddShutdownHook_wrong.html", null, new >>> RulesFolowingClosingListener(leRule)); >>> + Assert.assertTrue("stderr " + leRule.toPassingString(), >>> leRule.evaluate(pr.stderr)); >>> + Assert.assertFalse("stderr " + >>> AddShutdownHookTest.cnf.toFailingString(), >>> AddShutdownHookTest.cnf.evaluate(pr.stderr)); >>> + } >>> +} >> > > Thanx for the nits, will be fixec. > >> Otherwise looks good for HEAD. Maybe add a comment somewhere in the >> reproducer that says eg >> >> "If this test has failed, you may try the following to reproduce the >> problem more consistently: >> - private static final int MAX_WORKERS = MAX_PARALLEL_INITS * 4; >> - private static final int PRIORITY_WORKERS = MAX_PARALLEL_INITS * 2; >> + private static final int MAX_WORKERS = MAX_PARALLEL_INITS * 2; >> + private static final int PRIORITY_WORKERS = MAX_PARALLEL_INITS * 1; >> in PluginMessageConsumer.java" > > Great idea. Will do! > > Still ok to push? Yes, please do. -Adam >> >> -Adam > From bugzilla-daemon at icedtea.classpath.org Wed Feb 6 05:58:57 2013 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 06 Feb 2013 13:58:57 +0000 Subject: [Bug 1298] New: LiveConnect - problem setting array elements (applet variables) from JS Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1298 Bug ID: 1298 Summary: LiveConnect - problem setting array elements (applet variables) from JS Classification: Unclassified Product: IcedTea-Web Version: hg Hardware: x86_64 OS: Linux Status: NEW Severity: normal Priority: P3 Component: Plugin Assignee: dbhole at redhat.com Reporter: jfabriko at redhat.com CC: unassigned at icedtea.classpath.org Created attachment 823 --> http://icedtea.classpath.org/bugzilla/attachment.cgi?id=823&action=edit HTML page, jnlp and applet code attached. When setting value of an element of applets array from JavaScript, the value on Java side remains on its previous value (tests AppletJSToJSet_intArrayElement_Test and AppletJSToJSet_DoubleArrayElement_Test in the reproducer http://icedtea.classpath.org/hg/icedtea-web/file/fd01cd1c2bbc/tests/reproducers/simple/JSToJSet). JavaScript code: var applet = document.getElementById('jstojSetApplet'); applet._intArray[0]=1; applet._DoubleArray[0]=1.1; Java applet: has two arrays public int[] _intArray = new int[1]; public Double[] _DoubleArray = new Double[10]; When the applet prints out new values of _intArray[0] and _DoubleArray[0], the output is 0 and null, but should be 1 and 1.1 (Opera 12.01). Error: Trying to add unsupported property on NPObject! occurs in Firefox 16.0.2 on this line of JS code: applet._intArray[0]=1; -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130206/8d41fd8f/attachment.html From bugzilla-daemon at icedtea.classpath.org Wed Feb 6 06:03:24 2013 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 06 Feb 2013 14:03:24 +0000 Subject: [Bug 1298] LiveConnect - problem setting array elements (applet variables) from JS In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1298 Deepak Bhole changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|dbhole at redhat.com |adomurad at redhat.com -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130206/af84f4e5/attachment.html From adomurad at icedtea.classpath.org Wed Feb 6 06:19:58 2013 From: adomurad at icedtea.classpath.org (adomurad at icedtea.classpath.org) Date: Wed, 06 Feb 2013 14:19:58 +0000 Subject: /hg/icedtea-web: Provide names for unnamed threads for better de... Message-ID: changeset ed4ecccd83e6 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=ed4ecccd83e6 author: Adam Domurad date: Wed Feb 06 09:18:38 2013 -0500 Provide names for unnamed threads for better debugging diffstat: ChangeLog | 17 ++++++++++ netx/net/sourceforge/jnlp/NetxPanel.java | 2 +- netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java | 2 +- plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java | 6 ++- plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java | 1 + plugin/icedteanp/java/sun/applet/PluginStreamHandler.java | 4 +- 6 files changed, 27 insertions(+), 5 deletions(-) diffs (97 lines): diff -r fd01cd1c2bbc -r ed4ecccd83e6 ChangeLog --- a/ChangeLog Tue Feb 05 09:51:44 2013 +0100 +++ b/ChangeLog Wed Feb 06 09:18:38 2013 -0500 @@ -1,3 +1,20 @@ +2013-02-06 Adam Domurad + + Name threads for easier debugging/tooling. Remove 2 erroneous + VoidPluginCallRequest header comments. + * netx/net/sourceforge/jnlp/NetxPanel.java: + Provide name for thread that calls (run). + * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: + Provide name for shutdown hook thread. + * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java: + Remove erroneous VoidPluginCallRequest comment. Provide name for + ConsumerThread thread. + * plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java: + Provide name for worker thread. + * plugin/icedteanp/java/sun/applet/PluginStreamHandler.java: + Remove erroneous VoidPluginCallRequest comment. Provide name for + stream listener thread. + 2013-02-03 Jiri Vanek Another renamed conflict file for case insensitive systems diff -r fd01cd1c2bbc -r ed4ecccd83e6 netx/net/sourceforge/jnlp/NetxPanel.java --- a/netx/net/sourceforge/jnlp/NetxPanel.java Tue Feb 05 09:51:44 2013 +0100 +++ b/netx/net/sourceforge/jnlp/NetxPanel.java Wed Feb 06 09:18:38 2013 -0500 @@ -181,7 +181,7 @@ } } - handler = new Thread(getThreadGroup(), this); + handler = new Thread(getThreadGroup(), this, "NetxPanelThread@" + this.documentURL); handler.start(); } diff -r fd01cd1c2bbc -r ed4ecccd83e6 netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Tue Feb 05 09:51:44 2013 +0100 +++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Wed Feb 06 09:18:38 2013 -0500 @@ -738,7 +738,7 @@ e.printStackTrace(); } - Runtime.getRuntime().addShutdownHook(new Thread() { + Runtime.getRuntime().addShutdownHook(new Thread("JNLPRuntimeShutdownHookThread") { public void run() { markNetxStopped(); CacheUtil.cleanCache(); diff -r fd01cd1c2bbc -r ed4ecccd83e6 plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java --- a/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java Tue Feb 05 09:51:44 2013 +0100 +++ b/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java Wed Feb 06 09:18:38 2013 -0500 @@ -1,4 +1,4 @@ -/* VoidPluginCallRequest -- represent Java-to-JavaScript requests +/* Copyright (C) 2008 Red Hat This file is part of IcedTea. @@ -131,6 +131,10 @@ protected class ConsumerThread extends Thread { + public ConsumerThread() { + super("PluginMessageConsumer.ConsumerThread"); + } + /** * Scans the readQueue for priority messages and brings them to the front */ diff -r fd01cd1c2bbc -r ed4ecccd83e6 plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java --- a/plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java Tue Feb 05 09:51:44 2013 +0100 +++ b/plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java Wed Feb 06 09:18:38 2013 -0500 @@ -50,6 +50,7 @@ PluginMessageConsumer consumer, PluginStreamHandler streamHandler, int id, boolean isPriorityWorker) { + super("PluginMessageHandlerWorker" + id); this.id = id; this.streamHandler = streamHandler; diff -r fd01cd1c2bbc -r ed4ecccd83e6 plugin/icedteanp/java/sun/applet/PluginStreamHandler.java --- a/plugin/icedteanp/java/sun/applet/PluginStreamHandler.java Tue Feb 05 09:51:44 2013 +0100 +++ b/plugin/icedteanp/java/sun/applet/PluginStreamHandler.java Wed Feb 06 09:18:38 2013 -0500 @@ -1,4 +1,4 @@ -/* VoidPluginCallRequest -- represent Java-to-JavaScript requests +/* Copyright (C) 2008 Red Hat This file is part of IcedTea. @@ -81,7 +81,7 @@ public void startProcessing() { - Thread listenerThread = new Thread() { + Thread listenerThread = new Thread("PluginStreamHandlerListenerThread") { public void run() { From adomurad at icedtea.classpath.org Wed Feb 6 06:24:59 2013 From: adomurad at icedtea.classpath.org (adomurad at icedtea.classpath.org) Date: Wed, 06 Feb 2013 14:24:59 +0000 Subject: /hg/release/icedtea-web-1.3: Provide names for unnamed threads f... Message-ID: changeset c89c2bf6707b in /hg/release/icedtea-web-1.3 details: http://icedtea.classpath.org/hg/release/icedtea-web-1.3?cmd=changeset;node=c89c2bf6707b author: Adam Domurad date: Wed Feb 06 09:22:51 2013 -0500 Provide names for unnamed threads for better debugging diffstat: ChangeLog | 17 ++++++++++ netx/net/sourceforge/jnlp/NetxPanel.java | 2 +- netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java | 2 +- plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java | 6 ++- plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java | 1 + plugin/icedteanp/java/sun/applet/PluginStreamHandler.java | 4 +- 6 files changed, 27 insertions(+), 5 deletions(-) diffs (97 lines): diff -r b619cda99360 -r c89c2bf6707b ChangeLog --- a/ChangeLog Wed Jan 16 15:34:44 2013 -0500 +++ b/ChangeLog Wed Feb 06 09:22:51 2013 -0500 @@ -1,3 +1,20 @@ +2013-02-06 Adam Domurad + + Name threads for easier debugging/tooling. Remove 2 erroneous + VoidPluginCallRequest header comments. + * netx/net/sourceforge/jnlp/NetxPanel.java: + Provide name for thread that calls (run). + * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: + Provide name for shutdown hook thread. + * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java: + Remove erroneous VoidPluginCallRequest comment. Provide name for + ConsumerThread thread. + * plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java: + Provide name for worker thread. + * plugin/icedteanp/java/sun/applet/PluginStreamHandler.java: + Remove erroneous VoidPluginCallRequest comment. Provide name for + stream listener thread. + 2013-01-16 Deepak Bhole PR1260: IcedTea-Web should not rely on GTK diff -r b619cda99360 -r c89c2bf6707b netx/net/sourceforge/jnlp/NetxPanel.java --- a/netx/net/sourceforge/jnlp/NetxPanel.java Wed Jan 16 15:34:44 2013 -0500 +++ b/netx/net/sourceforge/jnlp/NetxPanel.java Wed Feb 06 09:22:51 2013 -0500 @@ -199,7 +199,7 @@ } } - handler = new Thread(getThreadGroup(), this); + handler = new Thread(getThreadGroup(), this, "NetxPanelThread@" + this.documentURL); handler.start(); } diff -r b619cda99360 -r c89c2bf6707b netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Wed Jan 16 15:34:44 2013 -0500 +++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Wed Feb 06 09:22:51 2013 -0500 @@ -737,7 +737,7 @@ e.printStackTrace(); } - Runtime.getRuntime().addShutdownHook(new Thread() { + Runtime.getRuntime().addShutdownHook(new Thread("JNLPRuntimeShutdownHookThread") { public void run() { markNetxStopped(); CacheUtil.cleanCache(); diff -r b619cda99360 -r c89c2bf6707b plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java --- a/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java Wed Jan 16 15:34:44 2013 -0500 +++ b/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java Wed Feb 06 09:22:51 2013 -0500 @@ -1,4 +1,4 @@ -/* VoidPluginCallRequest -- represent Java-to-JavaScript requests +/* Copyright (C) 2008 Red Hat This file is part of IcedTea. @@ -131,6 +131,10 @@ protected class ConsumerThread extends Thread { + public ConsumerThread() { + super("PluginMessageConsumer.ConsumerThread"); + } + /** * Scans the readQueue for priority messages and brings them to the front */ diff -r b619cda99360 -r c89c2bf6707b plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java --- a/plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java Wed Jan 16 15:34:44 2013 -0500 +++ b/plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java Wed Feb 06 09:22:51 2013 -0500 @@ -50,6 +50,7 @@ PluginMessageConsumer consumer, PluginStreamHandler streamHandler, int id, boolean isPriorityWorker) { + super("PluginMessageHandlerWorker" + id); this.id = id; this.streamHandler = streamHandler; diff -r b619cda99360 -r c89c2bf6707b plugin/icedteanp/java/sun/applet/PluginStreamHandler.java --- a/plugin/icedteanp/java/sun/applet/PluginStreamHandler.java Wed Jan 16 15:34:44 2013 -0500 +++ b/plugin/icedteanp/java/sun/applet/PluginStreamHandler.java Wed Feb 06 09:22:51 2013 -0500 @@ -1,4 +1,4 @@ -/* VoidPluginCallRequest -- represent Java-to-JavaScript requests +/* Copyright (C) 2008 Red Hat This file is part of IcedTea. @@ -81,7 +81,7 @@ public void startProcessing() { - Thread listenerThread = new Thread() { + Thread listenerThread = new Thread("PluginStreamHandlerListenerThread") { public void run() { From jfabriko at icedtea.classpath.org Wed Feb 6 06:38:50 2013 From: jfabriko at icedtea.classpath.org (jfabriko at icedtea.classpath.org) Date: Wed, 06 Feb 2013 14:38:50 +0000 Subject: /hg/icedtea-web: JSToJGet reproducer modification, adding JSObje... Message-ID: changeset 047349c5ce3a in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=047349c5ce3a author: Jana Fabrikova date: Wed Feb 06 15:41:18 2013 +0100 JSToJGet reproducer modification, adding JSObject testcase diffstat: ChangeLog | 15 +++++ tests/reproducers/simple/JSToJGet/resources/JSToJGet.html | 3 + tests/reproducers/simple/JSToJGet/resources/JSToJ_auxiliary.js | 15 +---- tests/reproducers/simple/JSToJGet/resources/JSToJava_Get.js | 12 ++++ tests/reproducers/simple/JSToJGet/srcs/JSToJGet.java | 27 ++++++--- tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java | 18 ++---- 6 files changed, 55 insertions(+), 35 deletions(-) diffs (193 lines): diff -r ed4ecccd83e6 -r 047349c5ce3a ChangeLog --- a/ChangeLog Wed Feb 06 09:18:38 2013 -0500 +++ b/ChangeLog Wed Feb 06 15:41:18 2013 +0100 @@ -1,3 +1,18 @@ +2013-02-06 Jana Fabrikova + + * /tests/reproducers/simple/JSToJGet/resources/JSToJGet.html: + adding 1 testcase reading applets variable of type JSObject from JS + * /tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java: + adding 1 testcase reading applets variable of type JSObject from JS, + small changes to evaluation of the applet's stdout methods, removing + KnownToFail anotation from (AppletJSToJGet_DoubleFullArray_Test) method + * /tests/reproducers/simple/JSToJGet/resources/JSToJ_auxiliary.js: + removing parts of comment that are no longer true + * /tests/reproducers/simple/JSToJGet/resources/JSToJava_Get.js: + adding (test_get_JSObject) function also to the JS part of test + * /tests/reproducers/simple/JSToJGet/srcs/JSToJGet.java: + adding the JSObject variable to the applet + 2013-02-06 Adam Domurad Name threads for easier debugging/tooling. Remove 2 erroneous diff -r ed4ecccd83e6 -r 047349c5ce3a tests/reproducers/simple/JSToJGet/resources/JSToJGet.html --- a/tests/reproducers/simple/JSToJGet/resources/JSToJGet.html Wed Feb 06 09:18:38 2013 -0500 +++ b/tests/reproducers/simple/JSToJGet/resources/JSToJGet.html Wed Feb 06 15:41:18 2013 +0100 @@ -93,6 +93,9 @@ case "DoubleFullArray": test_get_DoubleFullArray(); break; + case "JSObject": + test_get_JSObject(); + break; default: appletStdOutLn('jstojGetApplet', "No argument in URL! Should be e.g. JSToJGet.html?int"); document.getElementById( 'jstojGetApplet' ).setStatusLabel("Not a valid argument in URL! Should be e.g. JSToJGet.html?int"); diff -r ed4ecccd83e6 -r 047349c5ce3a tests/reproducers/simple/JSToJGet/resources/JSToJ_auxiliary.js --- a/tests/reproducers/simple/JSToJGet/resources/JSToJ_auxiliary.js Wed Feb 06 09:18:38 2013 -0500 +++ b/tests/reproducers/simple/JSToJGet/resources/JSToJ_auxiliary.js Wed Feb 06 15:41:18 2013 +0100 @@ -1,18 +1,7 @@ /* JSToJ_auxiliary.js -This file contains auxiliary JavaScript functions for LiveConnect tests output, -the following reproducers have this file as a common resource: -- JSToJGet -- JSToJSet -- JSToJFuncParam -- JSToJFuncReturn -- JSToJFuncResol -- JSToJTypeConv -- JToJSGet -- JToJSSet -- JToJSFuncParam -- JToJSFuncReturn -- JToJSEval +This file contains auxiliary JavaScript functions for LiveConnect tests output +it is used by JSToJGet reproducer. */ function check(actual, expected, expectedtype, testid, appletName ) { diff -r ed4ecccd83e6 -r 047349c5ce3a tests/reproducers/simple/JSToJGet/resources/JSToJava_Get.js --- a/tests/reproducers/simple/JSToJGet/resources/JSToJava_Get.js Wed Feb 06 09:18:38 2013 -0500 +++ b/tests/reproducers/simple/JSToJGet/resources/JSToJava_Get.js Wed Feb 06 15:41:18 2013 +0100 @@ -245,5 +245,17 @@ appendMessageDiv(e); } } + +function test_get_JSObject(){ + var appletName = 'jstojGetApplet'; + try{ + var javao = new Object(document.getElementById(appletName).jso); + check(javao.key1, "value1", "string", "22 - (JSObject)", appletName); + }catch(e){ + appletStdOut( appletName, e ); + appendMessageDiv(e); + } + +} diff -r ed4ecccd83e6 -r 047349c5ce3a tests/reproducers/simple/JSToJGet/srcs/JSToJGet.java --- a/tests/reproducers/simple/JSToJGet/srcs/JSToJGet.java Wed Feb 06 09:18:38 2013 -0500 +++ b/tests/reproducers/simple/JSToJGet/srcs/JSToJGet.java Wed Feb 06 15:41:18 2013 +0100 @@ -1,5 +1,7 @@ -import java.applet.*; -import java.awt.*; +import java.applet.Applet; +import java.awt.Label; +import java.awt.BorderLayout; +import netscape.javascript.JSObject; public class JSToJGet extends Applet { @@ -27,9 +29,22 @@ public char[] ca = new char[3]; public Character[] Ca = new Character[3]; + public JSObject jso; private Label statusLabel; + public void start(){ + JSObject win = JSObject.getWindow(this); + jso = (JSObject) win.getMember("document"); + jso.setMember("key1","value1"); + ia[4] = 1024; + Da1[9] = D; + + String setupStr = "JSToJGet applet set up for GET tests."; + System.out.println(setupStr); + statusLabel.setText(setupStr); + } + public void init() { setLayout(new BorderLayout()); statusLabel = new Label(); @@ -37,14 +52,6 @@ String initStr = "JSToJGet applet initialized."; System.out.println(initStr); statusLabel.setText(initStr); - - ia[4] = 1024; - Da1[9] = D; - - String setupStr = "JSToJGet applet set up for GET tests."; - System.out.println(setupStr); - statusLabel.setText(setupStr); - } // auxiliary method for setting the statusLabel text: diff -r ed4ecccd83e6 -r 047349c5ce3a tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java --- a/tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java Wed Feb 06 09:18:38 2013 -0500 +++ b/tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java Wed Feb 06 15:41:18 2013 +0100 @@ -56,7 +56,6 @@ public String foundStr = "] found:["; public String endStr = "]."; - private final String exceptionStr = "xception"; private final String initStr = "JSToJGet applet initialized."; private final String setupStr = "JSToJGet applet set up for GET tests."; private final String afterStr = "afterTests"; @@ -65,9 +64,6 @@ @Override protected boolean isAlowedToFinish(String s) { - if (s.contains(exceptionStr)) { - return true; - } return (s.contains(initStr) && s.contains(setupStr) && s .contains(afterStr)); } @@ -86,12 +82,10 @@ String s0 = testStr + passStr; String s1 = testStr + failValStr; String s2 = testStr + failTypeStr; - String s3 = "Error on Java side"; int ind0 = pr.stdout.indexOf(s0); int ind1 = pr.stdout.indexOf(s1); int ind2 = pr.stdout.indexOf(s2); - int ind3 = pr.stdout.indexOf(s3); int indBegin = pr.stdout.indexOf(setupStr); if (indBegin != -1) { indBegin += setupStr.length(); @@ -116,11 +110,6 @@ failStr = "JSToJGet: type mismatch in "+testStr; } - if (ind3 != -1) { - failStr = "JSToJGet: an error occured during " + testStr; - } - - Assert.assertTrue(failStr, (ind3 == -1));// no error on Java side Assert.assertTrue(failStr, (ind1 == -1));// no value mismatch Assert.assertTrue(failStr, (ind2 == -1));// no type mismatch Assert.assertTrue(failStr, (ind0 != -1));// test passed @@ -288,9 +277,14 @@ @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay - @KnownToFail public void AppletJSToJGet_DoubleFullArray_Test() throws Exception { jsToJavaGetTest("DoubleFullArray", "Test no.21 - (Double[] - full array)"); } + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJGet_JSObject_Test() throws Exception { + jsToJavaGetTest("JSObject", "Test no.22 - (JSObject)"); + } } From jfabriko at redhat.com Wed Feb 6 06:53:41 2013 From: jfabriko at redhat.com (Jana Fabrikova) Date: Wed, 06 Feb 2013 15:53:41 +0100 Subject: [rfc][icedtea-web] modifications to JSToJSet reproducer for Liveconnect In-Reply-To: <51116772.4010904@redhat.com> References: <50FD0BEA.3040806@redhat.com> <51116772.4010904@redhat.com> Message-ID: <51126E75.20109@redhat.com> Hello Adam, thank you for your comments. I do not know precisely what causes the problems while setting array elements from JS to Java. I have changed the JSToJSet testcase with added @Bug annotation (bug number PR1298 filed, since the other bugs mentioning "applet" or "array" seemed different to me). The enum TestType has also been included,please find the modified patch attached, Jana On 02/05/2013 09:11 PM, Adam Domurad wrote: > On 01/21/2013 04:35 AM, Jana Fabrikova wrote: >> Hello, >> >> i am sending a patch that modifies the JSToJSet reproducer (adding two >> KnownToFail annotations and adding one testcase - setting a variable >> of the JSObject type), >> >> comments on the attached patch are very welcome, >> Jana >> >> 2013-01-21 Jana Fabrikova >> >> * /tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java: >> adding 1 testcase setting applets variable of type JSObject from JS, >> adding KnownToFail anotation to (AppletJSToJSet_intArrayElement_Test) >> and (AppletJSToJSet_DoubleArrayElement_Test) methods >> >> * /tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js: >> adding the JSObject case to (doSetTests) function >> >> * /tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java: >> adding the JSObject variable to the applet and modifying >> (printNewValueAndFinish) method in order to output new values of >> JSObject variable > > (Just a note, make sure the ChangeLog is in proper ChangeLog format -- > ie explanation lines dont exceed 80 lines, and must start with a tab) > >> diff --git >> a/tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js >> b/tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js >> --- a/tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js >> +++ b/tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js >> @@ -1,3 +1,9 @@ >> +//dummy javascript class whose instance is passed as JSObject parameter: >> +function JSCar(mph,color){ >> + this.mph = mph; >> + this.color = color; >> +} >> + >> function doSetTests( ){ >> >> var urlArgs = document.URL.split("?"); >> @@ -18,12 +24,16 @@ >> if( field === "_specialString"){ >> value = "????$????"; >> } >> + >> + if( field === "_JSObject"){ >> + value = new JSCar(100,"red"); >> + } >> + >> }else if(value.indexOf('[') != -1){ >> >> var elem = value.substring(1); >> value = new Array(); >> eval('value[0] = elem'); >> - >> } >> >> eval('applet.' + field + '= value'); >> diff --git a/tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java >> b/tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java >> --- a/tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java >> +++ b/tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java >> @@ -1,7 +1,7 @@ >> -import java.applet.*; >> -import java.awt.*; >> +import java.applet.Applet; >> import java.lang.reflect.Array; >> import java.lang.reflect.Field; >> +import netscape.javascript.JSObject; >> >> public class JSToJSet extends Applet { >> >> @@ -27,6 +27,7 @@ >> public Double[] _DoubleArray2; >> public char[] _charArray = new char[1]; >> public Character[] _CharacterArray = new Character[1]; >> + public JSObject _JSObject; >> >> public void init() { >> String initStr = "JSToJSet applet initialized."; >> @@ -36,7 +37,12 @@ >> public void printNewValueAndFinish(String fieldname) throws Exception { >> Field field = getClass().getDeclaredField(fieldname); >> Object value = field.get(this); >> - if (value != null && value.getClass().isArray()) { >> + >> + if( fieldname.equals("_JSObject") ){ >> + Integer mph = (Integer)_JSObject.getMember("mph"); >> + String color = (String)_JSObject.getMember("color"); >> + System.out.println("New value is: "+mph+", "+color); >> + }else if (value != null && value.getClass().isArray()) { >> System.out.println("New array value is: " + Array.get(value, 0)); >> } else { >> System.out.println("New value is: " + value); >> diff --git >> a/tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java >> b/tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java >> --- a/tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java >> +++ b/tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java >> @@ -40,6 +40,7 @@ >> import net.sourceforge.jnlp.browsertesting.BrowserTest; >> import net.sourceforge.jnlp.browsertesting.Browsers; >> import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; >> +import net.sourceforge.jnlp.annotations.KnownToFail; >> import net.sourceforge.jnlp.annotations.NeedsDisplay; >> import net.sourceforge.jnlp.annotations.TestInBrowsers; >> import org.junit.Assert; >> @@ -71,7 +72,7 @@ >> >> // Assert that the values set by JavaScript are ok >> Assert.assertTrue("JSToJSet: the output should include: >> "+expectedStdout+", but it didnt.", >> - pr.stdout.contains(expectedStdout)); >> + pr.stdout.contains(expectedStdout)); >> >> } >> >> @@ -83,23 +84,23 @@ >> } >> >> private void jsToJavaSetSpecialTest(String fieldStr, String valueStr, >> int testType) throws Exception { >> - String strURL = "/JSToJSet.html?"; >> - String expectedStdout = ""; >> - switch( testType ){ >> + String strURL = "/JSToJSet.html?"; >> + String expectedStdout = ""; >> + switch( testType ){ >> case 0://array element >> - strURL += fieldStr + ";" + valueStr; >> - expectedStdout = "New array value is: "+valueStr; >> + strURL += fieldStr + ";" + valueStr; >> + expectedStdout = "New array value is: "+valueStr; >> break; >> case 1://whole array, set 1st element >> - strURL += fieldStr + ";[" + valueStr; >> - expectedStdout = "New array value is: "+valueStr; >> - break; >> + strURL += fieldStr + ";[" + valueStr; >> + expectedStdout = "New array value is: "+valueStr; >> + break; >> case 2://char et al - to be set at JS side >> - strURL += fieldStr + ";JavaScript"; >> - expectedStdout = "New value is: "+valueStr; >> + strURL += fieldStr + ";JavaScript"; >> + expectedStdout = "New value is: "+valueStr; >> break; >> default: >> - break; >> + break; >> } > > Can you change this 0,1,2 to an enum ? > eg > enum TestType { > ARRAY_ELEMENT, > WHOLE_ARRAY, > NORMAL_VALUE > } > Or something, and use those in the switch statement instead. > >> >> ProcessResult pr = server.executeBrowser(strURL, new >> CountingClosingListenerImpl(), new CountingClosingListenerImpl()); >> @@ -158,6 +159,7 @@ >> @Test >> @TestInBrowsers(testIn = { Browsers.all }) >> @NeedsDisplay >> + @KnownToFail >> public void AppletJSToJSet_intArrayElement_Test() throws Exception { >> jsToJavaSetSpecialTest("_intArray[0]", "1", 0); >> } >> @@ -235,6 +237,7 @@ >> @Test >> @TestInBrowsers(testIn = { Browsers.all }) >> @NeedsDisplay >> + @KnownToFail > > Interesting, would you mind filing a bug report at > http://icedtea.classpath.org/bugzilla if one doesn't exist yet ? Thanks! > I looked into it a bit and it indeed seems to be a bug, but do you have > any insight into what's causing it ? > >> public void AppletJSToJSet_DoubleArrayElement_Test() throws Exception { >> jsToJavaSetSpecialTest("_DoubleArray[0]", "1.1", 0); >> } >> @@ -246,4 +249,10 @@ >> jsToJavaSetSpecialTest("_DoubleArray2", "0.1", 1); >> } >> >> + @Test >> + @TestInBrowsers(testIn = { Browsers.all }) >> + @NeedsDisplay >> + public void AppletJSToJSet_JSObject_Test() throws Exception { >> + jsToJavaSetSpecialTest("_JSObject", "100, red", 2); >> + } >> } > > Looks good otherwise! > -Adam -------------- next part -------------- A non-text attachment was scrubbed... Name: JSToJSet_enum_bugannot.patch Type: text/x-patch Size: 7848 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130206/39ae8e7f/JSToJSet_enum_bugannot.patch From jfabriko at icedtea.classpath.org Wed Feb 6 07:37:11 2013 From: jfabriko at icedtea.classpath.org (jfabriko at icedtea.classpath.org) Date: Wed, 06 Feb 2013 15:37:11 +0000 Subject: /hg/icedtea-web: modification of JSToJSet reproducer, added JSOb... Message-ID: changeset 90126cbbee8f in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=90126cbbee8f author: Jana Fabrikova date: Wed Feb 06 16:39:43 2013 +0100 modification of JSToJSet reproducer, added JSObject case and bug annotations diffstat: ChangeLog | 14 ++ tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js | 12 +- tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java | 12 +- tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java | 61 +++++++--- 4 files changed, 73 insertions(+), 26 deletions(-) diffs (230 lines): diff -r 047349c5ce3a -r 90126cbbee8f ChangeLog --- a/ChangeLog Wed Feb 06 15:41:18 2013 +0100 +++ b/ChangeLog Wed Feb 06 16:39:43 2013 +0100 @@ -1,3 +1,17 @@ +2013-02-06 Jana Fabrikova + + * /tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java: + adding 1 testcase setting applets variable of type JSObject from JS, + adding KnownToFail anotation and @Bug annotation with id=PR1298 to + (AppletJSToJSet_intArrayElement_Test) and + (AppletJSToJSet_DoubleArrayElement_Test) methods + * /tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js: + adding the JSObject case to (doSetTests) function + * /tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java: + adding the JSObject variable to the applet and modifying + (printNewValueAndFinish) method in order to output new values + of JSObject variable + 2013-02-06 Jana Fabrikova * /tests/reproducers/simple/JSToJGet/resources/JSToJGet.html: diff -r 047349c5ce3a -r 90126cbbee8f tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js --- a/tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js Wed Feb 06 15:41:18 2013 +0100 +++ b/tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js Wed Feb 06 16:39:43 2013 +0100 @@ -1,3 +1,9 @@ +//dummy javascript class whose instance is passed as JSObject parameter: +function JSCar(mph,color){ + this.mph = mph; + this.color = color; +} + function doSetTests( ){ var urlArgs = document.URL.split("?"); @@ -18,12 +24,16 @@ if( field === "_specialString"){ value = "?????????$?????????"; } + + if( field === "_JSObject"){ + value = new JSCar(100,"red"); + } + }else if(value.indexOf('[') != -1){ var elem = value.substring(1); value = new Array(); eval('value[0] = elem'); - } eval('applet.' + field + '= value'); diff -r 047349c5ce3a -r 90126cbbee8f tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java --- a/tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java Wed Feb 06 15:41:18 2013 +0100 +++ b/tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java Wed Feb 06 16:39:43 2013 +0100 @@ -1,7 +1,7 @@ -import java.applet.*; -import java.awt.*; +import java.applet.Applet; import java.lang.reflect.Array; import java.lang.reflect.Field; +import netscape.javascript.JSObject; public class JSToJSet extends Applet { @@ -27,6 +27,7 @@ public Double[] _DoubleArray2; public char[] _charArray = new char[1]; public Character[] _CharacterArray = new Character[1]; + public JSObject _JSObject; public void init() { String initStr = "JSToJSet applet initialized."; @@ -36,7 +37,12 @@ public void printNewValueAndFinish(String fieldname) throws Exception { Field field = getClass().getDeclaredField(fieldname); Object value = field.get(this); - if (value != null && value.getClass().isArray()) { + + if( fieldname.equals("_JSObject") ){ + Integer mph = (Integer)_JSObject.getMember("mph"); + String color = (String)_JSObject.getMember("color"); + System.out.println("New value is: "+mph+", "+color); + }else if (value != null && value.getClass().isArray()) { System.out.println("New array value is: " + Array.get(value, 0)); } else { System.out.println("New value is: " + value); diff -r 047349c5ce3a -r 90126cbbee8f tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java --- a/tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java Wed Feb 06 15:41:18 2013 +0100 +++ b/tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java Wed Feb 06 16:39:43 2013 +0100 @@ -40,18 +40,25 @@ import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; +import net.sourceforge.jnlp.annotations.Bug; +import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import org.junit.Assert; import org.junit.Test; + at Bug( id = { "PR1298" }) public class JSToJSetTest extends BrowserTest { private final String exceptionStr = "xception"; private final String errorStr = "rror"; private final String initStr = "JSToJSet applet initialized."; private final String afterStr = "afterTests"; + + public enum TestType{ + ARRAY_ELEMENT, WHOLE_ARRAY, NORMAL_VALUE + } private class CountingClosingListenerImpl extends CountingClosingListener { @@ -71,7 +78,7 @@ // Assert that the values set by JavaScript are ok Assert.assertTrue("JSToJSet: the output should include: "+expectedStdout+", but it didnt.", - pr.stdout.contains(expectedStdout)); + pr.stdout.contains(expectedStdout)); } @@ -82,24 +89,24 @@ evaluateStdoutContents(expectedStdout, pr); } - private void jsToJavaSetSpecialTest(String fieldStr, String valueStr, int testType) throws Exception { - String strURL = "/JSToJSet.html?"; - String expectedStdout = ""; - switch( testType ){ - case 0://array element - strURL += fieldStr + ";" + valueStr; - expectedStdout = "New array value is: "+valueStr; + private void jsToJavaSetSpecialTest(String fieldStr, String valueStr, TestType testType) throws Exception { + String strURL = "/JSToJSet.html?"; + String expectedStdout = ""; + switch( testType ){ + case ARRAY_ELEMENT://array element + strURL += fieldStr + ";" + valueStr; + expectedStdout = "New array value is: "+valueStr; break; - case 1://whole array, set 1st element - strURL += fieldStr + ";[" + valueStr; - expectedStdout = "New array value is: "+valueStr; - break; - case 2://char et al - to be set at JS side - strURL += fieldStr + ";JavaScript"; - expectedStdout = "New value is: "+valueStr; + case WHOLE_ARRAY://whole array, set 1st element + strURL += fieldStr + ";[" + valueStr; + expectedStdout = "New array value is: "+valueStr; + break; + case NORMAL_VALUE://char et al - to be set at JS side + strURL += fieldStr + ";JavaScript"; + expectedStdout = "New value is: "+valueStr; break; default: - break; + break; } ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); @@ -145,7 +152,7 @@ @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_char_Test() throws Exception { - jsToJavaSetSpecialTest("_char", "a", 2); + jsToJavaSetSpecialTest("_char", "a", TestType.NORMAL_VALUE); } @Test @@ -158,8 +165,10 @@ @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay + @KnownToFail + @Bug( id = {"PR1298"}) public void AppletJSToJSet_intArrayElement_Test() throws Exception { - jsToJavaSetSpecialTest("_intArray[0]", "1", 0); + jsToJavaSetSpecialTest("_intArray[0]", "1", TestType.ARRAY_ELEMENT); } @Test @@ -173,7 +182,7 @@ @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_specialCharsString_Test() throws Exception { - jsToJavaSetSpecialTest("_specialString", "?????????$?????????", 2); + jsToJavaSetSpecialTest("_specialString", "?????????$?????????", TestType.NORMAL_VALUE); } @Test @@ -222,7 +231,7 @@ @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_Character_Test() throws Exception { - jsToJavaSetSpecialTest("_Character", "A", 2); + jsToJavaSetSpecialTest("_Character", "A", TestType.NORMAL_VALUE); } @Test @@ -235,15 +244,23 @@ @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay + @KnownToFail + @Bug( id = {"PR1298"}) public void AppletJSToJSet_DoubleArrayElement_Test() throws Exception { - jsToJavaSetSpecialTest("_DoubleArray[0]", "1.1", 0); + jsToJavaSetSpecialTest("_DoubleArray[0]", "1.1", TestType.ARRAY_ELEMENT); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_DoubleFullArray_Test() throws Exception { - jsToJavaSetSpecialTest("_DoubleArray2", "0.1", 1); + jsToJavaSetSpecialTest("_DoubleArray2", "0.1", TestType.WHOLE_ARRAY); } + @Test + @TestInBrowsers(testIn = { Browsers.all }) + @NeedsDisplay + public void AppletJSToJSet_JSObject_Test() throws Exception { + jsToJavaSetSpecialTest("_JSObject", "100, red", TestType.NORMAL_VALUE); + } } From jfabriko at redhat.com Wed Feb 6 07:48:08 2013 From: jfabriko at redhat.com (Jana Fabrikova) Date: Wed, 06 Feb 2013 16:48:08 +0100 Subject: [rfc][icedtea-web] modifications to JSToJSet reproducer for Liveconnect In-Reply-To: <5112703E.8010305@redhat.com> References: <50FD0BEA.3040806@redhat.com> <51116772.4010904@redhat.com> <51126E75.20109@redhat.com> <5112703E.8010305@redhat.com> Message-ID: <51127B38.2020101@redhat.com> Ok, tasks completed - added @Bug annotations to methods, ChangeLog lines formatted to 80 chars, pushed in repository, thank you, Jana On 02/06/2013 04:01 PM, Adam Domurad wrote: > On 02/06/2013 09:53 AM, Jana Fabrikova wrote: >> Hello Adam, >> >> thank you for your comments. I do not know precisely what causes the >> problems while setting array elements from JS to Java. >> >> I have changed the JSToJSet testcase with added @Bug annotation (bug >> number PR1298 filed, since the other bugs mentioning "applet" or >> "array" seemed different to me). The enum TestType has also been >> included,please find the modified patch attached, > > Thanks! Looks good, and good catch on adding the @Bug annotation. Can > you also annotate the @KnownToFail test methods with the @Bug annotation? > > No need to post a new copy for review though, free free to make the > change and then push, OK for head. > -Adam > From adomurad at redhat.com Wed Feb 6 07:01:18 2013 From: adomurad at redhat.com (Adam Domurad) Date: Wed, 06 Feb 2013 10:01:18 -0500 Subject: [rfc][icedtea-web] modifications to JSToJSet reproducer for Liveconnect In-Reply-To: <51126E75.20109@redhat.com> References: <50FD0BEA.3040806@redhat.com> <51116772.4010904@redhat.com> <51126E75.20109@redhat.com> Message-ID: <5112703E.8010305@redhat.com> On 02/06/2013 09:53 AM, Jana Fabrikova wrote: > Hello Adam, > > thank you for your comments. I do not know precisely what causes the > problems while setting array elements from JS to Java. > > I have changed the JSToJSet testcase with added @Bug annotation (bug > number PR1298 filed, since the other bugs mentioning "applet" or > "array" seemed different to me). The enum TestType has also been > included,please find the modified patch attached, Thanks! Looks good, and good catch on adding the @Bug annotation. Can you also annotate the @KnownToFail test methods with the @Bug annotation? No need to post a new copy for review though, free free to make the change and then push, OK for head. -Adam From adomurad at redhat.com Wed Feb 6 08:21:11 2013 From: adomurad at redhat.com (Adam Domurad) Date: Wed, 06 Feb 2013 11:21:11 -0500 Subject: [rfc][icedtea-web] a new reproducer LiveConnect "function parameters" tests In-Reply-To: <50F552CA.6080302@redhat.com> References: <5072BA03.5070804@redhat.com> <50C8EB31.2000105@redhat.com> <50F552CA.6080302@redhat.com> Message-ID: <511282F7.9070002@redhat.com> On 01/15/2013 07:59 AM, Jana Fabrikova wrote: > Hello, > > I have rewritten the JSToJFuncParam reproducer according to Adam's comments, please see the attached patch. Thanks for revisiting the patch, sorry for the long process. > adding 19 testcases - 18 based on the interactive Liveconnect JS->Java function parameter tests, 1 additional testcase for passing parameters of type JSObject (from JS to Java) > > * /tests/reproducers/simple/JSToJFuncParam/srcs/JSToJFuncParam.java: > the applet whose methods are invoked from JS during the tests > > * /tests/reproducers/simple/JSToJFuncParam/resources/JSToJava_FuncParam.js: > the JavaScript code for calling the applet methods from JS > > * /tests/reproducers/simple/JSToJFuncParam/resources/jstoj-funcparam.jnlp: > java network launch protocol file for displaying applet in the html page 'java network launch protocol' --> we can call this simply JNLP, anyone dealing with icedtea-web will understand :-) [.. long snip .. ] New patch: > > 2013-01-15 Jana Fabrikova > > * /tests/reproducers/simple/JSToJFuncParam/testcases/JSToJFuncParamTest.jav > diff --git a/tests/reproducers/simple/JSToJFuncParam/resources/JSToJFuncParam.html b/tests/reproducers/simple/JSToJFuncParam/resources/JSToJFuncParam.html > new file mode 100644 > --- /dev/null > +++ b/tests/reproducers/simple/JSToJFuncParam/resources/JSToJFuncParam.html > @@ -0,0 +1,25 @@ > + > + > + > + JavaScript to Java LiveConnect - function parameter conversion > + > + > + > + > + > + > + > +

The JSToJFuncParam html page

> + > + > + > + > + > +
> + > + > + > + > + > diff --git a/tests/reproducers/simple/JSToJFuncParam/resources/JSToJava_FuncParam.js b/tests/reproducers/simple/JSToJFuncParam/resources/JSToJava_FuncParam.js > new file mode 100644 > --- /dev/null > +++ b/tests/reproducers/simple/JSToJFuncParam/resources/JSToJava_FuncParam.js > @@ -0,0 +1,55 @@ > +//dummy javascript class whose instance is passed as JSObject parameter: > +function JSCar(mph,color){ > + this.mph = mph; > + this.color = color; > +} > + > +//the main routine used for all tests: > +function doFuncParamTests( ){ > + > + var urlArgs = document.URL.split("?"); > + var testParams = urlArgs[1].split(";"); > + var applet = document.getElementById('jstojFuncParamApplet'); > + var func = testParams[0]; > + var value = testParams[1]; > + > + if( value === "JavaScript"){ > + > + if( func === "charParam"){ > + value = 97; // 'a' > + } > + > + if( func === "charArrayParam"){ > + value = [97,98,99]; //[a, b, c] > + } > + > + if( func === "StringParam"){ > + value = "test"; > + } > + > + if( func === "CharacterParam"){ > + value = new (applet.Packages).java.lang.Character(65); // 'A' > + } Hm, I understand the reasoning here but I think actually we can get away without any special values after all. There is a handy function in javascript that works across all browsers: var testParams = decodeURIComponent( urlArgs[1].split(";") ); You will be then free to pass any of the characters you need! I was a bit skeptical but I have tested it on multiple browsers and it really seems to work fine. You can pass even this long string ('new (applet.Packages).java.lang.Character(65)') from the test driver. This will improve the test as the input data and the expectation will be kept in one location, the test-driver. > + > + if( func === "StringIntMixedParam"){ > + value = new Array(); > + value[0] = "test"; //string > + value[1] = 123; //number With the decodeURIComponent improvement, this can be passed as ["test", 123] safely :-)). > + } > + > + if( func === "DummyObjectArrayParam"){ > + value = new Array(); > + value[0] = applet.getNewDummyObject("Dummy1"); > + value[1] = applet.getNewDummyObject("Dummy2"); Even this can be passed, eg [applet.getNewDummyObject("Dummy1"), applet.getNewDummyObject("Dummy2")]. Testing this string on firefox and google-chrome works fine. > + } > + > + if( func === "JSObjectParam"){ > + value = new JSCar(100,"red"); > + } > + } > + > + eval('applet.' + func + '(value)'); Under the new mechanism, this will instead be 'applet.' + func + '(' + value +')'. > + applet.writeAfterTest(); > +} > + > + > diff --git a/tests/reproducers/simple/JSToJFuncParam/resources/jstoj-funcparam.jnlp b/tests/reproducers/simple/JSToJFuncParam/resources/jstoj-funcparam.jnlp > new file mode 100644 > --- /dev/null > +++ b/tests/reproducers/simple/JSToJFuncParam/resources/jstoj-funcparam.jnlp > @@ -0,0 +1,23 @@ > + > + > + > + > + JavaScript to Java LiveConnect - FuncParam > + RedHat Vendor is typically IcedTea I think, representing the open source project > + > + LiveConnect - tests for function parameter conversion when calling Java from JS. > + > + > + > + + href="http://java.sun.com/products/autodl/j2se"/> > + > + > + > + + name="JS to J FuncParam" > + main-class="JSToJFuncParam" > + width="1000" > + height="100"> > + > + > diff --git a/tests/reproducers/simple/JSToJFuncParam/srcs/JSToJFuncParam.java b/tests/reproducers/simple/JSToJFuncParam/srcs/JSToJFuncParam.java > new file mode 100644 > --- /dev/null > +++ b/tests/reproducers/simple/JSToJFuncParam/srcs/JSToJFuncParam.java > @@ -0,0 +1,124 @@ > +import java.applet.Applet; > +import java.awt.Label; > +import java.awt.BorderLayout; > +import java.util.Arrays; > +import netscape.javascript.JSObject; > + > +public class JSToJFuncParam extends Applet { > + > + private Label statusLabel; > + > + public void init() { > + setLayout(new BorderLayout()); > + statusLabel = new Label(); > + add(statusLabel); I'd prefer not to have the statusLabel. > + String initStr = "JSToJFuncParam applet initialized."; > + System.out.println(initStr); > + statusLabel.setText(initStr); > + } > + > + public void intParam(int i) { > + System.out.println("intParam "+i); > + } > + > + public void doubleParam(double d) { > + System.out.println("doubleParam "+d); > + } > + > + public void floatParam(float f) { > + System.out.println("floatParam "+f); > + } > + > + public void longParam(long l) { > + System.out.println("longParam "+l); > + } > + > + public void booleanParam(boolean b) { > + System.out.println("booleanParam "+b); > + } > + > + public void charParam(char c) { > + System.out.println("charParam "+c); > + } > + > + public void byteParam(byte b) { > + System.out.println("byteParam "+b); > + } > + > + public void charArrayParam(char[] ca) { > + System.out.println("charArrayParam "+Arrays.toString(ca)); > + } > + > + public void StringParam(String s) { > + System.out.println("StringParam "+s); > + } > + > + public void IntegerParam(Integer p) { > + System.out.println("IntegerParam "+p); > + } > + > + public void DoubleParam(Double p) { > + System.out.println("DoubleParam "+p); > + } > + > + public void FloatParam(Float p) { > + System.out.println("FloatParam "+p); > + } > + > + public void LongParam(Long p) { > + System.out.println("LongParam "+p); > + } > + > + public void BooleanParam(Boolean p) { > + System.out.println("BooleanParam "+p); > + } > + > + public void CharacterParam(Character p) { > + System.out.println("CharacterParam "+p); > + } > + > + public void ByteParam(Byte p) { > + System.out.println("ByteParam "+p); > + } > + > + public void StringIntMixedParam(String[] s) { > + System.out.println("StringIntMixedParam "+Arrays.toString(s)); > + } > + > + public void DummyObjectArrayParam(DummyObject[] ca) { > + System.out.println("DummyObjectArrayParam "+Arrays.toString(ca)); > + } > + > + public void JSObjectParam(JSObject car){ > + Integer mph = (Integer)car.getMember("mph"); > + String color = (String)car.getMember("color"); > + > + System.out.println("JSObjectParam "+mph+", "+color); > + } > + > + public void writeAfterTest(){ > + System.out.println("afterTests"); > + } > + > + public class DummyObject { > + private String str; > + > + public DummyObject(String s) { > + this.str = s; > + } > + > + public void setStr(String s) { > + this.str = s; > + } > + > + public String toString() { > + return str; > + } > + } > + > + public DummyObject getNewDummyObject(String str){ > + return new DummyObject(str); > + } > +} Looks nice and clean otherwise! > + > + > diff --git a/tests/reproducers/simple/JSToJFuncParam/testcases/JSToJFuncParamTest.java b/tests/reproducers/simple/JSToJFuncParam/testcases/JSToJFuncParamTest.java > new file mode 100644 > --- /dev/null > +++ b/tests/reproducers/simple/JSToJFuncParam/testcases/JSToJFuncParamTest.java > @@ -0,0 +1,226 @@ > +/* JSToJFuncParamTest.java > +Copyright (C) 2012 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. > + */ > + > +import net.sourceforge.jnlp.ProcessResult; > +import net.sourceforge.jnlp.ServerAccess; > +import net.sourceforge.jnlp.browsertesting.BrowserTest; > +import net.sourceforge.jnlp.browsertesting.Browsers; > +import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; > +import net.sourceforge.jnlp.annotations.NeedsDisplay; > +import net.sourceforge.jnlp.annotations.TestInBrowsers; > +import org.junit.Assert; > + > +import org.junit.Test; > + > +public class JSToJFuncParamTest extends BrowserTest { > + > + private final String initStr = "JSToJFuncParam applet initialized."; > + private final String afterStr = "afterTests"; > + > + private class CountingClosingListenerImpl extends CountingClosingListener { > + > + @Override > + protected boolean isAlowedToFinish(String s) { > + return (s.contains(initStr) && s.contains(afterStr)); > + } > + } > + > + private void evaluateStdoutContents(String expectedStdout, ProcessResult pr) { > + // Assert that the applet was initialized. > + Assert.assertTrue("JSToJFuncParam: the stdout should contain " + initStr > + + ", but it didnt.", pr.stdout.contains(initStr)); > + > + // Assert that the values set by JavaScript are ok > + Assert.assertTrue("JSToJFuncParam: the output should include: "+expectedStdout+", but it didnt.", pr.stdout.contains(expectedStdout)); > + > + } > + > + private void jsToJavaFuncParamNormalTest(String funcStr, String paramStr) throws Exception { > + String strURL = "/JSToJFuncParam.html?" + funcStr + ";" + paramStr; > + ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); > + String expectedStdout = funcStr+" "+ paramStr; > + evaluateStdoutContents(expectedStdout, pr); > + } > + > + private void jsToJavaFuncParamSpecialTest(String funcStr, String paramStr) throws Exception { With any luck this won't be needed. Of course let me know if you run into problems with the URI decoding function, but it should be fairly robust, and not require any change in how data is passed on the Java end. > + String strURL = "/JSToJFuncParam.html?"; > + String expectedStdout = ""; > + > + //special parameters - char, char[], Character, mixed array of int and String, DummyObject[] Just a question on this comment, is there a mixed array of int and String in this patch ? I can't seem to see one. > + // - to be set at JS side > + strURL += funcStr + ";JavaScript"; > + expectedStdout = funcStr+" "+paramStr; > + > + ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); > + evaluateStdoutContents(expectedStdout, pr); > + } > + > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_int_Test() throws Exception { > + jsToJavaFuncParamNormalTest("intParam", "1"); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_double_Test() throws Exception { > + jsToJavaFuncParamNormalTest("doubleParam", "1.1"); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_float_Test() throws Exception { > + jsToJavaFuncParamNormalTest("floatParam", "1.1"); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_long_Test() throws Exception { > + jsToJavaFuncParamNormalTest("longParam", "10000"); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_boolean_Test() throws Exception { > + jsToJavaFuncParamNormalTest("booleanParam", "true"); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_char_Test() throws Exception { > + jsToJavaFuncParamSpecialTest("charParam", "a"); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_byte_Test() throws Exception { > + jsToJavaFuncParamNormalTest("byteParam", "10"); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_charArray_Test() throws Exception { > + jsToJavaFuncParamSpecialTest("charArrayParam", "[a, b, c]"); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_String_Test() throws Exception { > + jsToJavaFuncParamSpecialTest("StringParam", "test"); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_Integer_Test() throws Exception { > + jsToJavaFuncParamNormalTest("IntegerParam", "1"); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_Double_Test() throws Exception { > + jsToJavaFuncParamNormalTest("DoubleParam", "1.1"); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_Float_Test() throws Exception { > + jsToJavaFuncParamNormalTest("FloatParam", "1.1"); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_Long_Test() throws Exception { > + jsToJavaFuncParamNormalTest("LongParam", "10000"); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_Boolean_Test() throws Exception { > + jsToJavaFuncParamNormalTest("BooleanParam", "true"); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_Character_Test() throws Exception { > + jsToJavaFuncParamSpecialTest("CharacterParam", "A"); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_Byte_Test() throws Exception { > + jsToJavaFuncParamNormalTest("ByteParam", "10"); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_StringIntMixed_Test() throws Exception { > + jsToJavaFuncParamSpecialTest("StringIntMixedParam", "[test, 123]"); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_DummyObjectArray_Test() throws Exception { > + jsToJavaFuncParamSpecialTest("DummyObjectArrayParam", "[Dummy1, Dummy2]"); > + } > + > + @Test > + @TestInBrowsers(testIn = { Browsers.all }) > + @NeedsDisplay > + public void AppletJSToJFuncParam_JSObject_Test() throws Exception { > + jsToJavaFuncParamSpecialTest("JSObjectParam", "100, red"); > + } > + > +} Otherwise it's a great improvement. Try and see if you can get rid of the special arguments with the URI decoding tip, if not it isn't a huge deal and can probably go in as-is. Happy hacking, -Adam From gitne at excite.co.jp Wed Feb 6 14:20:30 2013 From: gitne at excite.co.jp (=?ISO-2022-JP?B?SmFjb2IgV2lzb3I=?=) Date: Thu, 7 Feb 2013 07:20:30 +0900 Subject: =?ISO-2022-JP?B?W3JmY11baWNlZHRlYS13ZWJdIEdlcm1hbiBsb2NhbGl6YXRpb24=?= Message-ID: <201302062220.r16MKUTH013240@mail-web03.excite.co.jp> Hello there! 2013-02-06 Jacob Wisor * netx/net/sourceforge/jnlp/resources/Messages_de.properties: Added initial German localization Since I am new to this process, please bear with me. I am a little bit unsure about some messages so please comment on those. There are also some messages that seem to make no sense in English or are broken. My comment or concern comes first, then the English source, and finally the German translation. If no one will comment on some messages, then they are going to be pushed the way they are, because these are the best translations to my knowledge and ability. #Added nbsp to prevent multi-line text on button #ButMoreInformation=More Information... ButMoreInformation=Weitereu00a0Informationen... #Perhaps a better word for "Details" would be "Einzelheiten"? #ButShowDetails=Show Details ButShowDetails=Details zeigen #Perhaps a better word for "Details" would be "Einzelheiten"? #ButHideDetails=Hide Details ButHideDetails=Details verbergen #Perhaps a better word for machine in this context would be "System" or "Ger$(D+#(Bt", #since "Rechner" implies or limits to a specific device category i.e. desktop, #server, or laptop, but what about smartphones, tablets, netbooks, and #refrigerators, etc? #AFileOnTheMachine=a file on the machine AFileOnTheMachine=eine Datei auf dem Rechner #Reformulated to avoid "Sie" #Continue=Do you want to continue? Continue=Soll fortgefahren werden? #Could also be "Niedrig", depending on any possible title. #LSMinor=Minor LSMinor=Gering #A "fatal error" is often translated as "Schwerwiegender Fehler", but #"schwerwiegend" does not imply that the error is unrecoverable. LSFatal=Fatal #The term "corrupted run" seems to be incorrect English. Please reformulate and #comment on context. #LThreadInterruptedInfo=This can lead to deadlock or corrupted run, please restart your application/browser LThreadInterruptedInfo=Dies kann zum Einfrieren oder Beschu00e4digung der Ausfu00fchrung fu00fchren. Bitte die Anwendung oder den Browser neustarten. #Please check tense in English message, shouldn't it be past perfect passive? #Reformulated to avoid "Sie". #LCouldNotLaunchInfo=Application was not initialized, for more information execute javaws/browser from commandline and sent bug report. LCouldNotLaunchInfo=Die Anwendung war nicht initialisiert. Um weitere Informationen zu erhalten ku00f6nnen javaws oder der Browser von der Befehlszeile aus gestartet und diese als Fehlerbericht gesendet werden. #According to German noun building rules on negated nouns there is no dash #between "Nicht" and the noun. #LNotApplicationInfo=An attempt was made to load a non-application file as an application. LNotApplicationInfo=Ein Versuch wurde unternommen eine Nichtanwendungsdatei als eine Anwendung zu laden. #Please check tense in English message, shouldn't it be past perfect passive? #Reformulated to avoid "Sie". #LInitApplicationInfo=Application was not initialized, for more information execute javaws from commandline. LInitApplicationInfo=Die Anwendung war nicht initialisiert. Um weitere Informationen zu erhalten kann javaws von der Befehlszeile aus ausgefu00fchrt werden. #WARNING inconsistent use of vocabulary in English messages: to verify and to #validate #LNotVerified=Jars not verified. LNotVerified=Jars nicht verifiziert. #Please do not use "we" and do reformulate. Exceptions usually are cought "in" #and not "from" classes. Please comment on it if the preposition is really #required here. #LFatalVerificationInfo=We caught an Exception from the JarCertVerifier class. One of these exceptions could be from not being able to read the cacerts or trusted.certs files. LFatalVerificationInfo=Eine Ausnahme in der Klasse JarCertVerifier wurde abgefangen. Eine dieser Ausnahmen ku00f6nnte die Ursache in der Unlesbarkeit der Dateien cacerts oder trusted.certs haben. #Although many of the English messages in this section do not include the #definite article, I have added them in the German translation, since they read #and sound better, and also more complete. #PInvalidRoot=Root node is not a jnlp node PInvalidRoot=Der Wurzelknoten ist kein jnlp Knoten #Semantically wrong message. Please reformulate. #PNativeHasMain=Cannot specify main attribute on native JARs. PNativeHasMain=Kann das Attribut main auf nativen JARs nicht angeben. #Incomplete English message, please reformulate to form a complete sentence. #This not only helps localizers, but provides better understanding for English #speaking users also. #PTwoDescriptions=Duplicate description of kind {0} PTwoDescriptions=Doppeltes description der Art {0} #This message does not make sense even in English. Please comment on the context #After the English message has been updated to something meaningful there can #surely be found a way to compact it. #BOUpdate = Update check if seconds since last checked. BOUpdate=Pru00fcfung aktualisieren falls Sekunden seitdem zuletzt gepru00fcft wurde. #This message does not make sense even in English. Please comment on the context #BOHeadless = Disables download window, other UIs. BOHeadless=Deaktiviert Herunterladefenster, andere Benutzeroberflu00e4chen. #A German-only speaker has no clue what a "Cache" is, hence the preferred #translation should be either "Zwischenspeicher" or "Vorhaltespeicher". I #strongly prefer "Vorhaltespeicher" because it does not imply a process or #direction with the storing operation. Into a "Vorhaltespeicher" items can be #put and widthdrawn from at random, whereas a "Zwischenspeicher" implies more of #a FIFO or buffer where items are put into and withdrawn from in one direction. #BXclearcache= Clean the JNLP application cache. BXclearcache=Den JNLP Anwendungsvorhaltespeicher su00e4ubern. #Analog to "Vorhaltespeicher" a cacheable resource is a "vorhaltbare Resource", #since building "vorhaltespeicherbare" or "vorhaltspeicherbare" words is not #possible. #CNotCacheable={0} is not a cacheable resource CNotCacheable={0} ist keine vorhaltbare Resource #A German-only speaker has no clue what a "Cache" is, hence the preferred #translation should be either "Zwischenspeicher" or "Vorhaltespeicher". I #strongly prefer "Vorhaltespeicher" because it does not imply a process or #direction with the storing operation. With a "Vorhaltespeicher" items can be #put and widthdrawn at random, whereas a "Zwischenspeicher" implies more of a #FIFO or buffer where items are put and withdrawn in one direction. #CChooseCache=Choose a cache directory... CChooseCache=Ein Vorhaltespeicherverzeichnis wu00e4hlen... #A German-only speaker has no clue what a "Cache" is, hence the preferred #translation should be either "Zwischenspeicher" or "Vorhaltespeicher". I #strongly prefer "Vorhaltespeicher" because it does not imply a process or #direction with the storing operation. With a "Vorhaltespeicher" items can be #put and widthdrawn at random, whereas a "Zwischenspeicher" implies more of a #FIFO or buffer where items are put and withdrawn in one direction. #CChooseCacheInfo=Netx needs a location for storing cache files. CChooseCacheInfo=Netx benu00f6tigt einen Ort zur Ablage von Vorhaltespeicherdateien. #I wanted to avoid the lazy or casual translation "beschu00e4digt" for "corrupt". #Actually, in this case the cache is not corrupt but its mechanism is. Hence the #cache is not "beschu00e4digt", instead its indexing mechanism or index is #"durcheinander". #CFakeCache=Cache is corrupt. Fixing. CFakeCache=Vorhaltespeicher ist durcheinander. Wird geordnet. #Should not the message be "The cache _was_ corrupt and has been fixed"? #Reformulated to avoid "Sie" and chosen a more compact, simple, and direct #expression. It could also be rewritten with "um zu". #CFakedCache=Cache is corrupt and has been fixed. It is strongly recommended that you run 'javaws -Xclearcache' and rerun your application as soon as possible. CFakedCache=Vorhaltespeicher ist durcheinander und wurde geordnet. Es wird strengstens empfolgen, dass u201ejavaws -Xclearcacheu201c und anschlieu00dfend die Anwendung ausgefu00fchrt wird. #Reformulated to avoid "Sie" #SFileReadAccess=The application has requested read access to {0}. Do you want to allow this action? SFileReadAccess=Die Anwe