From jvanek at redhat.com Wed Jan 2 07:20:35 2013
From: jvanek at redhat.com (Jiri Vanek)
Date: Wed, 02 Jan 2013 16:20:35 +0100
Subject: [rfc] [icedtea-web] desktop icon is pointing to cache instead to
real url
Message-ID: <50E45043.6070607@redhat.com>
Hi!
During digging in desktop subsystem of ITW i found that desktop icon is pointing to cache instead to
url. HAve anybody idea why??? Eg it will not survive -Xclearcache,..
This simple patch should fix it to point to real url instead of cached version:
diff -r a16da8b96a0f netx/net/sourceforge/jnlp/util/XDesktopEntry.java
--- a/netx/net/sourceforge/jnlp/util/XDesktopEntry.java Mon Dec 24 13:58:31 2012 +0100
+++ b/netx/net/sourceforge/jnlp/util/XDesktopEntry.java Wed Jan 02 16:17:53 2013 +0100
@@ -93,7 +93,7 @@
}
//Shortcut executes the jnlp from cache and system preferred java..
- fileContents += "Exec=" + "javaws" + " \"" + cacheFile.getAbsolutePath() + "\"\n";
+ fileContents += "Exec=" + "javaws" + " \"" + file.getSourceLocation() + "\"\n";
return new StringReader(fileContents);
From jvanek at redhat.com Wed Jan 2 07:28:26 2013
From: jvanek at redhat.com (Jiri Vanek)
Date: Wed, 02 Jan 2013 16:28:26 +0100
Subject: [rfc][icedtea-web] fixinf of desktop icon behaviour
In-Reply-To: <50E19E5C.1010103@redhat.com>
References: <50D488DC.4000507@redhat.com> <50D49071.80107@redhat.com>
<50DC8D90.8000207@redhat.com> <50DF3747.9090202@redhat.com>
<50E19E5C.1010103@redhat.com>
Message-ID: <50E4521A.8020008@redhat.com>
On 12/31/2012 03:17 PM, Omair Majid wrote:
> On 12/29/2012 01:32 PM, Jiri Vanek wrote:
>> On 12/27/2012 07:04 PM, Omair Majid wrote:
>>> On 12/21/2012 11:38 AM, Adam Domurad wrote:
>>>> On 12/21/2012 11:05 AM, Jiri Vanek wrote:
>>>>> Hi! This is fix for
>>>>> http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725 - JNLP
>>>>> applications will prompt for creating desktop shortcuts every time
>>>>> they are run
>>>>>
>>>>> When I have seen Omairs original patch it was too much complicated, So
>>>>> I want at least to try this one.
>>>>
>>>> Do you know why Omair used explicit locking? I couldn't quite figure
>>>> it out
>>>>
>>>
>>> My first patch kept a record of all desktop entries that icedtea-web
>>> created in a file. This meant that if a user deleted the desktop icon,
>>> icedtea-web wouldn't prompt for the creation of that icon again.
>>>
>>
>> I was thinking about it in vice-versa. If he had already created icon,
>> and then he delted it. And some time later he launch application again,
>> I would expect he would like to be asked again.
>
> I don't have strong feelings about this either way. Some user testing
> might prove insightful.
>
>> However, when he will refuse to create an desktop icon then he should
>> not be asked again.. that is *probably* true, but I'm not so sure... And
>> to achieve this something like your previous approach is needed.
>
> This sounds sensible to me too.
>
>> So what do you think about combination of my and yours approach?
>
> Sounds fine to me.
>
> I think it would be best to get the behaviour that we are sure is needed
> (what your initial patch does) into icedtea-web, and then we can try and
Ok. So I will continue in patch Adam is reviewing. There is more and more ticks rising up:
please see the substitution of environment variables[1] and pointing to cachedFile/url[2]
> figure out what to do with the corner cases where the right thing to do
> is not as obvious.
Ok. My initial ideas are:
* enhance "allow desktop icon" dialogue with always and never buttons (right now there is just allow/no)
- for allow the icon will be created - after [1] patch the user will not be asked again so long as
desktop icon exists.
- for no - icon will not be created, but user will be asked if he launches the url again.
- no more actions for allow/no. The behaviour will be then as in [1] patch
- always - the icon will be created and in ITW properties will be url marked as "create an icon
if it do not exists", user will be no longer bothered.and icon will be always recreated.
- never - the icon will NOT be created and in ITW properties will be url marked as "do not ever
create an icon". user will be never prompted again, and url desktop icon will never be recreated.
Items recorded by never/always however should be accessible via ITW-settings, But I will be to lazy
to do so O:)
J.
[1] http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-December/021265.html
[2] http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2013-January/021277.html
From adomurad at redhat.com Wed Jan 2 07:34:07 2013
From: adomurad at redhat.com (Adam Domurad)
Date: Wed, 02 Jan 2013 10:34:07 -0500
Subject: [rfc] [icedtea-web] desktop icon is pointing to cache instead
to real url
In-Reply-To: <50E45043.6070607@redhat.com>
References: <50E45043.6070607@redhat.com>
Message-ID: <50E4536F.5030803@redhat.com>
On 01/02/2013 10:20 AM, Jiri Vanek wrote:
> Hi!
> During digging in desktop subsystem of ITW i found that desktop icon
> is pointing to cache instead to url. HAve anybody idea why??? Eg it
> will not survive -Xclearcache,..
I think this is the correct behaviour -- AFAICS this would allow it to
work offline while pointing to the URL would not.
>
> This simple patch should fix it to point to real url instead of cached
> version:
>
> diff -r a16da8b96a0f netx/net/sourceforge/jnlp/util/XDesktopEntry.java
> --- a/netx/net/sourceforge/jnlp/util/XDesktopEntry.java Mon Dec 24
> 13:58:31 2012 +0100
> +++ b/netx/net/sourceforge/jnlp/util/XDesktopEntry.java Wed Jan 02
> 16:17:53 2013 +0100
> @@ -93,7 +93,7 @@
> }
>
> //Shortcut executes the jnlp from cache and system preferred
> java..
Just a note that this comment would need updating too
> - fileContents += "Exec=" + "javaws" + " \"" +
> cacheFile.getAbsolutePath() + "\"\n";
> + fileContents += "Exec=" + "javaws" + " \"" +
> file.getSourceLocation() + "\"\n";
>
> return new StringReader(fileContents);
Happy hacking,
-Adam
From jvanek at redhat.com Wed Jan 2 07:52:03 2013
From: jvanek at redhat.com (Jiri Vanek)
Date: Wed, 02 Jan 2013 16:52:03 +0100
Subject: [rfc] [icedtea-web] desktop icon is pointing to cache instead
to real url
In-Reply-To: <50E45293.9040708@redhat.com>
References: <50E45043.6070607@redhat.com> <50E45293.9040708@redhat.com>
Message-ID: <50E457A3.4080801@redhat.com>
On 01/02/2013 04:30 PM, Omair Majid wrote:
> On 01/02/2013 10:20 AM, Jiri Vanek wrote:
>> Hi!
>> During digging in desktop subsystem of ITW i found that desktop icon is
>> pointing to cache instead to url. HAve anybody idea why??? Eg it will
>> not survive -Xclearcache,..
>
> IIRC, I did this to keep the desktop entry working if the network is
> inaccessible.
I must disagree with this approach. Netx should work in offline mode without such a hacks....
J.
>
> Cheers,
> Omair
>
From omajid at redhat.com Wed Jan 2 07:30:27 2013
From: omajid at redhat.com (Omair Majid)
Date: Wed, 02 Jan 2013 10:30:27 -0500
Subject: [rfc] [icedtea-web] desktop icon is pointing to cache instead
to real url
In-Reply-To: <50E45043.6070607@redhat.com>
References: <50E45043.6070607@redhat.com>
Message-ID: <50E45293.9040708@redhat.com>
On 01/02/2013 10:20 AM, Jiri Vanek wrote:
> Hi!
> During digging in desktop subsystem of ITW i found that desktop icon is
> pointing to cache instead to url. HAve anybody idea why??? Eg it will
> not survive -Xclearcache,..
IIRC, I did this to keep the desktop entry working if the network is
inaccessible.
Cheers,
Omair
--
PGP Key: 66484681 (http://pgp.mit.edu/)
Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681
From bugzilla-daemon at icedtea.classpath.org Wed Jan 2 08:45:35 2013
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Wed, 02 Jan 2013 16:45:35 +0000
Subject: [Bug 906] icedtea always redownloads web start application
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=906
Adam Domurad changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|omajid 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/20130102/9d2045f6/attachment.html
From jvanek at redhat.com Wed Jan 2 09:14:28 2013
From: jvanek at redhat.com (Jiri Vanek)
Date: Wed, 02 Jan 2013 18:14:28 +0100
Subject: [rfc][icedtea-web] fixinf of desktop icon behaviour
In-Reply-To: <50DDD3B8.2080606@redhat.com>
References: <50D488DC.4000507@redhat.com>
<50D49692.7050007@zafena.se> <50D4B0AD.2030309@redhat.com>
<50D8615D.5080708@redhat.com> <50D8C05C.80501@redhat.com>
<50DDD3B8.2080606@redhat.com>
Message-ID: <50E46AF4.10702@redhat.com>
On 12/28/2012 06:15 PM, Adam Domurad wrote:
> On 12/24/2012 03:51 PM, Jiri Vanek wrote:
>> On 12/24/2012 03:06 PM, Jiri Vanek wrote:
>>> On 12/21/2012 07:55 PM, Jiri Vanek wrote:
>>>> On 12/21/2012 06:04 PM, Xerxes R?nby wrote:
>>>>> 2012-12-21 17:05, Jiri Vanek skrev:
>>>>>> Hi! This is fix for http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725 - JNLP
>>>>>> applications will prompt for creating desktop shortcuts every time they are run
>>>>>>
>>>>>> When I have seen Omairs original patch it was too much complicated, So I want at least to try
>>>>>> this one.
>>>>>> It is pretty simple. The disadvantage however is:
>>>>>> + public File getFinalLinuxDesktopIconFile() {
>>>>>> + return new
>>>>>> File(System.getProperty("user.home")+"/Desktop/"+getDesktopIconFinalName()+".desktop");
>>>>>> + }
>>>>>>
>>>>>> to be dependent on System.getProperty("user.home")+"/Desktop/" and .desktop suffix.
>>>>>>
>>>>>> However .. can it be enough?
>>>>>>
>>>>>> The second patch is for testing purposes of this case which I would like to push forward as
>>>>>> soon as possible.
>>>>>>
>>>>>> J.
>>>>>
>>>>> This will be broken on non-english systems.
>>>>>
>>>>> The name of the Desktop folder gets localized on many distributions.
>>>>> For example the Desktop folder is called Skrivbord on Swedish user systems.
>>>>> The configuration of the user desktop folder location is set in the
>>>>> ~/.config/user-dirs.dirs
>>>>>
>>>>> On my system this file contains:
>>>>> xranby at xranby-ESPRIMO-P7935:~/.config$ cat user-dirs.dirs
>>>>> # This file is written by xdg-user-dirs-update
>>>>> # If you want to change or add directories, just edit the line you're
>>>>> # interested in. All local changes will be retained on the next run
>>>>> # Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
>>>>> # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
>>>>> # absolute path. No other format is supported.
>>>>> #
>>>>> XDG_DESKTOP_DIR="$HOME/Skrivbord"
>>>>> XDG_DOWNLOAD_DIR="$HOME/H?mtningar"
>>>>> XDG_TEMPLATES_DIR="$HOME/Mallar"
>>>>> XDG_PUBLICSHARE_DIR="$HOME/Publikt"
>>>>> XDG_DOCUMENTS_DIR="$HOME/Dokument"
>>>>> XDG_MUSIC_DIR="$HOME/Musik"
>>>>> XDG_PICTURES_DIR="$HOME/Bilder"
>>>>> XDG_VIDEOS_DIR="$HOME/Video"
>>>>>
>>>>
>>>> I see.. This is very valid point and I have hoped to hear something like this.
>>>> Do you think it is correct to get this information from ~/.config/user-dirs.dirs ?
>>>> It sound good enough to me to parse it... As it is standartized in freedesktop.org.
>>>>
>>>> Thanx for reply,
>>>>
>>>> J.
>>>
>>> So here is improved version which is parsing fro ~/.config/user-dirs.dirs.
>>>
>>> J.
>>
>>
>> This is little bit better and is taking care for all possible variables. Instead all this parsing
>> and substitutions simple exec of echo $(xdg-user-dir DESKTOP) is possible. And it maybe more
>> bullet proof. However I would like avoid Sytem.exec wheres possible.
>>
>> J.
>>
>
> thanks, comments inline
>
>> diff -r a16da8b96a0f netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java
...
>> return iconSize;
>> }
>>
>> + public File getShortcutTmpFile() {
>> + File shortcutFile = new
>> File(JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_USER_TMP_DIR) +
>> File.separator + FileUtils.sanitizeFileName(file.getTitle()) + ".desktop");
>
> bit of a mouthful, a temporary variable here for the user directory would be good.
as you wish
>
>> + return shortcutFile;
>> + }
>> +
>> /**
>> * Set the icon size to use for the desktop shortcut
>> *
>> @@ -148,9 +162,7 @@
>> * Install this XDesktopEntry into the user's desktop as a launcher
>> */
>> private void installDesktopLauncher() {
>> - File shortcutFile = new File(JNLPRuntime.getConfiguration()
>> - .getProperty(DeploymentConfiguration.KEY_USER_TMP_DIR)
>> - + File.separator + FileUtils.sanitizeFileName(file.getTitle()) + ".desktop");
>> + File shortcutFile = getShortcutTmpFile();
>> try {
>>
>> if (!shortcutFile.getParentFile().isDirectory() &&
>> !shortcutFile.getParentFile().mkdirs()) {
>> @@ -234,4 +246,80 @@
>> }
>> }
>>
>> + public String getDesktopIconFinalName() {
>
as you wish :)
> I don't understand what is 'final' about it ? Why can it simply not be called the icon name?
>
>> + return sanitize(file.getTitle());
>> + }
>> +
>> + public File getFinalLinuxDesktopIconFile() {
>
> Similarly I don't understand what makes this the final linux desktop icon file, vs
> 'getLinuxDesktopIconFile'
similarly O:)
>
>> + return new File(findFreedesktopOrgDesktopPathCatch() + getDesktopIconFinalName() +
>> ".desktop");
>> + }
>> +
>> + public static String findFreedesktopOrgDesktopPathCatch() {
>
> I'm all for splitting into many small methods, but I don't know how I feel about
> findFreedesktopOrgDesktopPathCatch, findFreedesktopOrgDesktopPath, getFreedesktopOrgDesktopPathFrom
> all being public, separate methods. I think just inlining all the logic into one
> findFreedesktopOrgDesktopPath() method suffices, also the name 'findFreedesktopOrgDesktopPathCatch'
> says too much about the implementation IMO.
>
>> + try {
>> + return findFreedesktopOrgDesktopPath();
>> + } catch (Exception ex) {
>
> I think catching Exception is (almost) always a bad idea, it can silence even array-out-of-bounds. I
> think IOException suffices.
I really would like to have this cas safe block. However I have added printStackTrace.
>
>> + return System.getProperty("user.home") + "/Desktop/";
>> + }
>> + }
>> +
>> + public static String findFreedesktopOrgDesktopPath() throws IOException {
>> + File userDirs = new File(System.getProperty("user.home") + "/.config/user-dirs.dirs");
>> + if (!userDirs.exists()) {
>> + return System.getProperty("user.home") + "/Desktop/";
>> + }
>> + return getFreedesktopOrgDesktopPathFrom(userDirs);
>> + }
>> +
>> + public static String getFreedesktopOrgDesktopPathFrom(File userDirs) throws IOException {
>> + BufferedReader r = new BufferedReader(new FileReader(userDirs));
>> + try {
>> + return getFreedesktopOrgDesktopPathFrom(r);
>> + } finally {
>> + r.close();
>> + }
>> +
>> + }
>> +
>> + public static final String XDG_DESKTOP_DIR = "XDG_DESKTOP_DIR";
>> +
>> + public static String getFreedesktopOrgDesktopPathFrom(BufferedReader r) throws IOException {
>
> This is a helper method and shouldn't be public IMO.
As much of this methods as possible have been made private. Except this one :)
To keep it testable I let it package private.
>
>> + while (true) {
>> + String s = r.readLine();
>> + if (s == null) {
>> + throw new IOException("End of user-dirs found, but no " + XDG_DESKTOP_DIR + " key
>> found");
>> + }
>> + s = s.trim();
>> + if (s.startsWith(XDG_DESKTOP_DIR)) {
>> + if (!s.contains("=")) {
>> + throw new IOException(XDG_DESKTOP_DIR + " have no value");
>
> s/have/has/
thanks.
>
>> + }
>> + String[] ss = s.split("=");
>
> rename 'ss' to 'keyvalue' or something, and the reason ss[1] is used will be clearer IMO.
done. To keyAndvalue
>
>> + ss[1] = ss[1].trim();
>> + return evaluateVariables(ss[1]);
>> + }
>> + }
>> + }
>> +
>> + private static String evaluateVariables(String orig) {
>> +
>> + Set> env = System.getenv().entrySet();
>> + List> envVariables = new ArrayList> (env);
>> + Collections.sort(envVariables, new Comparator>(){
>> +
>> + @Override
>> + public int compare(Entry o1, Entry o2) {
>> + return o2.getKey().length()-o1.getKey().length();
>> + }
>> + });
>> + while (true) {
>> + String before = orig;
>> + for (Entry entry : envVariables) {
>> + orig=orig.replaceAll("\\$"+entry.getKey(), entry.getValue());
>> + }
>> + if (before.equals(orig)) {
>> + return orig;
>> + }
>> + }
>> +
>> + }
>> }
>> diff -r a16da8b96a0f tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java
>> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
>> +++ b/tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java Mon Dec 24 21:38:14 2012
>> +0100
>> @@ -0,0 +1,59 @@
>> +/*
>> + * To change this template, choose Tools | Templates
>> + * and open the template in the editor.
>> + */
>
> Netbeans user are you ? Anyway this should be gone.
Argh... Added correct header.
>
>> +package net.sourceforge.jnlp.util;
>> +
>> +import java.io.BufferedReader;
>> +import java.io.IOException;
>> +import java.io.StringReader;
>> +import org.junit.Assert;
>> +import org.junit.Test;
>> +
>> +public class XDesktopEntryTest {
>> +
>> + private String des1 = "/my/little/Desktop";
>> + private String des2name = "Plocha";
>> + private String des2Res = System.getProperty("user.home") + "/" + des2name;
>> + private String des2 = "$HOME" + "/" + des2name;
>> + private String src1 = XDesktopEntry.XDG_DESKTOP_DIR + "=" + des1;
>> + private String src2 = " " + XDesktopEntry.XDG_DESKTOP_DIR + " = " + des1;
>> + private String src3 = "#" + XDesktopEntry.XDG_DESKTOP_DIR + " = " + des1;
>> + private String src4 = XDesktopEntry.XDG_DESKTOP_DIR + "=" + des2;
>> + private String src5 = " " + XDesktopEntry.XDG_DESKTOP_DIR + " = " + des2;
>> + private String src6 = "#" + XDesktopEntry.XDG_DESKTOP_DIR + " = " + des2;
>> +
>> + @Test
>> + public void getFreedesktopOrgDesktopPathFromtestSimple() throws IOException {
>> + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new
>> StringReader(src1)));
>> + Assert.assertEquals(s, des1);
>> + }
>> +
>> + @Test
>> + public void getFreedesktopOrgDesktopPathFromtestSpaced() throws IOException {
>> + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new
>> StringReader(src2)));
>> + Assert.assertEquals(s, des1);
>> + }
>> +
>> + @Test(expected = IOException.class)
>> + public void getFreedesktopOrgDesktopPathFromtestCommented() throws IOException {
>> + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new
>> StringReader(src3)));
>> + }
>> +
>> + @Test
>> + public void getFreedesktopOrgDesktopPathFromtestSimpleWithHome() throws IOException {
>> + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new
>> StringReader(src4)));
>> + Assert.assertEquals(s, des2Res);
>> + }
>> +
>> + @Test
>> + public void getFreedesktopOrgDesktopPathFromtestSpacedWithHome() throws IOException {
>> + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new
>> StringReader(src5)));
>> + Assert.assertEquals(s, des2Res);
>> + }
>> +
>> + @Test(expected = IOException.class)
>> + public void getFreedesktopOrgDesktopPathFromtestCommentedWithHome() throws IOException {
>> + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new
>> StringReader(src6)));
>> + }
>> +}
>
> Test looks OK
of course :)
>
> Just one additional comment, as Omair pointed out his patch had nice functionality when a desktop
> icon was deleted (it did not prompt again for desktop icon to be created). It is worth considering.
See the separate sub-thread oook? Especially last record -
http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2013-January/021278.html (Unless Omair will
somehow negate it.
Thank you very much for review!
J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixedRecreationOfDesktopIcon-0004.patch
Type: text/x-patch
Size: 10990 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130102/6cc08f35/fixedRecreationOfDesktopIcon-0004.patch
From jvanek at icedtea.classpath.org Wed Jan 2 10:45:52 2013
From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org)
Date: Wed, 02 Jan 2013 18:45:52 +0000
Subject: /hg/icedtea-web: Fixed unittest for InformationElement
Message-ID:
changeset c638a94822e0 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=c638a94822e0
author: Jiri Vanek
date: Wed Jan 02 19:46:16 2013 +0100
Fixed unittest for InformationElement
diffstat:
ChangeLog | 7 +++++++
tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InformationElementTest.java | 2 +-
2 files changed, 8 insertions(+), 1 deletions(-)
diffs (26 lines):
diff -r a16da8b96a0f -r c638a94822e0 ChangeLog
--- a/ChangeLog Mon Dec 24 13:58:31 2012 +0100
+++ b/ChangeLog Wed Jan 02 19:46:16 2013 +0100
@@ -1,3 +1,10 @@
+2013-01-02 Jiri Vanek
+
+ Fixed unittest for InformationElement.
+ * tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InformationElementTest.java:
+ (createFromJNLP) now asserts NotNull instead of IsNull as result of
+ "Minor fix for possible NPE (non fatal) during splashscreen creation"
+
2012-12-21 Adam Domurad
* plugin/icedteanp/IcedTeaNPPlugin.cc: Remove need for 'goto' in
diff -r a16da8b96a0f -r c638a94822e0 tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InformationElementTest.java
--- a/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InformationElementTest.java Mon Dec 24 13:58:31 2012 +0100
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InformationElementTest.java Wed Jan 02 19:46:16 2013 +0100
@@ -221,7 +221,7 @@
public void createFromJNLP() throws UnsupportedEncodingException, ParseException {
JNLPFile jnlpFile0 = null;
InformationElement ie0 = InformationElement.createFromJNLP(jnlpFile0);
- Assert.assertNull(ie0);
+ Assert.assertNotNull(ie0);
String exJnlp1 = "this is invalid jnlp";
Exception ex = null;
JNLPFile jnlpFile1 = null;
From omajid at redhat.com Wed Jan 2 14:36:09 2013
From: omajid at redhat.com (Omair Majid)
Date: Wed, 02 Jan 2013 17:36:09 -0500
Subject: [rfc][icedtea-web] Reproducer of BeansStatement behaviour
In-Reply-To: <50D04D10.70402@redhat.com>
References: <50CA03C5.7080500@redhat.com> <50CB9307.5030801@redhat.com>
<50CF4FCD.30103@redhat.com> <50D04D10.70402@redhat.com>
Message-ID: <50E4B659.1080609@redhat.com>
On 12/18/2012 06:01 AM, Jiri Vanek wrote:
> On 12/17/2012 06:01 PM, Omair Majid wrote:
>> On 12/14/2012 03:58 PM, Adam Domurad wrote:
>>> On 12/13/2012 11:35 AM, Jiri Vanek wrote:
>>> Looks OK, although this seems like something that is better placed in a
>>> JRE's test suite, not ITWs.
>>
>> Agreed. While it is nice to have another test to check a security
>> property, I am not sure how sensible it is to add this test to
>> icedtea-web. The test is, after all, testing that the JRE enforces a
>> security check when a certain operation is performed. We do have a
>> number of tests that check that the code in icedtea-web is running in a
>> sandbox, but nothing that is as specific as this.
>>
>> I would like to know what's the motivation for adding this specific test
>> to icedtea-web.
>>
>
> Motivation is simple, this was once safe and working. Due to several
> changes in jdk this become penetrable.
I don't see why this means this bug should be tested in icedtea-web,
though. Surely there have been hundreds of vulnerabilities in the JRE.
Are we planning to test for all of them in icedtea-web? Should we also
test vulnerabilities in other parts of the stack? (Some libraries that
we use for graphics and audio have had vulnerabilities in the past)
> ITW is the way via which it can be misused.
IcedTea-Web is the vector, but there is nothing that we can do to
avoid/fix the security problem here. We are doing everything correctly,
and other code is behaving incorrectly.
It's not likely that we can introduce this bug in IcedTea-Web in the
future if we make a mistake either - there are already existing tests
that ensure that a SecurityManager is installed, which is all that JRE
should need to secure BeansStatement.
> I think that having such a
> reproducer run periodically can speed up discovery and so fix in case
> that some changes will lead to penetrability again.
I agree that a reproduce would be good to have, but I think it belongs
in OpenJDK (where the problem actually is) rather than in IcedTea-Web.
Cheers,
Omair
--
PGP Key: 66484681 (http://pgp.mit.edu/)
Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681
From jvanek at icedtea.classpath.org Thu Jan 3 00:53:53 2013
From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org)
Date: Thu, 03 Jan 2013 08:53:53 +0000
Subject: /hg/icedtea-web: Fixed unittest for InformationElement
Message-ID:
changeset 9549226afa8f in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=9549226afa8f
author: Jiri Vanek
date: Thu Jan 03 09:54:16 2013 +0100
Fixed unittest for InformationElement
diffstat:
tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InformationElementTest.java | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diffs (12 lines):
diff -r c638a94822e0 -r 9549226afa8f tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InformationElementTest.java
--- a/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InformationElementTest.java Wed Jan 02 19:46:16 2013 +0100
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InformationElementTest.java Thu Jan 03 09:54:16 2013 +0100
@@ -232,7 +232,7 @@
}
Assert.assertNotNull(ex);
InformationElement ie1 = InformationElement.createFromJNLP(jnlpFile1);
- Assert.assertNull(ie1);
+ Assert.assertNotNull(ie1);
//title, vendor and homepage are obligatory.. not so much to test
String exJnlp2 = testJnlpheader + title.toXml() + "\n" + homepage.toXml() + "\n" + vendor.toXml() + "\n" + testJnlpFooter;
From jvanek at redhat.com Thu Jan 3 05:12:22 2013
From: jvanek at redhat.com (Jiri Vanek)
Date: Thu, 03 Jan 2013 14:12:22 +0100
Subject: [rfc] [icedtea-web] desktop icon is pointing to cache instead
to real url
In-Reply-To: <50E4536F.5030803@redhat.com>
References: <50E45043.6070607@redhat.com> <50E4536F.5030803@redhat.com>
Message-ID: <50E583B6.8060203@redhat.com>
On 01/02/2013 04:34 PM, Adam Domurad wrote:
> On 01/02/2013 10:20 AM, Jiri Vanek wrote:
>> Hi!
>> During digging in desktop subsystem of ITW i found that desktop icon is pointing to cache instead
>> to url. HAve anybody idea why??? Eg it will not survive -Xclearcache,..
>
> I think this is the correct behaviour -- AFAICS this would allow it to work offline while pointing
> to the URL would not.
I don't think so. To clarify myself:
My idea is that javaws should find the cached version by itself. To deduct it from url. And do not
have the execution destination pointing to cahce itself :)
But ok, As Omair said, this is for now to allow offline launching. So unless you two disagree
somehow, I will postpone this patch until offline launching is fixed and working as expected.
>
>>
>> This simple patch should fix it to point to real url instead of cached version:
>>
>> diff -r a16da8b96a0f netx/net/sourceforge/jnlp/util/XDesktopEntry.java
>> --- a/netx/net/sourceforge/jnlp/util/XDesktopEntry.java Mon Dec 24 13:58:31 2012 +0100
>> +++ b/netx/net/sourceforge/jnlp/util/XDesktopEntry.java Wed Jan 02 16:17:53 2013 +0100
>> @@ -93,7 +93,7 @@
>> }
>>
>> //Shortcut executes the jnlp from cache and system preferred java..
>
> Just a note that this comment would need updating too
sure. Sorry.
>
>> - fileContents += "Exec=" + "javaws" + " \"" + cacheFile.getAbsolutePath() + "\"\n";
>> + fileContents += "Exec=" + "javaws" + " \"" + file.getSourceLocation() + "\"\n";
>>
>> return new StringReader(fileContents);
>
J.
From bugzilla-daemon at icedtea.classpath.org Thu Jan 3 05:25:10 2013
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Thu, 03 Jan 2013 13:25:10 +0000
Subject: [Bug 1246] New: when running sweethome3d, icedtea crashed
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1246
Bug ID: 1246
Summary: when running sweethome3d, icedtea crashed
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: rodseth at gmail.com
CC: unassigned at icedtea.classpath.org
Created attachment 811
--> http://icedtea.classpath.org/bugzilla/attachment.cgi?id=811&action=edit
core dump
Console output:
Java 3D: implicit antialiasing enabled
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f99c6518988, pid=9909, tid=140298424895232
#
# JRE version: 7.0_09-b30
# Java VM: OpenJDK 64-Bit Server VM (23.2-b09 mixed mode linux-amd64 compressed
oops)
# Problematic frame:
# C [libGL.so.1+0x84988] glXCreateNewContext+0x64b8
#
# Core dump written. Default location: /home/alexander/core or core.9909
#
# An error report file with more information is saved as:
# /home/alexander/hs_err_pid9909.log
#
# If you would like to submit a bug report, please include
# instructions on how to reproduce the bug and visit:
# http://icedtea.classpath.org/bugzilla
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
/usr/bin/sweethome3d: line 33: 9909 Avbrutt (SIGABRT) (core dumped)
$JAVA_HOME/bin/java -Xmx1024m -cp $CP com.eteks.sweethome3d.SweetHome3D -open
"$1"
Attaching core and hs_err_pid9909.log
This is on x86_64.
jdk7-openjdk 7.u9_2.3.3-1
/usr/lib/libGL.so is owned by nvidia-utils 310.19-1
Steps to reproduce:
* Start sweethome3d (is in AUR)
* Create a little room with some furniture (not sure if needed)
* Select 3D view -> Create video...
* Move around in the 3D window and press the red recording button for each
position
* Create several positions (at least 3-4)
* Click create to create the video
* While the video is being created, select 3D view -> Aerial view and move
around
* Make sure the video is long enough, so that there is time to move around
while it is being created
* Specifically, zoom out by scrolling the mouse wheel towards you in the aerial
view
* Crash!
See also Arch Linux bug report here: https://bugs.archlinux.org/task/32943
--
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/20130103/2a83606b/attachment.html
From bugzilla-daemon at icedtea.classpath.org Thu Jan 3 05:25:33 2013
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Thu, 03 Jan 2013 13:25:33 +0000
Subject: [Bug 1246] when running sweethome3d, icedtea crashed
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1246
--- Comment #1 from Alexander R?dseth ---
Created attachment 812
--> http://icedtea.classpath.org/bugzilla/attachment.cgi?id=812&action=edit
log
--
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/20130103/8e6d7f17/attachment.html
From bugzilla-daemon at icedtea.classpath.org Thu Jan 3 05:26:38 2013
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Thu, 03 Jan 2013 13:26:38 +0000
Subject: [Bug 1246] when running sweethome3d, icedtea crashed
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1246
Alexander R?dseth changed:
What |Removed |Added
----------------------------------------------------------------------------
Hardware|all |64-bit
--
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/20130103/bafda182/attachment.html
From jvanek at redhat.com Thu Jan 3 08:07:59 2013
From: jvanek at redhat.com (Jiri Vanek)
Date: Thu, 03 Jan 2013 17:07:59 +0100
Subject: [rfc][icedtea-web] make download indicator more compact
Message-ID: <50E5ACDF.7080609@redhat.com>
Hi!
This patch is adding "show details" to download indicator. For One jar jnlp files it behaviour is
unaffected. For Multiple jars there is just one progress bar, but can be shown "old stile" detailed
one via clicking to "Show details". Then can be minimalised by "hide details". Button is localised.
The button is nasty not nice.. Any better idea? but still this is better then previous approach.
Looking forward to have this inside!
Best rigards
J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixedDownloadIndicatorDialog.patch
Type: text/x-patch
Size: 10706 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130103/b10a5556/fixedDownloadIndicatorDialog.patch
From omajid at redhat.com Thu Jan 3 08:11:11 2013
From: omajid at redhat.com (Omair Majid)
Date: Thu, 03 Jan 2013 11:11:11 -0500
Subject: Regression in icedtea-web - parent classsloader have been stopped
to be invoked
In-Reply-To: <50CF81E5.4030603@redhat.com>
References: <50CF3042.1060908@redhat.com> <50CF81E5.4030603@redhat.com>
Message-ID: <50E5AD9F.7070506@redhat.com>
On 12/17/2012 03:34 PM, Adam Domurad wrote:
> On 12/17/2012 09:46 AM, Jiri Vanek wrote:
>> There is regression that parent class loader is never used for
>> searching in classes. I blame also review a lot (me:-/) because
>> unittest was broken by this commit.
>>
> Thanks for pointing this out (or rather forcing me to accept this wasn't
> a bad-test, quite good one in fact :), easy fix:
Fix looks okay to me.
Cheers,
Omair
--
PGP Key: 66484681 (http://pgp.mit.edu/)
Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681
From bugzilla-daemon at icedtea.classpath.org Thu Jan 3 08:36:52 2013
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Thu, 03 Jan 2013 16:36:52 +0000
Subject: [Bug 906] icedtea always redownloads web start application
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=906
Andrew John Hughes changed:
What |Removed |Added
----------------------------------------------------------------------------
CC|unassigned at icedtea.classpat |gnu.andrew at redhat.com
|h.org |
--
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/20130103/aa4b21cd/attachment.html
From bugzilla-daemon at icedtea.classpath.org Thu Jan 3 08:47:12 2013
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Thu, 03 Jan 2013 16:47:12 +0000
Subject: [Bug 1246] when running sweethome3d, icedtea crashed
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1246
Andrew John Hughes changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #812|application/octet-stream |text/plain
mime type| |
--
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/20130103/7a41c8a0/attachment.html
From bugzilla-daemon at icedtea.classpath.org Thu Jan 3 09:31:16 2013
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Thu, 03 Jan 2013 17:31:16 +0000
Subject: [Bug 1246] when running sweethome3d, icedtea crashed
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1246
Andrew John Hughes changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Hardware|64-bit |x86_64
Resolution|--- |INVALID
--- Comment #2 from Andrew John Hughes ---
This is a bug either in your GL library or Java3D, neither of which is part of
IcedTea. Please file a bug with the appropriate provider.
--
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/20130103/824be65d/attachment.html
From adomurad at icedtea.classpath.org Thu Jan 3 10:17:40 2013
From: adomurad at icedtea.classpath.org (adomurad at icedtea.classpath.org)
Date: Thu, 03 Jan 2013 18:17:40 +0000
Subject: /hg/icedtea-web: Fix CodeBaseClassLoaderTest.testParentClassLoad...
Message-ID:
changeset b758667cc17c in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=b758667cc17c
author: Adam Domurad
date: Thu Jan 03 13:17:37 2013 -0500
Fix CodeBaseClassLoaderTest.testParentClassLoaderIsAskedForClassesApplication
diffstat:
ChangeLog | 13 ++++++++++
netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | 11 ++++++--
tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceOutOfJar.java | 3 +-
tests/reproducers/custom/AppletExtendsFromOutsideJar/testcases/AppletExtendsFromOutsideJarTests.java | 3 +-
4 files changed, 25 insertions(+), 5 deletions(-)
diffs (87 lines):
diff -r 9549226afa8f -r b758667cc17c ChangeLog
--- a/ChangeLog Thu Jan 03 09:54:16 2013 +0100
+++ b/ChangeLog Thu Jan 03 13:17:37 2013 -0500
@@ -1,3 +1,16 @@
+2013-01-03 Adam Domurad
+
+ Fix breakage in unit test CodeBaseClassLoaderTest.testParentClassLoaderIsAskedForClassesApplication
+ * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
+ (CodeBaseClassLoader#findClassNonRecursive): New, call into
+ URLClassLoader#findClass
+ (CodeBaseClassLoader#findClass): Delegate JNLPClassLoader#findClass
+ (JNLPClassLoader#findClass): Call CodeBaseClassLoader#findClassNonRecursive
+ * tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceOutOfJar.java
+ (init): Add applet finish message.
+ * tests/reproducers/custom/AppletExtendsFromOutsideJar/testcases/AppletExtendsFromOutsideJarTests.java
+ (testClassInAppletFolder): Close quickly on applet finish message.
+
2013-01-02 Jiri Vanek
Fixed unittest for InformationElement.
diff -r 9549226afa8f -r b758667cc17c netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
--- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Thu Jan 03 09:54:16 2013 +0100
+++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Thu Jan 03 13:17:37 2013 -0500
@@ -1704,7 +1704,7 @@
// Try codebase loader
if (codeBaseLoader != null)
- return codeBaseLoader.findClass(name);
+ return codeBaseLoader.findClassNonRecursive(name);
// All else failed. Throw CNFE
throw new ClassNotFoundException(name);
@@ -2287,8 +2287,7 @@
super.addURL(url);
}
- @Override
- public Class> findClass(String name) throws ClassNotFoundException {
+ Class> findClassNonRecursive(String name) throws ClassNotFoundException {
// If we have searched this path before, don't try again
if (Arrays.equals(super.getURLs(), notFoundResources.get(name)))
throw new ClassNotFoundException(name);
@@ -2310,6 +2309,12 @@
}
}
+ @Override
+ public Class> findClass(String name) throws ClassNotFoundException {
+ // Calls JNLPClassLoader#findClass which may call into this.findClassNonRecursive
+ return getParentJNLPClassLoader().findClass(name);
+ }
+
/**
* Returns the output of super.findLoadedClass().
*
diff -r 9549226afa8f -r b758667cc17c tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceOutOfJar.java
--- a/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceOutOfJar.java Thu Jan 03 09:54:16 2013 +0100
+++ b/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceOutOfJar.java Thu Jan 03 13:17:37 2013 -0500
@@ -42,6 +42,7 @@
Referenced outOfJarReference = new Referenced();
public void init() {
- System.out.println("My simple applet is running.");
+ System.out.println("My simple applet is running.");
+ System.out.println("*** APPLET FINISHED ***");
}
}
diff -r 9549226afa8f -r b758667cc17c tests/reproducers/custom/AppletExtendsFromOutsideJar/testcases/AppletExtendsFromOutsideJarTests.java
--- a/tests/reproducers/custom/AppletExtendsFromOutsideJar/testcases/AppletExtendsFromOutsideJarTests.java Thu Jan 03 09:54:16 2013 +0100
+++ b/tests/reproducers/custom/AppletExtendsFromOutsideJar/testcases/AppletExtendsFromOutsideJarTests.java Thu Jan 03 13:17:37 2013 -0500
@@ -36,6 +36,7 @@
*/
import net.sourceforge.jnlp.ProcessResult;
+import net.sourceforge.jnlp.ServerAccess.AutoClose;
import net.sourceforge.jnlp.annotations.Bug;
import net.sourceforge.jnlp.annotations.NeedsDisplay;
import net.sourceforge.jnlp.annotations.TestInBrowsers;
@@ -55,7 +56,7 @@
@TestInBrowsers(testIn = { Browsers.one })
@Bug(id = "PR920")
public void testClassInAppletFolder() throws Exception {
- ProcessResult pr = server.executeBrowser("/AppletExtendsFromOutsideJar.html");
+ ProcessResult pr = server.executeBrowser("/AppletExtendsFromOutsideJar.html", AutoClose.CLOSE_ON_BOTH);
Assert.assertFalse("Linkage error should not occur but did!", pr.stderr.contains(LINKAGE_ERROR_OCCURRENCE));
Assert.assertTrue("Expected '" + APPLET_RUNNING + "', stdout was: " + pr.stdout, pr.stdout.contains(APPLET_RUNNING));
From adomurad at redhat.com Thu Jan 3 11:06:06 2013
From: adomurad at redhat.com (Adam Domurad)
Date: Thu, 03 Jan 2013 14:06:06 -0500
Subject: [rfc][icedtea-web] Fix for PR1198, JSObject passed incorrectly
to Javascript
In-Reply-To: <50BCF77F.2020808@redhat.com>
References: <50B92039.4070304@redhat.com> <50BCF77F.2020808@redhat.com>
Message-ID: <50E5D69E.1090807@redhat.com>
On 12/03/2012 02:03 PM, Adam Domurad wrote:
> On 11/30/2012 04:08 PM, Adam Domurad wrote:
>> Hi all. Attached is a fix for PR1198.
>>
>> I still plan to write unit tests for at least the new method
>> PluginAppletViewer.toObjectIDString, but I wanted to get this out
>> before leaving for the weekend.
>>
>> One tricky thing with this patch was that it had to consolidate _a
>> lot_ of duplicated functionality (actually I found some subtle
>> differences in handling, this should be more consistent). Once that
>> was done the actual patch was fairly straight forward.
>>
>> The basic issue was that JSObject was being passed as if it were a
>> normal Java object, when the liveconnect spec specifies that it
>> should be returned as the underlying javascript object.
>>
>> A method was added to JSObject to get the underlying reference. This
>> was kept package-private to not pollute its public interface. As
>> well, a new permission was added for accessing this method. To access
>> this outside of the package, a utility was created in JSUtil.
>>
>> This patch adds a special case to Java->JS communication when sending
>> objects, to indicate that a Javascript object is being passed.
>>
>> With patch applied, JSObjectFromEval should pass in all browsers.
>>
>> 2012-11-30 Adam Domurad
>>
>> Fix PR1198: JSObject passed incorrectly to Javascript
>> * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc: Pass extra
>> data for
>> 'jsobject' object result messages.
>> * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: Same.
>> * plugin/icedteanp/IcedTeaPluginUtils.cc: Add special casing of
>> javascript references passed from java.
>> *
>> plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java:
>> New permission for unboxing a JSObject's internal reference.
>> * plugin/icedteanp/java/netscape/javascript/JSObject.java
>> (getInternalReference): New, package-private, retrieves internal
>> reference (Must have proper permission).
>> * plugin/icedteanp/java/netscape/javascript/JSUtil.java
>> (getJSObjectInternalReference) New, utility for accessing
>> JSObject#getInternalReference from outside the package.
>> * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java:
>> (toObjectIDString): New, creates a string that precisely
>> identifies a
>> Java object.
>> (handleMessage): Replace a lot of duplicated functionality with
>> 'toObjectIDString'.
>> * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: Replace
>> duplicated functionality with 'toObjectIDString'.
>> *
>> tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java:
>> Don't print out type passed (differs from browser to browser).
>> *
>> tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java:
>> Don't check type passed (differs from browser to browser). Remove
>> known-to-fail. Reformat.
>
> As promised attached is the unit-test for the newly introduced
> Java->JS function (which encapsulates logic that was duplicated in
> many areas)
>
> Note that this patch contains a Makefile patch for unit testing
> sun.applet package, however this will be committed with another
> now-approved patch so I have left it out of the ChangeLog.
>
> ChangeLog:
> 2012-12-XX Adam Domurad
>
> Unit test for PluginAppletSecurityContext#toObjectIDString. Make
> PluginAppletSecurityContext more unit-testable.
> * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java:
> Don't initialize security manager in constructor. Fix a few Java->JS
> corner cases.
> * plugin/icedteanp/java/sun/applet/PluginMain.java: Initialize
> SecurityManager before creating PluginAppletSecurityContext.
> * tests/netx/unit/sun/applet/PluginAppletSecurityContextTest.java:
> Unit test for all the corner cases of converting a Java object to a
> string that can be precisely identified.
>
> Happy hacking,
> -Adam
Ping?
-Adam
From andrew at icedtea.classpath.org Thu Jan 3 17:06:38 2013
From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org)
Date: Fri, 04 Jan 2013 01:06:38 +0000
Subject: /hg/icedtea7: Update to b06 and add nss.cfg to source tree, not ...
Message-ID:
changeset 3e3ebf551eb1 in /hg/icedtea7
details: http://icedtea.classpath.org/hg/icedtea7?cmd=changeset;node=3e3ebf551eb1
author: Andrew John Hughes
date: Fri Jan 04 01:05:06 2013 +0000
Update to b06 and add nss.cfg to source tree, not build trees (see jdk/rev/ff10ac18cfbd)
2013-01-03 Andrew John Hughes
* patches/nss-not-enabled-config.patch:
Removed; included upstream.
* Makefile.am:
(OPENJDK_VERSION): Bump to b06.
(CORBA_CHANGESET): Update to IcedTea7 forest head.
(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.
(OPENJDK_TREE): Also depend on add-nss.
(ICEDTEA_PATCHES): Drop nss-not-enabled-config.patch
(clean-local): Remove clean-add-nss-debug.
(.PHONY): Remove clean-add-nss-debug and clean-add-nss-boot.
(add-nss): Copy nss.cfg into source tree rather than build tree.
(clean-add-nss): Matching change to cleanup rule.
(add-nss-debug): No longer needed.
(clean-add-nss-debug): Likewise.
(icedtea-stage2): Remove dependence on add-nss.
(icedtea-debug-stage2): Likewise for add-nss-debug.
(add-nss-boot): No longer needed.
(clean-add-nss-boot): Likewise.
(clean-icedtea-stage1): Remove clean-add-nss-boot.
* hotspot.map:
Update default to latest HotSpot in IcedTea7 forest.
* patches/nss-config.patch:
Update due to changes upstream & addition of
not enabled configuration to unpatched forest.
diffstat:
ChangeLog | 37 +++++++++++++++++++
Makefile.am | 69 ++++++++++++-----------------------
hotspot.map | 2 +-
patches/nss-config.patch | 53 +++++++++++++++++++++++----
patches/nss-not-enabled-config.patch | 14 -------
5 files changed, 107 insertions(+), 68 deletions(-)
diffs (289 lines):
diff -r 1a8e93b7fe96 -r 3e3ebf551eb1 ChangeLog
--- a/ChangeLog Wed Dec 19 18:38:08 2012 +0000
+++ b/ChangeLog Fri Jan 04 01:05:06 2013 +0000
@@ -1,3 +1,40 @@
+2013-01-03 Andrew John Hughes
+
+ * patches/nss-not-enabled-config.patch:
+ Removed; included upstream.
+ * Makefile.am:
+ (OPENJDK_VERSION): Bump to b06.
+ (CORBA_CHANGESET): Update to IcedTea7 forest head.
+ (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.
+ (OPENJDK_TREE): Also depend on add-nss.
+ (ICEDTEA_PATCHES): Drop nss-not-enabled-config.patch
+ (clean-local): Remove clean-add-nss-debug.
+ (.PHONY): Remove clean-add-nss-debug and clean-add-nss-boot.
+ (add-nss): Copy nss.cfg into source tree rather than build tree.
+ (clean-add-nss): Matching change to cleanup rule.
+ (add-nss-debug): No longer needed.
+ (clean-add-nss-debug): Likewise.
+ (icedtea-stage2): Remove dependence on add-nss.
+ (icedtea-debug-stage2): Likewise for add-nss-debug.
+ (add-nss-boot): No longer needed.
+ (clean-add-nss-boot): Likewise.
+ (clean-icedtea-stage1): Remove clean-add-nss-boot.
+ * hotspot.map:
+ Update default to latest HotSpot in IcedTea7 forest.
+ * patches/nss-config.patch:
+ Update due to changes upstream & addition of
+ not enabled configuration to unpatched forest.
+
2010-09-24 Andrew John Hughes
* Makefile.am:
diff -r 1a8e93b7fe96 -r 3e3ebf551eb1 Makefile.am
--- a/Makefile.am Wed Dec 19 18:38:08 2012 +0000
+++ b/Makefile.am Fri Jan 04 01:05:06 2013 +0000
@@ -1,22 +1,22 @@
# Dependencies
-OPENJDK_VERSION = b03
+OPENJDK_VERSION = b06
JDK_UPDATE_VERSION = 12
COMBINED_VERSION = $(JDK_UPDATE_VERSION)-$(OPENJDK_VERSION)
-CORBA_CHANGESET = c76fd939af52
-JAXP_CHANGESET = ff514c638d9c
-JAXWS_CHANGESET = c24ace5f1fd8
-JDK_CHANGESET = b10e1311a206
-LANGTOOLS_CHANGESET = a4f9ef26ecb2
-OPENJDK_CHANGESET = af7f3ffa51f0
+CORBA_CHANGESET = 1fc876ad27f5
+JAXP_CHANGESET = b67573b17099
+JAXWS_CHANGESET = 8c8c122d0fa8
+JDK_CHANGESET = 880acd2bf8d1
+LANGTOOLS_CHANGESET = 698d52b36615
+OPENJDK_CHANGESET = 9b35dbaf2afa
-CORBA_SHA256SUM = 66b69e1c9ef33fd241e7aafc718acc23c690961644fed1d13c85b6a29cfecf7b
-JAXP_SHA256SUM = b409e5656e6194c4d559d435e5ab0ec4ce2723c12e958f9ba429478719fe2db4
-JAXWS_SHA256SUM = f1732dca7254e8f3c00116eb2cd1fdcd44b6d1da1b19537f23e610acad6764b4
-JDK_SHA256SUM = 654a1fd889d17a8a6fd0a6f3fda697f18e7a0d81a4baff45f3c96014524bbb54
-LANGTOOLS_SHA256SUM = 224feb6a121c3da9a9e4c592c966bf9f2bfab589bb614419d4ca176248f08bc8
-OPENJDK_SHA256SUM = 21aaf8e746fcf51535b9e42b9ab0546c4de2dd3d1846d10b9123f16939f0ca6b
+CORBA_SHA256SUM = 2945cef860c0a3e5af69ffe370ed762bb620db855f97e16efef5b639144e3d93
+JAXP_SHA256SUM = 4eb3f831cb486c81e16ac5d37b30e0e309ba8e2e8d4a400382ee4fa0790ca268
+JAXWS_SHA256SUM = 35e075fc9d4c9de7df8905cf3238e87a9388e4028ff984b494b7fb6c36fd17e1
+JDK_SHA256SUM = c6db11a2f5e90f37a37d65615d7e5ffa0e0e066e4eb303cc98e23ac245b3425d
+LANGTOOLS_SHA256SUM = 6ec950b34cb8cc1c6aa64e25b492952a3ba0a53370bb6e5d5431922fa940b506
+OPENJDK_SHA256SUM = c42c018e3f2a5037d9c07e98ffb8784a732c5e1ebd5bb18c3587ca0e8825b27b
CACAO_VERSION = a567bcb7f589
CACAO_SHA256SUM = d49f79debc131a5694cae6ab3ba2864e7f3249ee8d9dc09aae8afdd4dc6b09f9
@@ -227,7 +227,7 @@
# Target to ensure a patched OpenJDK tree containing Zero & Shark
# and any overlays is available in $(abs_top_builddir)/openjdk
-OPENJDK_TREE = stamps/overlay.stamp
+OPENJDK_TREE = stamps/overlay.stamp stamps/add-nss.stamp
# Target to ensure a patched OpenJDK bootstrap tree containing
# Zero & Shark, any other overlays and the bootstrapping patches
@@ -292,8 +292,6 @@
if ENABLE_NSS
ICEDTEA_PATCHES += patches/nss-config.patch
-else
-ICEDTEA_PATCHES += patches/nss-not-enabled-config.patch
endif
if WITH_PAX
@@ -792,7 +790,7 @@
clean-icedtea-debug-stage2 clean-icedtea-stage1 clean-add-zero clean-add-zero-debug \
clean-add-cacao clean-add-cacao-debug clean-rt clean-rewrite-rhino clean-rewriter \
clean-add-systemtap clean-add-systemtap-debug clean-add-pulseaudio clean-add-pulseaudio-debug \
- clean-add-nss clean-add-nss-debug clean-add-tzdata-support clean-add-tzdata-support-debug
+ clean-add-nss clean-add-tzdata-support clean-add-tzdata-support-debug
if [ -e bootstrap ]; then \
rmdir bootstrap ; \
fi
@@ -824,8 +822,8 @@
clean-extract-hotspot clean-sanitise-openjdk \
clean-tests clean-tapset-report clean-add-systemtap \
clean-add-systemtap-debug clean-add-pulseaudio clean-add-pulseaudio-debug \
- clean-add-nss clean-add-nss-debug clean-add-tzdata-support clean-add-tzdata-support-debug \
- clean-add-systemtap-boot clean-add-pulseaudio-boot clean-add-nss-boot clean-add-tzdata-support-boot
+ clean-add-nss clean-add-tzdata-support clean-add-tzdata-support-debug \
+ clean-add-systemtap-boot clean-add-pulseaudio-boot clean-add-tzdata-support-boot
env:
@echo 'unset JAVA_HOME'
@@ -1773,13 +1771,12 @@
rm -f $(BUILD_OUTPUT_DIR)/j2re-image/lib/ext/pulse-java.jar
rm -f stamps/add-pulseaudio.stamp
-stamps/add-nss.stamp: stamps/icedtea.stamp
- cp $(abs_top_builddir)/nss.cfg \
- $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/security;
+stamps/add-nss.stamp: stamps/extract-openjdk.stamp
+ cp -v $(abs_top_builddir)/nss.cfg openjdk/jdk/src/share/lib/security;
touch stamps/add-nss.stamp
clean-add-nss:
- rm -f $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/security/nss.cfg
+ rm -f openjdk/jdk/src/share/lib/security/nss.cfg
rm -f stamps/add-nss.stamp
stamps/add-tzdata-support.stamp: stamps/icedtea.stamp
@@ -1880,15 +1877,6 @@
rm -f $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib/ext/pulse-java.jar
rm -f stamps/add-pulseaudio-debug.stamp
-stamps/add-nss-debug.stamp: stamps/icedtea-debug.stamp
- cp $(abs_top_builddir)/nss.cfg \
- $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/security;
- touch stamps/add-nss-debug.stamp
-
-clean-add-nss-debug:
- rm -f $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/security/nss.cfg
- rm -f stamps/add-nss-debug.stamp
-
stamps/add-tzdata-support-debug.stamp: stamps/icedtea-debug.stamp
if WITH_TZDATA_DIR
cp $(abs_top_builddir)/tz.properties \
@@ -1902,7 +1890,7 @@
stamps/icedtea-stage2.stamp: stamps/icedtea.stamp stamps/add-cacao.stamp \
stamps/add-zero.stamp stamps/add-jamvm.stamp stamps/add-systemtap.stamp \
- stamps/add-pulseaudio.stamp stamps/add-nss.stamp stamps/add-tzdata-support.stamp
+ stamps/add-pulseaudio.stamp stamps/add-tzdata-support.stamp
mkdir -p stamps
touch $@
@@ -1912,7 +1900,7 @@
stamps/icedtea-debug-stage2.stamp: stamps/icedtea-debug.stamp \
stamps/add-cacao-debug.stamp stamps/add-zero-debug.stamp stamps/add-jamvm-debug.stamp \
stamps/add-systemtap-debug.stamp stamps/add-pulseaudio-debug.stamp \
- stamps/add-nss-debug.stamp stamps/add/tzdata-support-debug.stamp
+ stamps/add/tzdata-support-debug.stamp
mkdir -p stamps
touch $@
@@ -1993,15 +1981,6 @@
rm -f $(BOOT_BUILD_OUTPUT_DIR)/j2re-image/lib/ext/pulse-java.jar
rm -f stamps/add-pulseaudio-boot.stamp
-stamps/add-nss-boot.stamp: stamps/icedtea-boot.stamp
- cp $(abs_top_builddir)/nss.cfg \
- $(BOOT_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/security;
- touch stamps/add-nss-boot.stamp
-
-clean-add-nss-boot:
- rm -f $(BOOT_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/security/nss.cfg
- rm -f stamps/add-nss-boot.stamp
-
stamps/add-tzdata-support-boot.stamp: stamps/icedtea-boot.stamp
if WITH_TZDATA_DIR
cp $(abs_top_builddir)/tz.properties \
@@ -2015,12 +1994,12 @@
stamps/icedtea-stage1.stamp: stamps/icedtea-boot.stamp \
stamps/add-systemtap-boot.stamp stamps/add-pulseaudio-boot.stamp \
- stamps/add-nss-boot.stamp stamps/add-tzdata-support-boot.stamp
+ stamps/add-tzdata-support-boot.stamp
mkdir -p stamps
touch $@
clean-icedtea-stage1: clean-add-systemtap-boot clean-add-pulseaudio-boot \
- clean-add-nss-boot clean-add-tzdata-support-boot
+ clean-add-tzdata-support-boot
rm -f stamps/icedtea-stage1.stamp
# Rebuild targets
diff -r 1a8e93b7fe96 -r 3e3ebf551eb1 hotspot.map
--- a/hotspot.map Wed Dec 19 18:38:08 2012 +0000
+++ b/hotspot.map Fri Jan 04 01:05:06 2013 +0000
@@ -1,3 +1,3 @@
# version url changeset sha256sum
-default http://icedtea.classpath.org/hg/icedtea7-forest/hotspot 2f82d59ddf61 1d38e0229d4318b51a16242f9091547e20e58065c9f7cc2b1dd7f2d5dcfa2a20
+default http://icedtea.classpath.org/hg/icedtea7-forest/hotspot 0685d07e5b43 ec2a2dd1423c62860925b24989729d356b441f250adc1496b5bc857baf7a2a44
zero http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/hotspot a456d0771ba0 09a64fca0beff0759ef1b461d63ed6a00e43032972781bb3a55e49d8b93f67d0
diff -r 1a8e93b7fe96 -r 3e3ebf551eb1 patches/nss-config.patch
--- a/patches/nss-config.patch Wed Dec 19 18:38:08 2012 +0000
+++ b/patches/nss-config.patch Fri Jan 04 01:05:06 2013 +0000
@@ -1,11 +1,48 @@
-diff -Nru openjdk.orig/jdk/src/share/lib/security/java.security openjdk/jdk/src/share/lib/security/java.security
---- openjdk.orig/jdk/src/share/lib/security/java.security 2011-09-22 01:56:22.000000000 +0100
-+++ openjdk/jdk/src/share/lib/security/java.security 2011-09-22 13:51:56.234039451 +0100
-@@ -52,6 +52,7 @@
- security.provider.7=org.jcp.xml.dsig.internal.dom.XMLDSigRI
- security.provider.8=sun.security.smartcardio.SunPCSC
- #security.provider.9=sun.security.ec.SunEC
-+security.provider.9=sun.security.pkcs11.SunPKCS11 ${java.home}/lib/security/nss.cfg
+diff --git a/src/share/lib/security/java.security-linux b/src/share/lib/security/java.security-linux
+--- openjdk/jdk/src/share/lib/security/java.security-linux
++++ openjdk/jdk/src/share/lib/security/java.security-linux
+@@ -55,7 +55,7 @@
+ # the NSS security provider was not enabled for this build; it can be enabled
+ # if NSS (libnss3) is available on the machine. The nss.cfg file may need
+ # editing to reflect the location of the NSS installation.
+-#security.provider.10=sun.security.pkcs11.SunPKCS11 ${java.home}/lib/security/nss.cfg
++security.provider.10=sun.security.pkcs11.SunPKCS11 ${java.home}/lib/security/nss.cfg
#
# Select the source of seed data for SecureRandom. By default an
+diff --git a/src/share/lib/security/java.security-macosx b/src/share/lib/security/java.security-macosx
+--- openjdk/jdk/src/share/lib/security/java.security-macosx
++++ openjdk/jdk/src/share/lib/security/java.security-macosx
+@@ -56,7 +56,7 @@
+ # the NSS security provider was not enabled for this build; it can be enabled
+ # if NSS (libnss3) is available on the machine. The nss.cfg file may need
+ # editing to reflect the location of the NSS installation.
+-#security.provider.11=sun.security.pkcs11.SunPKCS11 ${java.home}/lib/security/nss.cfg
++security.provider.11=sun.security.pkcs11.SunPKCS11 ${java.home}/lib/security/nss.cfg
+
+ #
+ # Select the source of seed data for SecureRandom. By default an
+diff --git a/src/share/lib/security/java.security-solaris b/src/share/lib/security/java.security-solaris
+--- openjdk/jdk/src/share/lib/security/java.security-solaris
++++ openjdk/jdk/src/share/lib/security/java.security-solaris
+@@ -57,7 +57,7 @@
+ # the NSS security provider was not enabled for this build; it can be enabled
+ # if NSS (libnss3) is available on the machine. The nss.cfg file may need
+ # editing to reflect the location of the NSS installation.
+-#security.provider.12=sun.security.pkcs11.SunPKCS11 ${java.home}/lib/security/nss.cfg
++security.provider.12=sun.security.pkcs11.SunPKCS11 ${java.home}/lib/security/nss.cfg
+
+ #
+ # Select the source of seed data for SecureRandom. By default an
+diff --git a/src/share/lib/security/java.security-windows b/src/share/lib/security/java.security-windows
+--- openjdk/jdk/src/share/lib/security/java.security-windows
++++ openjdk/jdk/src/share/lib/security/java.security-windows
+@@ -56,7 +56,7 @@
+ # the NSS security provider was not enabled for this build; it can be enabled
+ # if NSS (libnss3) is available on the machine. The nss.cfg file may need
+ # editing to reflect the location of the NSS installation.
+-#security.provider.11=sun.security.pkcs11.SunPKCS11 ${java.home}/lib/security/nss.cfg
++security.provider.11=sun.security.pkcs11.SunPKCS11 ${java.home}/lib/security/nss.cfg
+
+ #
+ # Select the source of seed data for SecureRandom. By default an
diff -r 1a8e93b7fe96 -r 3e3ebf551eb1 patches/nss-not-enabled-config.patch
--- a/patches/nss-not-enabled-config.patch Wed Dec 19 18:38:08 2012 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-diff -Nru openjdk.orig/jdk/src/share/lib/security/java.security openjdk/jdk/src/share/lib/security/java.security
---- openjdk.orig/jdk/src/share/lib/security/java.security 2011-09-22 01:56:22.000000000 +0100
-+++ openjdk/jdk/src/share/lib/security/java.security 2011-09-22 13:52:56.826997041 +0100
-@@ -52,6 +52,10 @@
- security.provider.7=org.jcp.xml.dsig.internal.dom.XMLDSigRI
- security.provider.8=sun.security.smartcardio.SunPCSC
- #security.provider.9=sun.security.ec.SunEC
-+# the NSS security provider was not enabled for this build; it can be enabled
-+# if NSS (libnss3) is available on the machine. The nss.cfg file may need
-+# editing to reflect the location of the NSS installation.
-+#security.provider.9=sun.security.pkcs11.SunPKCS11 ${java.home}/lib/security/nss.cfg
-
- #
- # Select the source of seed data for SecureRandom. By default an
From jvanek at redhat.com Fri Jan 4 01:43:20 2013
From: jvanek at redhat.com (Jiri Vanek)
Date: Fri, 04 Jan 2013 10:43:20 +0100
Subject: [rfc][icedtea-web] Fix for PR1198, JSObject passed incorrectly
to Javascript
In-Reply-To: <50BCF77F.2020808@redhat.com>
References: <50B92039.4070304@redhat.com> <50BCF77F.2020808@redhat.com>
Message-ID: <50E6A438.1010605@redhat.com>
On 12/03/2012 08:03 PM, Adam Domurad wrote:
> On 11/30/2012 04:08 PM, Adam Domurad wrote:
>> Hi all. Attached is a fix for PR1198.
>>
>> I still plan to write unit tests for at least the new method PluginAppletViewer.toObjectIDString, but I wanted to get this out before leaving for the weekend.
>>
>> One tricky thing with this patch was that it had to consolidate _a lot_ of duplicated functionality (actually I found some subtle differences in handling, this should be more consistent). Once that was done the actual patch was fairly straight forward.
>>
>> The basic issue was that JSObject was being passed as if it were a normal Java object, when the liveconnect spec specifies that it should be returned as the underlying javascript object.
>>
>> A method was added to JSObject to get the underlying reference. This was kept package-private to not pollute its public interface. As well, a new permission was added for accessing this method. To access this outside of the package, a utility was created in JSUtil.
>>
>> This patch adds a special case to Java->JS communication when sending objects, to indicate that a Javascript object is being passed.
>>
>> With patch applied, JSObjectFromEval should pass in all browsers.
>>
>> 2012-11-30 Adam Domurad
>>
>> Fix PR1198: JSObject passed incorrectly to Javascript
>> * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc: Pass extra data for
>> 'jsobject' object result messages.
>> * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: Same.
>> * plugin/icedteanp/IcedTeaPluginUtils.cc: Add special casing of
>> javascript references passed from java.
>> * plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java:
>> New permission for unboxing a JSObject's internal reference.
>> * plugin/icedteanp/java/netscape/javascript/JSObject.java
>> (getInternalReference): New, package-private, retrieves internal
>> reference (Must have proper permission).
>> * plugin/icedteanp/java/netscape/javascript/JSUtil.java
>> (getJSObjectInternalReference) New, utility for accessing
>> JSObject#getInternalReference from outside the package.
>> * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java:
>> (toObjectIDString): New, creates a string that precisely identifies a
>> Java object.
>> (handleMessage): Replace a lot of duplicated functionality with
>> 'toObjectIDString'.
>> * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: Replace
>> duplicated functionality with 'toObjectIDString'.
>> * tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java:
>> Don't print out type passed (differs from browser to browser).
>> * tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java:
>> Don't check type passed (differs from browser to browser). Remove
>> known-to-fail. Reformat.
>
> As promised attached is the unit-test for the newly introduced Java->JS function (which encapsulates logic that was duplicated in many areas)
>
> Note that this patch contains a Makefile patch for unit testing sun.applet package, however this will be committed with another now-approved patch so I have left it out of the ChangeLog.
>
> ChangeLog:
> 2012-12-XX Adam Domurad
>
> Unit test for PluginAppletSecurityContext#toObjectIDString. Make
> PluginAppletSecurityContext more unit-testable.
> * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java:
> Don't initialize security manager in constructor. Fix a few Java->JS
> corner cases.
> * plugin/icedteanp/java/sun/applet/PluginMain.java: Initialize
> SecurityManager before creating PluginAppletSecurityContext.
> * tests/netx/unit/sun/applet/PluginAppletSecurityContextTest.java:
> Unit test for all the corner cases of converting a Java object to a
> string that can be precisely identified.
>
> Happy hacking,
> -Adam
>
>
Tests first. A lot of questions....
> jsfix-unittest.patch
>
>
> diff --git a/Makefile.am b/Makefile.am
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -969,7 +969,7 @@ stamps/netx-unit-tests-compile.stamp: st
> mkdir -p $(NETX_UNIT_TEST_DIR)&& \
> $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \
> -d $(NETX_UNIT_TEST_DIR) \
> - -classpath $(JUNIT_JAR):$(NETX_DIR)/lib/classes.jar:$(TEST_EXTENSIONS_DIR) \
> + -classpath $(JUNIT_JAR):$(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar:$(NETX_DIR)/lib/classes.jar:$(TEST_EXTENSIONS_DIR) \
> @netx-unit-tests-source-files.txt&& \
> mkdir -p stamps&& \
> touch $@
> @@ -999,7 +999,7 @@ stamps/run-netx-unit-tests.stamp: stamps
> done ; \
> cd $(NETX_UNIT_TEST_DIR) ; \
> class_names=`cat $(UNIT_CLASS_NAMES)` ; \
> - CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):. \
> + CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):. \
Just for confirmation, I remember both those changes already in, little bit better (without installed path)
> $(BOOT_DIR)/bin/java -Xbootclasspath:$(RUNTIME) CommandLine $$class_names
> if WITH_XSLTPROC
> $(XSLTPROC) --stringparam logs logs_unit.html $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(NETX_UNIT_TEST_DIR)/tests-output.xml> $(TESTS_DIR)/index_unit.html
> diff --git a/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java b/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
> --- a/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
> +++ b/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
> @@ -53,7 +53,6 @@ import java.security.Permissions;
> import java.security.PrivilegedAction;
> import java.security.ProtectionDomain;
> import java.util.ArrayList;
> -import java.util.Arrays;
> import java.util.Hashtable;
> import java.util.List;
> import java.util.Map;
> @@ -241,16 +240,6 @@ public class PluginAppletSecurityContext
> public PluginAppletSecurityContext(int identifier) {
> this.identifier = identifier;
>
> - // We need a security manager.. and since there is a good chance that
> - // an applet will be loaded at some point, we should make it the SM
> - // that JNLPRuntime will try to install
> - if (System.getSecurityManager() == null) {
> - JNLPRuntime.initialize(/* isApplication */false);
> - JNLPRuntime.setDefaultLaunchHandler(new DefaultLaunchHandler(System.err));
> - }
> -
> - JNLPRuntime.disableExit();
> -
Can't the moving of this initiliazaton cause some hole?
What corner cases it fixed? Can't they be fixed by better way?
Anyway - it should be in different changeset.
> URL u = null;
> try {
> u = new URL("file://");
> @@ -348,16 +337,16 @@ public class PluginAppletSecurityContext
> */
> public String toObjectIDString(Object obj, Class> type, boolean unboxPrimitives) {
>
> + /* Void (can occur from declared return type), pass special "void" string: */
> + if (type == Void.TYPE) {
> + return "literalreturn void";
> + }
> +
> /* Null, pass special "null" string: */
> if (obj == null) {
> return "literalreturn null";
> }
>
> - /* Void (can occur from declared return type), pass special "void" string: */
> - if (type == Void.TYPE) {
> - return "literalreturn void";
> - }
> -
> /* Primitive, accurately represented by its toString() form: */
> boolean returnAsString = ( type == Boolean.TYPE
> || type == Byte.TYPE
> @@ -378,7 +367,7 @@ public class PluginAppletSecurityContext
>
> /* Floating point number, we ensure we give enough precision: */
> if ( type == Float.TYPE || type == Double.TYPE ||
> - ( unboxPrimitives&& (type == Double.class || type == Double.class) )) {
> + ( unboxPrimitives&& (type == Float.class || type == Double.class) )) {
Why this? Also Shouldn't it be in different changeset?
> return "literalreturn " + String.format("%308.308e", obj);
> }
>
> diff --git a/plugin/icedteanp/java/sun/applet/PluginMain.java b/plugin/icedteanp/java/sun/applet/PluginMain.java
> --- a/plugin/icedteanp/java/sun/applet/PluginMain.java
> +++ b/plugin/icedteanp/java/sun/applet/PluginMain.java
> @@ -73,6 +73,7 @@ import java.net.ProxySelector;
> import java.util.Enumeration;
> import java.util.Properties;
>
> +import net.sourceforge.jnlp.DefaultLaunchHandler;
> import net.sourceforge.jnlp.config.DeploymentConfiguration;
> import net.sourceforge.jnlp.runtime.JNLPRuntime;
> import net.sourceforge.jnlp.security.JNLPAuthenticator;
> @@ -106,6 +107,15 @@ public class PluginMain {
> // must be called before JNLPRuntime.initialize()
> JNLPRuntime.setRedirectStreams(redirectStreams);
>
> + // We need a security manager for PluginAppletSecurityContext,
> + // so we ensure it is initialized
> + if (System.getSecurityManager() == null) {
> + JNLPRuntime.initialize(/* isApplication */false);
> + JNLPRuntime.setDefaultLaunchHandler(new DefaultLaunchHandler(System.err));
> + }
> +
> + JNLPRuntime.disableExit();
> +
Concerns told above.
As mentioned - there is several changes I believe belongs to different changeset. If I'm wrong feel free to correct me.
I' have cced Jana to put her voice to js<->java communicaton,
> PluginAppletSecurityContext sc = new PluginAppletSecurityContext(0);
> sc.prePopulateLCClasses();
> PluginAppletSecurityContext.setStreamhandler(streamHandler);
> diff --git a/tests/netx/unit/sun/applet/PluginAppletSecurityContextTest.java b/tests/netx/unit/sun/applet/PluginAppletSecurityContextTest.java
> new file mode 100644
> --- /dev/null
> +++ b/tests/netx/unit/sun/applet/PluginAppletSecurityContextTest.java
> @@ -0,0 +1,181 @@
> +package sun.applet;
> +
> +import static org.junit.Assert.assertTrue;
> +import static org.junit.Assert.assertFalse;
> +import static org.junit.Assert.assertEquals;
> +
> +import netscape.javascript.JSObject;
> +
> +import org.junit.Test;
> +
> +public class PluginAppletSecurityContextTest {
> +
> + @Test
> + public void toIDStringNullTest() {
> + PluginAppletSecurityContext pasc = new PluginAppletSecurityContext(0);
> + assertEquals("literalreturn null",
> + pasc.toObjectIDString(null, Object.class, false));
> + }
> +
> + @Test
> + public void toIDStringVoidTest() {
> + PluginAppletSecurityContext pasc = new PluginAppletSecurityContext(0);
> + assertEquals("literalreturn void",
> + pasc.toObjectIDString(null, Void.TYPE, false));
> +
> + assertFalse("literalreturn void".equals(pasc.toObjectIDString(null,
> + Void.class, false)));
> + }
> +
> + @Test
> + public void toIDStringIntegralTest() {
> + // NB: the special .TYPE classes here represent primitives
> + PluginAppletSecurityContext pasc = new PluginAppletSecurityContext(0);
> +
> + // Test both unboxing allowed and not allowed to be sure it doesn't
> + // alter result
> + // although it really shouldn't
> + for (boolean unboxPrimitives : new Boolean[] { false, true }) {
> + assertEquals("literalreturn true", pasc.toObjectIDString(
> + new Boolean(true), Boolean.TYPE, unboxPrimitives));
> +
> + assertEquals("literalreturn 1", pasc.toObjectIDString(new Byte(
> + (byte) 1), Byte.TYPE, unboxPrimitives));
> +
> + assertEquals("literalreturn 1", pasc.toObjectIDString(
> + new Character((char) 1), Character.TYPE, unboxPrimitives));
> +
> + assertEquals("literalreturn 1", pasc.toObjectIDString(new Short(
> + (short) 1), Short.TYPE, unboxPrimitives));
> +
> + assertEquals("literalreturn 1", pasc.toObjectIDString(
> + new Integer(1), Integer.TYPE, unboxPrimitives));
> +
> + assertEquals("literalreturn 1", pasc.toObjectIDString(new Long(1),
> + Long.TYPE, unboxPrimitives));
> + }
> + }
> +
> + @Test
> + public void toIDStringBoxedIntegralNoUnboxingTest() {
> + PluginAppletSecurityContext pasc = new PluginAppletSecurityContext(0);
> +
> + assertFalse("literalreturn true".equals(pasc.toObjectIDString(
> + new Boolean(true), Boolean.class, false)));
> +
> + assertFalse("literalreturn 1".equals(pasc.toObjectIDString(new Byte(
> + (byte) 1), Byte.class, false)));
> +
> + assertFalse("literalreturn 1".equals(pasc.toObjectIDString(
> + new Character((char) 1), Character.class, false)));
> +
> + assertFalse("literalreturn 1".equals(pasc.toObjectIDString(new Short(
> + (short) 1), Short.class, false)));
> +
> + assertFalse("literalreturn 1".equals(pasc.toObjectIDString(new Integer(
> + 1), Integer.class, false)));
> +
> + assertFalse("literalreturn 1".equals(pasc.toObjectIDString(new Long(1),
> + Long.class, false)));
> + }
> +
> + @Test
> + public void toIDStringBoxedIntegralWithUnboxingTest() {
> + PluginAppletSecurityContext pasc = new PluginAppletSecurityContext(0);
> +
> + assertEquals("literalreturn true",
> + pasc.toObjectIDString(new Boolean(true), Boolean.class, true));
> +
> + assertEquals("literalreturn 1",
> + pasc.toObjectIDString(new Byte((byte) 1), Byte.class, true));
> +
> + assertEquals("literalreturn 1", pasc.toObjectIDString(new Character(
> + (char) 1), Character.class, true));
> +
> + assertEquals("literalreturn 1",
> + pasc.toObjectIDString(new Short((short) 1), Short.class, true));
> +
> + assertEquals("literalreturn 1",
> + pasc.toObjectIDString(new Integer(1), Integer.class, true));
> +
> + assertEquals("literalreturn 1",
> + pasc.toObjectIDString(new Long(1), Long.class, true));
> + }
> +
> + @Test
> + public void toIDStringFloatingPoint() {
> + final int prefixLength = "literalreturn ".length();
> +
> + // NB: the special .TYPE classes here represent primitives
> + PluginAppletSecurityContext pasc = new PluginAppletSecurityContext(0);
> +
> + // Test both unboxing allowed and not allowed to be sure it doesn't
> + // alter result
> + // although it really shouldn't
> + for (boolean unboxPrimitives : new Boolean[] { false, true }) {
> + {
> + final float testFloat = 3.141592f;
> + String idString = pasc.toObjectIDString(new Float(testFloat),
> + Float.TYPE, unboxPrimitives);
> + String floatRepr = idString.substring(prefixLength);
> + assertTrue(testFloat == Float.parseFloat(floatRepr));
> + }
> + {
> + final double testDouble = 3.141592;
> + String idString = pasc.toObjectIDString(new Double(testDouble),
> + Double.TYPE, unboxPrimitives);
> + String doubleRepr = idString.substring(prefixLength);
> + assertTrue(testDouble == Double.parseDouble(doubleRepr));
> + }
> +
> + }
> + {
> + final float testFloat = 3.141592f;
> + String idString = pasc.toObjectIDString(new Float(testFloat),
> + Float.class, true);
> + String floatRepr = idString.substring(prefixLength);
> + assertTrue(testFloat == Float.parseFloat(floatRepr));
> + }
> + {
> + final double testDouble = 3.141592;
> + String idString = pasc.toObjectIDString(new Double(testDouble),
> + Double.class, true);
> + String doubleRepr = idString.substring(prefixLength);
> + assertTrue(testDouble == Double.parseDouble(doubleRepr));
> + }
> + {
> + final float testFloat = 3.141592f;
> + String idString = pasc.toObjectIDString(new Float(testFloat),
> + Float.class, false);
> + assertFalse(idString.startsWith("literalreturn "));
> + }
> + {
> + final double testDouble = 3.141592;
> + String idString = pasc.toObjectIDString(new Double(testDouble),
> + Double.class, false);
> + assertFalse(idString.startsWith("literalreturn "));
> + }
> + }
> +
> +// FIXME: How can we get the permissions to do this?
no idea :(
Otherwise tests looks oook. Thank you!
> +// @Test
> +// public void toIDStringJSObject() {
> +// PluginAppletSecurityContext pasc = new PluginAppletSecurityContext(0);
> +//
> +// long testReference = 1;
> +// assertEquals("literalreturn 1", pasc.toObjectIDString(new JSObject(
> +// testReference), JSObject.class, false));
> +// }
> +
> + @Test
> + public void toIDStringArbitraryObject() {
> + PluginAppletSecurityContext pasc = new PluginAppletSecurityContext(0);
> +
> + final Object testObject = new Object();
> + String idString = pasc.toObjectIDString(testObject,
> + testObject.getClass(), false);
> +
> + assertFalse(idString.startsWith("literalreturn"));
> + assertFalse(idString.startsWith("jsobject"));
> + }
> +}
From jvanek at redhat.com Fri Jan 4 02:23:26 2013
From: jvanek at redhat.com (Jiri Vanek)
Date: Fri, 04 Jan 2013 11:23:26 +0100
Subject: [rfc][icedtea-web] Fix for PR1198, JSObject passed incorrectly
to Javascript
In-Reply-To: <50B92039.4070304@redhat.com>
References: <50B92039.4070304@redhat.com>
Message-ID: <50E6AD9E.9040100@redhat.com>
On 11/30/2012 10:08 PM, Adam Domurad wrote:
> Hi all. Attached is a fix for PR1198.
>
> I still plan to write unit tests for at least the new method PluginAppletViewer.toObjectIDString, but I wanted to get this out before leaving for the weekend.
>
> One tricky thing with this patch was that it had to consolidate _a lot_ of duplicated functionality (actually I found some subtle differences in handling, this should be more consistent). Once that was done the actual patch was fairly straight forward.
>
> The basic issue was that JSObject was being passed as if it were a normal Java object, when the liveconnect spec specifies that it should be returned as the underlying javascript object.
>
> A method was added to JSObject to get the underlying reference. This was kept package-private to not pollute its public interface. As well, a new permission was added for accessing this method. To access this outside of the package, a utility was created in JSUtil.
>
> This patch adds a special case to Java->JS communication when sending objects, to indicate that a Javascript object is being passed.
>
> With patch applied, JSObjectFromEval should pass in all browsers.
>
> 2012-11-30 Adam Domurad
>
> Fix PR1198: JSObject passed incorrectly to Javascript
> * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc: Pass extra data for
> 'jsobject' object result messages.
> * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: Same.
> * plugin/icedteanp/IcedTeaPluginUtils.cc: Add special casing of
> javascript references passed from java.
> * plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java:
> New permission for unboxing a JSObject's internal reference.
> * plugin/icedteanp/java/netscape/javascript/JSObject.java
> (getInternalReference): New, package-private, retrieves internal
> reference (Must have proper permission).
> * plugin/icedteanp/java/netscape/javascript/JSUtil.java
> (getJSObjectInternalReference) New, utility for accessing
> JSObject#getInternalReference from outside the package.
> * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java:
> (toObjectIDString): New, creates a string that precisely identifies a
> Java object.
> (handleMessage): Replace a lot of duplicated functionality with
> 'toObjectIDString'.
> * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: Replace
> duplicated functionality with 'toObjectIDString'.
> * tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java:
> Don't print out type passed (differs from browser to browser).
> * tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java:
> Don't check type passed (differs from browser to browser). Remove
> known-to-fail. Reformat.
>
>
> jsfix2.patch
>
Again adding Jana.
>
> diff --git a/NEWS b/NEWS
> --- a/NEWS
> +++ b/NEWS
> @@ -19,6 +19,7 @@ New in release 1.4 (2012-XX-XX):
> * Plugin
> - PR1106: Buffer overflow in plugin table-
> - PR1166: Embedded JNLP File is not supported in applet tag
> + - PR1198: JSObject is not passed to javascript correctly
> * Common
> - PR1049: Extension jnlp's signed jar with the content of only META-INF/* is considered
> - PR955: regression: SweetHome3D fails to run
> diff --git a/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc b/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc
> --- a/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc
> +++ b/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc
> @@ -131,7 +131,7 @@ JavaRequestProcessor::newMessageOnBus(co
> !message_parts->at(4)->find("GetObjectArrayElement"))
> {
>
> - if (!message_parts->at(5)->find("literalreturn"))
> + if (!message_parts->at(5)->find("literalreturn") || !message_parts->at(5)->find("jsobject"))
> {
> // literal returns don't have a corresponding jni id
> result->return_identifier = 0;
> diff --git a/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc b/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
> --- a/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
> +++ b/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
> @@ -413,7 +413,7 @@ PluginRequestProcessor::setMember(std::v
> member = (NPVariant*) (IcedTeaPluginUtilities::stringToJSID(*(message_parts->at(5))));
> propertyNameID = *(message_parts->at(6));
>
> - if (*(message_parts->at(7)) == "literalreturn")
> + if (*(message_parts->at(7)) == "literalreturn" || *(message_parts->at(7)) == "jsobject" )
> {
> value.append(*(message_parts->at(7)));
> value.append(" ");
> diff --git a/plugin/icedteanp/IcedTeaPluginUtils.cc b/plugin/icedteanp/IcedTeaPluginUtils.cc
> --- a/plugin/icedteanp/IcedTeaPluginUtils.cc
> +++ b/plugin/icedteanp/IcedTeaPluginUtils.cc
> @@ -776,6 +776,14 @@ javaStringResultToNPVariant(const std::s
> }
>
> static bool
> +javaJSObjectResultToNPVariant(const std::string& js_id, NPVariant* variant)
> +{
> + NPVariant* result_variant = (NPVariant*) IcedTeaPluginUtilities::stringToJSID(js_id);
> + *variant = *result_variant;
> + return true;
> +}
It returns always true?? Maybe void or *variant?
> +
> +static bool
> javaObjectResultToNPVariant(NPP instance, const std::string& jobject_id, NPVariant* variant)
> {
> // Reference the class object so we can construct an NPObject with it and the instance
> @@ -811,9 +819,14 @@ IcedTeaPluginUtilities::javaResultToNPVa
> std::string* java_value, NPVariant* variant)
> {
> int literal_n = sizeof("literalreturn"); // Accounts for one space char
> + int jsobject_n = sizeof("jsobject"); // Accounts for one space char
> +
> if (strncmp("literalreturn ", java_value->c_str(), literal_n) == 0)
> {
> javaPrimitiveResultToNPVariant(java_value->substr(literal_n), variant);
> + } else if (strncmp("jsobject ", java_value->c_str(), jsobject_n) == 0)
> + {
> + javaJSObjectResultToNPVariant(java_value->substr(jsobject_n), variant);
> } else
> {
> std::string jobject_id = *java_value;
> diff --git a/plugin/icedteanp/java/netscape/javascript/JSObject.java b/plugin/icedteanp/java/netscape/javascript/JSObject.java
> --- a/plugin/icedteanp/java/netscape/javascript/JSObject.java
> +++ b/plugin/icedteanp/java/netscape/javascript/JSObject.java
> @@ -100,6 +100,16 @@ public final class JSObject {
> }
>
> /**
> + * Package-private method used through JSUtil#getJSObjectInternalReference.
> + * We make this package-private to avoid polluting the public interface.
> + * @return the internal identifier
> + */
> + long getInternalReference() {
> + AccessController.getContext().checkPermission(new JSObjectUnboxPermission());
> + return internal;
> + }
> +
> + /**
> * it is illegal to construct a JSObject manually
> */
> public JSObject(int jsobj_addr) {
> diff --git a/plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java b/plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java
> new file mode 100644
> --- /dev/null
> +++ b/plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java
> @@ -0,0 +1,49 @@
> +/* JSObjectUnboxPermission.java
> + Copyright (C) 2012 Red Hat
> +
> +This file is part of IcedTea.
> +
> +IcedTea is free software; you can redistribute it and/or modify
> +it under the terms of the GNU General Public License as published by
> +the Free Software Foundation; either version 2, or (at your option)
> +any later version.
> +
> +IcedTea is distributed in the hope that it will be useful, but
> +WITHOUT ANY WARRANTY; without even the implied warranty of
> +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> +General Public License for more details.
> +
> +You should have received a copy of the GNU General Public License
> +along with IcedTea; see the file COPYING. If not, write to the
> +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> +02110-1301 USA.
> +
> +Linking this library statically or dynamically with other modules is
> +making a combined work based on this library. Thus, the terms and
> +conditions of the GNU General Public License cover the whole
> +combination.
> +
> +As a special exception, the copyright holders of this library give you
> +permission to link this library with independent modules to produce an
> +executable, regardless of the license terms of these independent
> +modules, and to copy and distribute the resulting executable under
> +terms of your choice, provided that you also meet, for each linked
> +independent module, the terms and conditions of the license of that
> +module. An independent module is a module which is not derived from
> +or based on this library. If you modify this library, you may extend
> +this exception to your version of the library, but you are not
> +obligated to do so. If you do not wish to do so, delete this
> +exception statement from your version. */
> +
> +package netscape.javascript;
> +
> +import java.security.BasicPermission;
> +
> +/**
> + * Permission to access internal reference of JSObject
> + */
> +public class JSObjectUnboxPermission extends BasicPermission {
> + public JSObjectUnboxPermission() {
> + super("JSObjectUnbox");
> + }
> +}
> diff --git a/plugin/icedteanp/java/netscape/javascript/JSUtil.java b/plugin/icedteanp/java/netscape/javascript/JSUtil.java
> --- a/plugin/icedteanp/java/netscape/javascript/JSUtil.java
> +++ b/plugin/icedteanp/java/netscape/javascript/JSUtil.java
> @@ -57,4 +57,16 @@ public class JSUtil {
>
> return captureStream.toString();
> }
> -}
> +
> + /**
> + * Uses package-private method JSObject.getInternalReference.
> + * This is package-private to avoid polluting the public interface.
> + * @param js JSObject to unbox
> + * @return the internal reference stored by the JSObject
> + */
> + public static long getJSObjectInternalReference(JSObject js) {
> + // NB: permission is checked in JSObject
> + return js.getInternalReference();
> + }
> +
> +}
> \ No newline at end of file
> diff --git a/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java b/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
> --- a/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
> +++ b/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
> @@ -53,13 +53,16 @@ import java.security.Permissions;
> import java.security.PrivilegedAction;
> import java.security.ProtectionDomain;
> import java.util.ArrayList;
> +import java.util.Arrays;
> import java.util.Hashtable;
> import java.util.List;
> import java.util.Map;
>
> +import net.sourceforge.jnlp.DefaultLaunchHandler;
> import net.sourceforge.jnlp.runtime.JNLPRuntime;
> -import net.sourceforge.jnlp.DefaultLaunchHandler;
> +import netscape.javascript.JSObject;
> import netscape.javascript.JSObjectCreatePermission;
> +import netscape.javascript.JSUtil;
cosmetic...
>
> class Signature {
> private String signature;
> @@ -318,6 +321,83 @@ public class PluginAppletSecurityContext
> return map;
> }
>
> + private static long privilegedJSObjectUnbox(final JSObject js) {
> + return AccessController.doPrivileged(new PrivilegedAction() {
> + public Long run() {
> + return JSUtil.getJSObjectInternalReference(js);
> + }
> + });
> + }
> +
> + /**
> + * Create a string that identifies a Java object precisely, for passing to
> + * Javascript.
> + *
> + * For builtin value types, a 'literalreturn' prefix is used and the object
> + * is passed with a string representation.
> + *
> + * For JSObject's, a 'jsobject' prefix is used and the object is passed
> + * with the JSObject's internal identifier.
> + *
> + * For other Java objects, an object store reference is used.
> + *
> + * @param obj the object for which to create an identifier
> + * @param type the type to use for representation decisions
> + * @param unboxPrimitives whether to treat boxed primitives as value types
> + * @return an identifier string
> + */
> + public String toObjectIDString(Object obj, Class> type, boolean unboxPrimitives) {
> +
> + /* Null, pass special "null" string: */
> + if (obj == null) {
> + return "literalreturn null";
> + }
> +
> + /* Void (can occur from declared return type), pass special "void" string: */
> + if (type == Void.TYPE) {
> + return "literalreturn void";
> + }
> +
> + /* Primitive, accurately represented by its toString() form: */
> + boolean returnAsString = ( type == Boolean.TYPE
> + || type == Byte.TYPE
> + || type == Short.TYPE
> + || type == Integer.TYPE
> + || type == Long.TYPE );
> + if (unboxPrimitives) {
> + returnAsString = ( returnAsString
> + || type == Boolean.class
> + || type == Byte.class
> + || type == Short.class
> + || type == Integer.class
> + || type == Long.class);
> + }
> + if (returnAsString) {
> + return "literalreturn " + obj.toString();
> + }
> +
> + /* Floating point number, we ensure we give enough precision: */
> + if ( type == Float.TYPE || type == Double.TYPE ||
> + ( unboxPrimitives&& (type == Double.class || type == Double.class) )) {
> + return "literalreturn " + String.format("%308.308e", obj);
> + }
> +
> + /* Character that should be returned as number: */
> + if (type == Character.TYPE || (unboxPrimitives&& type == Character.class)) {
> + return "literalreturn " + (int) (Character) obj;
> + }
> +
> + /* JSObject, unwrap underlying Javascript reference: */
> + if (type == netscape.javascript.JSObject.class) {
> + long reference = privilegedJSObjectUnbox((JSObject)obj);
> + return "jsobject " + Long.toString(reference);
> + }
> +
> + /* Other kind of object, track this object and return our reference: */
> + store.reference(obj);
> + return store.getIdentifier(obj).toString();
> + }
> +
> public void handleMessage(int reference, String src, AccessControlContext callContext, String message) {
>
> startTime = new java.util.Date().getTime();
> @@ -426,56 +506,16 @@ public class PluginAppletSecurityContext
> if (ret instanceof Throwable)
> throw (Throwable) ret;
>
> - if (ret == null) {
> - write(reference, "GetStaticField literalreturn null");
> - } else if (f.getType() == Boolean.TYPE
> - || f.getType() == Byte.TYPE
> - || f.getType() == Short.TYPE
> - || f.getType() == Integer.TYPE
> - || f.getType() == Long.TYPE) {
> - write(reference, "GetStaticField literalreturn " + ret);
> - } else if (f.getType() == Float.TYPE
> - || f.getType() == Double.TYPE) {
> - write(reference, "GetStaticField literalreturn " + String.format("%308.308e", ret));
> - } else if (f.getType() == Character.TYPE) {
> - write(reference, "GetStaticField literalreturn " + (int) (Character) ret);
> - } else {
> - // Track returned object.
> - store.reference(ret);
> - write(reference, "GetStaticField " + store.getIdentifier(ret));
> - }
> + String objIDStr = toObjectIDString(ret, f.getType(), false /*do not unbox primitives*/);
> + write(reference, "GetStaticField " + objIDStr);
> } else if (message.startsWith("GetValue")) {
> String[] args = message.split(" ");
> Integer index = parseCall(args[1], null, Integer.class);
>
> Object ret = store.getObject(index);
>
> - if (ret == null) {
> - write(reference, "GetValue literalreturn null");
> - } else if (ret.getClass() == Boolean.TYPE
> - || ret.getClass() == Boolean.class
> - || ret.getClass() == Byte.TYPE
> - || ret.getClass() == Byte.class
> - || ret.getClass() == Short.TYPE
> - || ret.getClass() == Short.class
> - || ret.getClass() == Integer.TYPE
> - || ret.getClass() == Integer.class
> - || ret.getClass() == Long.TYPE
> - || ret.getClass() == Long.class) {
> - write(reference, "GetValue literalreturn " + ret);
> - } else if (ret.getClass() == Float.TYPE
> - || ret.getClass() == Float.class
> - || ret.getClass() == Double.TYPE
> - || ret.getClass() == Double.class) {
> - write(reference, "GetValue literalreturn " + String.format("%308.308e", ret));
> - } else if (ret.getClass() == Character.TYPE
> - || ret.getClass() == Character.class) {
> - write(reference, "GetValue literalreturn " + (int) (Character) ret);
> - } else {
> - // Track returned object.
> - store.reference(ret);
> - write(reference, "GetValue " + store.getIdentifier(ret));
> - }
> + String objIDStr = toObjectIDString(ret, ret.getClass(), true /*unbox primitives*/);
> + write(reference, "GetValue " + objIDStr);
> } else if (message.startsWith("SetStaticField") ||
> message.startsWith("SetField")) {
> String[] args = message.split(" ");
> @@ -489,9 +529,7 @@ public class PluginAppletSecurityContext
> final Object fValue = MethodOverloadResolver.getCostAndCastedObject(value, f.getType())[1];
>
> AccessControlContext acc = callContext != null ? callContext : getClosedAccessControlContext();
> - checkPermission(src,
> - message.startsWith("SetStaticField") ? (Class) o : o.getClass(),
> - acc);
> + checkPermission(src, message.startsWith("SetStaticField") ? (Class) o : o.getClass(), acc);
>
> Object ret = AccessController.doPrivileged(new PrivilegedAction() {
> public Object run() {
> @@ -514,27 +552,12 @@ public class PluginAppletSecurityContext
> Integer arrayID = parseCall(args[1], null, Integer.class);
> Integer index = parseCall(args[2], null, Integer.class);
>
> - Object ret = Array.get(store.getObject(arrayID), index);
> - Class retClass = store.getObject(arrayID).getClass().getComponentType(); // prevent auto-boxing influence
> + Object array = store.getObject(arrayID);
> + Object ret = Array.get(array, index);
> + Class> retClass = array.getClass().getComponentType(); // prevent auto-boxing influence
>
> - if (ret == null) {
> - write(reference, "GetObjectArrayElement literalreturn null");
> - } else if (retClass == Boolean.TYPE
> - || retClass == Byte.TYPE
> - || retClass == Short.TYPE
> - || retClass == Integer.TYPE
> - || retClass == Long.TYPE) {
> - write(reference, "GetObjectArrayElement literalreturn " + ret);
> - } else if (retClass == Float.TYPE
> - || retClass == Double.TYPE) {
> - write(reference, "GetObjectArrayElement literalreturn " + String.format("%308.308e", ret));
> - } else if (retClass == Character.TYPE) {
> - write(reference, "GetObjectArrayElement literalreturn " + (int) (Character) ret);
> - } else {
> - // Track returned object.
> - store.reference(ret);
> - write(reference, "GetObjectArrayElement " + store.getIdentifier(ret));
> - }
> + String objIDStr = toObjectIDString(ret, retClass, false /*do not unbox primitives*/);
> + write(reference, "GetObjectArrayElement " + objIDStr);
>
> } else if (message.startsWith("SetObjectArrayElement")) {
> String[] args = message.split(" ");
> @@ -584,25 +607,8 @@ public class PluginAppletSecurityContext
> if (ret instanceof Throwable)
> throw (Throwable) ret;
>
> - if (ret == null) {
> - write(reference, "GetField literalreturn null");
> - } else if (f.getType() == Boolean.TYPE
> - || f.getType() == Byte.TYPE
> - || f.getType() == Short.TYPE
> - || f.getType() == Integer.TYPE
> - || f.getType() == Long.TYPE) {
> - write(reference, "GetField literalreturn " + ret);
> - } else if (f.getType() == Float.TYPE
> - || f.getType() == Double.TYPE) {
> - write(reference, "GetField literalreturn " + String.format("%308.308e", ret));
> - } else if (f.getType() == Character.TYPE) {
> - write(reference, "GetField literalreturn " + (int) (Character) ret);
> - } else {
> - // Track returned object.
> - store.reference(ret);
> - write(reference, "GetField " + store.getIdentifier(ret));
> - }
> -
> + String objIDStr = toObjectIDString(ret, f.getType(), false /*do not unbox primitives*/);
> + write(reference, "GetField " + objIDStr);
> } else if (message.startsWith("GetObjectClass")) {
> int oid = Integer.parseInt(message.substring("GetObjectClass"
> .length() + 1));
> @@ -688,27 +694,8 @@ public class PluginAppletSecurityContext
> , collapsedArgs, " and that returned: ", ret
> , " of type ", retO);
>
> - if (m.getReturnType().equals(java.lang.Void.class) ||
> - m.getReturnType().equals(java.lang.Void.TYPE)) {
> - write(reference, "CallMethod literalreturn void");
> - } else if (ret == null) {
> - write(reference, "CallMethod literalreturn null");
> - } else if (m.getReturnType() == Boolean.TYPE
> - || m.getReturnType() == Byte.TYPE
> - || m.getReturnType() == Short.TYPE
> - || m.getReturnType() == Integer.TYPE
> - || m.getReturnType() == Long.TYPE) {
> - write(reference, "CallMethod literalreturn " + ret);
> - } else if (m.getReturnType() == Float.TYPE
> - || m.getReturnType() == Double.TYPE) {
> - write(reference, "CallMethod literalreturn " + String.format("%308.308e", ret));
> - } else if (m.getReturnType() == Character.TYPE) {
> - write(reference, "CallMethod literalreturn " + (int) (Character) ret);
> - } else {
> - // Track returned object.
> - store.reference(ret);
> - write(reference, "CallMethod " + store.getIdentifier(ret));
> - }
> + String objIDStr = toObjectIDString(ret, m.getReturnType(), false /*do not unbox primitives*/);
> + write(reference, "CallMethod " + objIDStr);
Yap, this refactoring looks really nice and seems ok.
> } else if (message.startsWith("GetSuperclass")) {
> String[] args = message.split(" ");
> Integer classID = parseCall(args[1], null, Integer.class);
> @@ -776,10 +763,7 @@ public class PluginAppletSecurityContext
> buf = new StringBuffer(b.length * 2);
> buf.append(b.length);
> for (int i = 0; i< b.length; i++)
> - buf
> - .append(" "
> - + Integer
> - .toString(((int) b[i])& 0x0ff, 16));
> + buf.append(" " + Integer.toString(((int) b[i])& 0x0ff, 16));
Cosmetic change - see lower.
>
> write(reference, "GetStringUTFChars " + buf);
> } else if (message.startsWith("GetStringChars")) {
> @@ -795,10 +779,7 @@ public class PluginAppletSecurityContext
> buf = new StringBuffer(b.length * 2);
> buf.append(b.length);
> for (int i = 0; i< b.length; i++)
> - buf
> - .append(" "
> - + Integer
> - .toString(((int) b[i])& 0x0ff, 16));
> + buf.append(" " + Integer.toString(((int) b[i])& 0x0ff, 16));
Cosmetic change - see lower.
>
> PluginDebug.debug("Java: GetStringChars: ", o);
> PluginDebug.debug(" String BYTES: ", buf);
> @@ -815,10 +796,7 @@ public class PluginAppletSecurityContext
> buf = new StringBuffer(b.length * 2);
> buf.append(b.length);
> for (int i = 0; i< b.length; i++)
> - buf
> - .append(" "
> - + Integer
> - .toString(((int) b[i])& 0x0ff, 16));
> + buf.append(" " + Integer.toString(((int) b[i])& 0x0ff, 16));
Cosmetic change - see lower.
>
> write(reference, "GetToStringValue " + buf);
> } else if (message.startsWith("NewArray")) {
> 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
> @@ -1160,43 +1160,21 @@ public class PluginAppletViewer extends
> }
>
> public static void setMember(long internal, String name, Object value) {
> - System.err.println("Setting to class " + value.getClass() + ":" + value.getClass().isPrimitive());
> - AppletSecurityContextManager.getSecurityContext(0).store(name);
> - int nameID = AppletSecurityContextManager.getSecurityContext(0).getIdentifier(name);
> + PluginDebug.debug("Setting to class " + value.getClass() + ":" + value.getClass().isPrimitive());
nice catch, if you will be in mood, you can add this line to cosmetic changes as told below.
> + PluginAppletSecurityContext securityContext = AppletSecurityContextManager.getSecurityContext(0);
> + securityContext.store(name);
> + int nameID = securityContext.getIdentifier(name);
> Long reference = getRequestIdentifier();
>
> // work on a copy of value, as we don't want to be manipulating
> // complex objects
> - String valueToSetTo;
> - if (value instanceof java.lang.Byte ||
> - value instanceof java.lang.Character ||
> - value instanceof java.lang.Short ||
> - value instanceof java.lang.Integer ||
> - value instanceof java.lang.Long ||
> - value instanceof java.lang.Float ||
> - value instanceof java.lang.Double ||
> - value instanceof java.lang.Boolean) {
> -
> - valueToSetTo = "literalreturn " + value.toString();
> -
> - // Character -> Str results in str value.. we need int value as
> - // per specs.
> - if (value instanceof java.lang.Character) {
> - valueToSetTo = "literalreturn " + (int) ((java.lang.Character) value).charValue();
> - } else if (value instanceof Float ||
> - value instanceof Double) {
> - valueToSetTo = "literalreturn " + String.format("%308.308e", value);
> - }
> -
> - } else {
> - AppletSecurityContextManager.getSecurityContext(0).store(value);
> - valueToSetTo = Integer.toString(AppletSecurityContextManager.getSecurityContext(0).getIdentifier(value));
> - }
> + String objIDStr = securityContext.toObjectIDString(value,
> + value.getClass(), true /* unbox primitives */);
>
> // Prefix with dummy instance for convenience.
> PluginCallRequest request = requestFactory.getPluginCallRequest("void",
> "instance " + 0 + " reference " + reference + " SetMember " +
> - internal + " " + nameID + " " + valueToSetTo, reference);
> + internal + " " + nameID + " " + objIDStr, reference);
>
> streamhandler.postCallRequest(request);
> streamhandler.write(request.getMessage());
> @@ -1218,41 +1196,17 @@ public class PluginAppletViewer extends
>
> // FIXME: handle long index as well.
> public static void setSlot(long internal, int index, Object value) {
> - AppletSecurityContextManager.getSecurityContext(0).store(value);
> + PluginAppletSecurityContext securityContext = AppletSecurityContextManager.getSecurityContext(0);
> + securityContext.store(value);
> Long reference = getRequestIdentifier();
>
> - // work on a copy of value, as we don't want to be manipulating
> - // complex objects
> - String valueToSetTo;
> - if (value instanceof java.lang.Byte ||
> - value instanceof java.lang.Character ||
> - value instanceof java.lang.Short ||
> - value instanceof java.lang.Integer ||
> - value instanceof java.lang.Long ||
> - value instanceof java.lang.Float ||
> - value instanceof java.lang.Double ||
> - value instanceof java.lang.Boolean) {
> -
> - valueToSetTo = "literalreturn " + value.toString();
> -
> - // Character -> Str results in str value.. we need int value as
> - // per specs.
> - if (value instanceof java.lang.Character) {
> - valueToSetTo = "literalreturn " + (int) ((java.lang.Character) value).charValue();
> - } else if (value instanceof Float ||
> - value instanceof Double) {
> - valueToSetTo = "literalreturn " + String.format("%308.308e", value);
> - }
> -
> - } else {
> - AppletSecurityContextManager.getSecurityContext(0).store(value);
> - valueToSetTo = Integer.toString(AppletSecurityContextManager.getSecurityContext(0).getIdentifier(value));
> - }
> + String objIDStr = securityContext.toObjectIDString(value,
> + value.getClass(), true /* unbox primitives */);
>
> // Prefix with dummy instance for convenience.
> PluginCallRequest request = requestFactory.getPluginCallRequest("void",
> "instance " + 0 + " reference " + reference + " SetSlot " +
> - internal + " " + index + " " + valueToSetTo, reference);
> + internal + " " + index + " " + objIDStr, reference);
>
> streamhandler.postCallRequest(request);
> streamhandler.write(request.getMessage());
> diff --git a/tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java b/tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java
> --- a/tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java
> +++ b/tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java
> @@ -55,8 +55,6 @@ public class JSObjectFromEval extends Ap
> }
>
> public void setJSMember(JSObject js, String memb, Object val) {
> - String typeName = val.getClass().getName();
> - System.out.println("setJSMember: passed '" + typeName + "'");
Not worthy to keep in debug?
Anyway - cosmetic change. See my comment lower.
> js.setMember(memb, val);
> }
> }
> \ No newline at end of file
> diff --git a/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java b/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java
> --- a/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java
> +++ b/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java
> @@ -40,7 +40,6 @@ import static org.junit.Assert.assertTru
> import net.sourceforge.jnlp.ProcessResult;
> import net.sourceforge.jnlp.ServerAccess.AutoClose;
> 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 net.sourceforge.jnlp.browsertesting.BrowserTest;
> @@ -51,40 +50,37 @@ import org.junit.Test;
>
> public class JSObjectFromEvalTest extends BrowserTest {
>
> - private static final String END_STRING = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING;
> + private static final String END_STRING = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING;
>
> - private static final String JAVA_CREATE = "Java create\n";
> - private static final String JS_CREATE = "JS create\n";
> - private static final String JAVA_SET = "Java set\n";
> - private static final String PASSED_INTEGER = "setJSMember: passed 'java.lang.Integer'\n";
> - private static final String CORRECT_VALUE = "obj.test = 0";
> + private static final String JAVA_CREATE = "Java create\n";
> + private static final String JS_CREATE = "JS create\n";
> + private static final String JAVA_SET = "Java set\n";
> + private static final String CORRECT_VALUE = "obj.test = 0";
>
> - @Test
> - @TestInBrowsers(testIn = { Browsers.all })
> - @NeedsDisplay
> - @Bug(id = { "PR1198" })
> - @KnownToFail
> - public void testJSObjectSetMemberIsSet() throws Exception {
> - ProcessResult pr = server.executeBrowser("/JSObjectFromEval.html",
> - AutoClose.CLOSE_ON_BOTH);
> + @Test
> + @TestInBrowsers(testIn = { Browsers.all })
> + @NeedsDisplay
> + @Bug(id = { "PR1198" })
> + public void testJSObjectSetMemberIsSet() throws Exception {
> + ProcessResult pr = server.executeBrowser("/JSObjectFromEval.html",
> + AutoClose.CLOSE_ON_BOTH);
>
> - String expectedJSCreateOutput = JS_CREATE + JAVA_SET + PASSED_INTEGER
> - + CORRECT_VALUE;
> - String expectedJavaCreateOutput = JAVA_CREATE + JAVA_SET
> - + PASSED_INTEGER + CORRECT_VALUE;
> + String expectedJSCreateOutput = JS_CREATE + JAVA_SET + CORRECT_VALUE;
> + String expectedJavaCreateOutput = JAVA_CREATE + JAVA_SET
> + + CORRECT_VALUE;
>
> - // No reason JS create should fail, this is mostly a sanity check:
> - assertTrue("stdout should contain 'JS create [...] " + CORRECT_VALUE
> - + "' but did not.", pr.stdout.contains(expectedJSCreateOutput));
> + // No reason JS create should fail, this is mostly a sanity check:
> + assertTrue("stdout should contain 'JS create [...] " + CORRECT_VALUE
> + + "' but did not.", pr.stdout.contains(expectedJSCreateOutput));
>
> - // Demonstrates PR1198:
> - assertTrue("stdout should contain 'Java create [...] " + CORRECT_VALUE
> - + "' but did not.",
> - pr.stdout.contains(expectedJavaCreateOutput));
> + // Demonstrates PR1198:
> + assertTrue("stdout should contain 'Java create [...] " + CORRECT_VALUE
> + + "' but did not.",
> + pr.stdout.contains(expectedJavaCreateOutput));
>
> - // Make sure we got to the end of the script
> - assertTrue("stdout should contain '" + END_STRING + "' but did not.",
> - pr.stdout.contains(END_STRING));
> - }
> + // Make sure we got to the end of the script
> + assertTrue("stdout should contain '" + END_STRING + "' but did not.",
> + pr.stdout.contains(END_STRING));
> + }
>
> }
Cosmetic changes - normlay I'm for smughling small cosmetich changes which were found during coding, especially somnething like
> - buf
> - .append(" "
> - + Integer
> - .toString(((int) b[i])& 0x0ff, 16));
> + buf.append(" " + Integer.toString(((int) b[i])& 0x0ff, 16));
:))
into patch. But there is one whole refacotred file and little bit more. If you will be willing can you separate the changes? You can push the comsetic changes directly.
Well and then you will start to hate me with removing of KnowToFail...
Thanx for fix.
J.
ps: Try to check js<->java automated tests and manual liveConnect testuite. I think there wil be some hddien fixes by this aptch. Adnd With some luck also no regressions;) Maybe jana Can meassure those results for you. She is th eguru of liveConnect testing afterall..
pps: Dont take me wrong, this is really nice cleanup and fix.
From ptisnovs at icedtea.classpath.org Fri Jan 4 05:02:08 2013
From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org)
Date: Fri, 04 Jan 2013 13:02:08 +0000
Subject: /hg/icedtea7: Fixed build failure caused by changes in one Makef...
Message-ID:
changeset 2836b3c6739b in /hg/icedtea7
details: http://icedtea.classpath.org/hg/icedtea7?cmd=changeset;node=2836b3c6739b
author: Pavel Tisnovsky
date: Fri Jan 04 14:59:32 2013 +0100
Fixed build failure caused by changes in one Makefile altered by this
patch (make/sun/rmi/rmi/Makefile).
diffstat:
ChangeLog | 6 ++++++
patches/boot/use_target_6_for_bootstrap_classes.patch | 7 ++++---
2 files changed, 10 insertions(+), 3 deletions(-)
diffs (36 lines):
diff -r 3e3ebf551eb1 -r 2836b3c6739b ChangeLog
--- a/ChangeLog Fri Jan 04 01:05:06 2013 +0000
+++ b/ChangeLog Fri Jan 04 14:59:32 2013 +0100
@@ -1,3 +1,9 @@
+2013-01-04 Pavel Tisnovsky
+
+ * patches/boot/use_target_6_for_bootstrap_classes.patch:
+ Fixed build failure caused by changes in one Makefile altered by this
+ patch (make/sun/rmi/rmi/Makefile).
+
2013-01-03 Andrew John Hughes
* patches/nss-not-enabled-config.patch:
diff -r 3e3ebf551eb1 -r 2836b3c6739b patches/boot/use_target_6_for_bootstrap_classes.patch
--- a/patches/boot/use_target_6_for_bootstrap_classes.patch Fri Jan 04 01:05:06 2013 +0000
+++ b/patches/boot/use_target_6_for_bootstrap_classes.patch Fri Jan 04 14:59:32 2013 +0100
@@ -26,15 +26,16 @@
diff -r 9cf5ed6b45d6 make/sun/rmi/rmi/Makefile
--- openjdk-boot/jdk/make/sun/rmi/rmi/Makefile Mon Jul 25 16:20:39 2011 -0700
+++ openjdk-boot/jdk/make/sun/rmi/rmi/Makefile Thu Jul 28 03:12:35 2011 +0100
-@@ -33,6 +33,9 @@
- LIBRARY = rmi
+@@ -34,6 +32,10 @@
+ PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
+LANGUAGE_VERSION = -source 6
+CLASS_VERSION = -target 6
+
++
#
- # Add use of a mapfile
+ # Java files to compile.
#
diff -r 9cf5ed6b45d6 make/com/sun/jndi/rmi/registry/Makefile
--- openjdk-boot/jdk/make/com/sun/jndi/rmi/registry/Makefile Mon Jul 25 16:20:39 2011 -0700
From adomurad at redhat.com Fri Jan 4 08:09:12 2013
From: adomurad at redhat.com (Adam Domurad)
Date: Fri, 04 Jan 2013 11:09:12 -0500
Subject: [rfc][icedtea-web] Fix for resolving name of versioned jar in JNLP
Message-ID: <50E6FEA8.3010407@redhat.com>
Hi all. This fixes a bug in the versioning of jars, described here
http://docs.oracle.com/javase/tutorial/deployment/deploymentInDepth/avoidingUnnecessaryUpdateChecks.html
.
This bug prevented Spring jars such as j2-org.springframework.beans.jar
from downloading with the proper versioned name when I looked into
problems with the JNLP game 'ADOM2'.
Eg, j2-org.springframework.beans.jar with version 1.0
expected: j2-org.springframework.beans__V1.0.jar
result: j2-org__V1.0.springframework.beans.jar
The fix was easy, however I have added a few extra tests because this
part of the code did not seem to be under test (please do inform me if
it is tested somewhere).
The specific problem is tested in the unit-test
ResourceUrlCreatorTest.testVersionWithPeriods
2013-01-04 Adam Domurad
Fix for resolving name of versioned jar in JNLP.
* netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java
(getUrl): Fix versioning of jar names that have periods, eg
'foo.bar.jar'. Make method static for testing.
*
tests/netx/unit/net/sourceforge/jnlp/cache/ResourceUrlCreatorTest.java:
New, test version & pack URL encoding.
*
tests/reproducers/simple/VersionedJar__V1/resources/VersionedJarDisabled.jnlp:
New, tries to use versioned jar with versioning not turned on.
*
tests/reproducers/simple/VersionedJar__V1/resources/VersionedJarEnabled.jnlp:
New, tries to use versioned jar with versioning turned on.
* tests/reproducers/simple/VersionedJar__V1/srcs/VersionedJar.java:
New, prints simple message.
*
tests/reproducers/simple/VersionedJar__V1/testcases/VersionedJarTest.java:
New, tests if VersionedJar has ran only with versioning turned on.
Happy hacking,
-Adam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: versionedurlfix.patch
Type: text/x-patch
Size: 14614 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130104/0ae44891/versionedurlfix.patch
From adomurad at redhat.com Fri Jan 4 08:35:17 2013
From: adomurad at redhat.com (Adam Domurad)
Date: Fri, 04 Jan 2013 11:35:17 -0500
Subject: [rfc][icedtea-web] make download indicator more compact
In-Reply-To: <50E5ACDF.7080609@redhat.com>
References: <50E5ACDF.7080609@redhat.com>
Message-ID: <50E704C5.4060300@redhat.com>
On 01/03/2013 11:07 AM, Jiri Vanek wrote:
> Hi!
>
> This patch is adding "show details" to download indicator. For One jar
> jnlp files it behaviour is unaffected. For Multiple jars there is just
> one progress bar, but can be shown "old stile" detailed one via
> clicking to "Show details". Then can be minimalised by "hide
> details". Button is localised.
>
> The button is nasty not nice.. Any better idea? but still this is
> better then previous approach.
>
> Looking forward to have this inside!
>
> Best rigards
> J.
Thanks for looking into this! I was actually comparing our download
indicator to proprietary just yesterday, while staring at multiple jars
downloading. The average user does not want to know about the jars being
downloaded, in fact I think such information can look scary :-).
> diff -r 9549226afa8f
> netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java
> --- a/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java
> Thu Jan 03 09:54:16 2013 +0100
> +++ b/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java
> Thu Jan 03 17:07:28 2013 +0100
> @@ -62,6 +62,7 @@
>
> /** shared constraint */
> static GridBagConstraints vertical;
> + static GridBagConstraints verticalNoClean;
> static GridBagConstraints verticalIndent;
> static {
> vertical = new GridBagConstraints();
> @@ -70,8 +71,12 @@
> vertical.fill = GridBagConstraints.HORIZONTAL;
> vertical.anchor = GridBagConstraints.WEST;
>
> + verticalNoClean = new GridBagConstraints();
> + verticalNoClean.weightx = 1.0;
> +
> verticalIndent = (GridBagConstraints) vertical.clone();
> verticalIndent.insets = new Insets(0, 10, 3, 0);
> +
Nit: These two blank lines (and all the ones added below) have tabs :-)
> }
>
> /**
> @@ -114,15 +119,15 @@
>
> frame.getContentPane().add(result, vertical);
> frame.pack();
> -
> if (!frame.isVisible()) {
> - Dimension screenSize =
> Toolkit.getDefaultToolkit().getScreenSize();
> - Insets insets =
> Toolkit.getDefaultToolkit().getScreenInsets(frame.getGraphicsConfiguration());
> - Dimension screen = new Dimension(screenSize.width -
> insets.left,
> - screenSize.height - insets.top);
> - frame.setLocation(screen.width - frame.getWidth(),
> - screen.height - frame.getHeight());
> + placeFrameToLowerRight();
> }
> + result.addComponentListener(new ComponentAdapter() {
> + @Override
> + public void componentResized(ComponentEvent e) {
> + placeFrameToLowerRight();
> + }
> + });
>
> frame.setVisible(true);
>
> @@ -131,6 +136,32 @@
> }
>
> /**
> + * The insets are calculated differently during first appearance
> + * and during another appearance in case of some configurations.
> + *
> + * So the first value is stored to avoid jumping of window during
> later packing
> + * of frame.
> + *
> + * However the second calculation is more correct:(
> + *
> + * This is affecting only multiple monitors which have different
> assets.
> + * The underlying issue is that
> Toolkit.getDefaultToolkit().getScreenInsets
> + * is returning assets for "random" monitor.
> + */
> + Dimension screen = null;
> +
> + private void placeFrameToLowerRight() throws HeadlessException {
> + if (screen == null) {
> + Dimension screenSize =
> Toolkit.getDefaultToolkit().getScreenSize();
> + Insets insets =
> Toolkit.getDefaultToolkit().getScreenInsets(frame.getGraphicsConfiguration());
> + screen = new Dimension(screenSize.width - insets.left,
> + screenSize.height - insets.top);
> + }
> + frame.setLocation(screen.width - frame.getWidth(),
> + screen.height - frame.getHeight());
> + }
> +
> + /**
> * Remove a download service listener that was obtained by
> * calling the getDownloadListener method from the shared
> * download info window.
> @@ -163,12 +194,26 @@
> * Groups the url progress in a panel.
> */
> static class DownloadPanel extends JPanel implements
> DownloadServiceListener {
> -
> + private static enum States{
> + oneJAr, collapsed, detailed;
Enums should be all-caps
> +
> + }
> +
> + private static final String DETAILS=R("ButShowDetails");
> + private static final String HIDE_DETAILS=R("ButHideDetails");
> /** the download name */
> private String downloadName;
>
> /** Downloading part: */
> private JLabel header = new JLabel();
> + /** Show/hide details button: */
> + private JButton details = new JButton(DETAILS);
> + /** used instead of details button in case of one jar*/
> + private JLabel delimiter = new JLabel("");
> + /** all already created progress bars*/
> + private List progressPanels = new
> ArrayList();
> + private States state=States.oneJAr;
> + private ProgressPanel mainProgressPanel;
>
> /** list of URLs being downloaded */
> private List urls = new ArrayList();
> @@ -176,6 +221,7 @@
> /** list of ProgressPanels */
> private List panels = new
> ArrayList();
>
> +
Nit: two blank lines are unnecessary.
> /**
> * Create a new download panel for with the specified download
> * name.
> @@ -184,9 +230,35 @@
> setLayout(new GridBagLayout());
>
> this.downloadName = downloadName;
> - this.add(header, vertical);
> + this.add(header, verticalNoClean);
> header.setFont(header.getFont().deriveFont(Font.BOLD));
> -
> + this.add(delimiter, vertical);
> + details.addActionListener(new ActionListener() {
> + @Override
> + public void actionPerformed(ActionEvent e) {
> + if (state == States.detailed) {
> + state = States.collapsed;
> + details.setText(DETAILS);
> + for (ProgressPanel progressPanel :
> progressPanels) {
> + remove(progressPanel);
> + }
> + add(mainProgressPanel, verticalIndent);
> + synchronized (frameMutex) {
> + frame.pack();
> + }
> + } else {
> + state = States.detailed;
> + details.setText(HIDE_DETAILS);
> + remove(mainProgressPanel);
> + for (ProgressPanel progressPanel :
> progressPanels) {
> + add(progressPanel, verticalIndent);
> + }
> + synchronized (frameMutex) {
> + frame.pack();
> + }
> + }
> + }
> + });
> setOverallPercent(0);
> }
>
> @@ -196,14 +268,25 @@
> protected void addProgressPanel(URL url, String version) {
> if (!urls.contains(url)) {
> ProgressPanel panel = new ProgressPanel(url, version);
> -
> - add(panel, verticalIndent);
> + if (state != States.collapsed) {
> + add(panel, verticalIndent);
> + }
> + progressPanels.add(panel);
> + urls.add(url);
> + panels.add(panel);
> + if (panels.size() == 2){
Small comment here would be good explaining why this 'magic number'
> + remove(panels.get(0));
> + remove(panels.get(1));
> + remove(delimiter);
> + add(details,vertical);
> + mainProgressPanel=new ProgressPanel();
> + add(mainProgressPanel, verticalIndent);
> + state=States.collapsed;
> + }
> synchronized (frameMutex) {
> frame.pack();
> }
>
> - urls.add(url);
> - panels.add(panel);
> }
> }
>
> @@ -219,10 +302,10 @@
> addProgressPanel(url, version);
>
> setOverallPercent(overallPercent);
> -
> ProgressPanel panel = panels.get(urls.indexOf(url));
> panel.setProgress(readSoFar, total);
> panel.repaint();
> +
> }
> };
> SwingUtilities.invokeLater(r);
> @@ -230,12 +313,28 @@
>
> /**
> * Sets the overall percent completed.
> + * should be called via invokeLater
> */
> public void setOverallPercent(int percent) {
> // don't get whole string from resource and sub in
> // values because it'll be doing a MessageFormat for
> // each update.
> header.setText(downloading + " " + downloadName + ": " +
> percent + "% " + complete + ".");
> + Container c = header.getParent();
> + //we need to adapt nbboth panels and also frame to new
> length of header text
nbboth > both
> + while (c != null) {
> + c.invalidate();
> + c.validate();
> + if (c instanceof Window){
> + ((Window) c).pack();
> + }
> + c=c.getParent();
> + }
> +
> + if (mainProgressPanel != null) {
> + mainProgressPanel.setProgress(percent, 100);
> + mainProgressPanel.repaint();
> + }
> }
>
> /**
> @@ -276,12 +375,28 @@
>
> private long total;
> private long readSoFar;
> + private Dimension size = new Dimension(80, 15);
>
> + ProgressPanel() {
> + bar.setMinimumSize(size);
> + bar.setPreferredSize(size);
> + bar.setOpaque(false);
> +
> + setLayout(new GridBagLayout());
> +
> + GridBagConstraints gbc = new GridBagConstraints();
> + styleGridBagConstraints(gbc);
> + add(bar, gbc);
> + }
> +
> ProgressPanel(URL url, String version) {
> - JLabel location = new JLabel(" " + url.getHost() + "/" +
> url.getFile());
> + this(" " + url.getHost() + "/" + url.getFile(),version);
> + }
> + ProgressPanel(String caption, String version) {
> + JLabel location = new JLabel(caption);
>
> - bar.setMinimumSize(new Dimension(80, 15));
> - bar.setPreferredSize(new Dimension(80, 15));
> + bar.setMinimumSize(size);
> + bar.setPreferredSize(size);
> bar.setOpaque(false);
>
> setLayout(new GridBagLayout());
> @@ -291,12 +406,8 @@
> gbc.fill = GridBagConstraints.NONE;
> gbc.gridwidth = GridBagConstraints.RELATIVE;
> add(bar, gbc);
> -
> - gbc.insets = new Insets(0, 3, 0, 0);
> - gbc.weightx = 1.0;
> - gbc.fill = GridBagConstraints.HORIZONTAL;
> - gbc.gridwidth = GridBagConstraints.REMAINDER;
> - gbc.anchor = GridBagConstraints.WEST;
> +
> + styleGridBagConstraints(gbc);
> add(location, gbc);
> }
>
> @@ -325,6 +436,14 @@
> g.fillRect(x + 1, y + 1, divide - 1, h - 1);
> }
> }
> +
> + private void styleGridBagConstraints(GridBagConstraints gbc) {
> + gbc.insets = new Insets(0, 3, 0, 0);
> + gbc.weightx = 1.0;
> + gbc.fill = GridBagConstraints.HORIZONTAL;
> + gbc.gridwidth = GridBagConstraints.REMAINDER;
> + gbc.anchor = GridBagConstraints.WEST;
> + }
> };
>
> }
Code looks OK nits aside.
As for button ... yes it is nasty. IMO maybe we can take different
approach here. The people interested in how the individual jars are
downloading would mainly be 1. us trying to fix jar loading issues, 2.
developers looking into jar loading issues.
So what if the ICEDTEAPLUGIN_DEBUG environment variable turned this
on/off ? It can be argued it is a bit hard for developers to access, but
it isn't any easier to access this information from oracle plugin.
As well, I would be very happy to see the loading bar integrated with
the splash screen (if splash screen is on). I believe this would nicely
complement the user friendliness of the splash screen.
Happy hacking,
-Adam
From adomurad at redhat.com Fri Jan 4 09:19:41 2013
From: adomurad at redhat.com (Adam Domurad)
Date: Fri, 04 Jan 2013 12:19:41 -0500
Subject: [rfc][icedtea-web] Fix for PR1198, JSObject passed incorrectly
to Javascript
In-Reply-To: <50E6A438.1010605@redhat.com>
References: <50B92039.4070304@redhat.com> <50BCF77F.2020808@redhat.com>
<50E6A438.1010605@redhat.com>
Message-ID: <50E70F2D.2070805@redhat.com>
On 01/04/2013 04:43 AM, Jiri Vanek wrote:
> On 12/03/2012 08:03 PM, Adam Domurad wrote:
>> On 11/30/2012 04:08 PM, Adam Domurad wrote:
>>> Hi all. Attached is a fix for PR1198.
>>>
>>> I still plan to write unit tests for at least the new method
>>> PluginAppletViewer.toObjectIDString, but I wanted to get this out
>>> before leaving for the weekend.
>>>
>>> One tricky thing with this patch was that it had to consolidate _a
>>> lot_ of duplicated functionality (actually I found some subtle
>>> differences in handling, this should be more consistent). Once that
>>> was done the actual patch was fairly straight forward.
>>>
>>> The basic issue was that JSObject was being passed as if it were a
>>> normal Java object, when the liveconnect spec specifies that it
>>> should be returned as the underlying javascript object.
>>>
>>> A method was added to JSObject to get the underlying reference. This
>>> was kept package-private to not pollute its public interface. As
>>> well, a new permission was added for accessing this method. To
>>> access this outside of the package, a utility was created in JSUtil.
>>>
>>> This patch adds a special case to Java->JS communication when
>>> sending objects, to indicate that a Javascript object is being passed.
>>>
>>> With patch applied, JSObjectFromEval should pass in all browsers.
>>>
>>> 2012-11-30 Adam Domurad
>>>
>>> Fix PR1198: JSObject passed incorrectly to Javascript
>>> * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc: Pass extra
>>> data for
>>> 'jsobject' object result messages.
>>> * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: Same.
>>> * plugin/icedteanp/IcedTeaPluginUtils.cc: Add special casing of
>>> javascript references passed from java.
>>> *
>>> plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java:
>>> New permission for unboxing a JSObject's internal reference.
>>> * plugin/icedteanp/java/netscape/javascript/JSObject.java
>>> (getInternalReference): New, package-private, retrieves internal
>>> reference (Must have proper permission).
>>> * plugin/icedteanp/java/netscape/javascript/JSUtil.java
>>> (getJSObjectInternalReference) New, utility for accessing
>>> JSObject#getInternalReference from outside the package.
>>> *
>>> plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java:
>>> (toObjectIDString): New, creates a string that precisely
>>> identifies a
>>> Java object.
>>> (handleMessage): Replace a lot of duplicated functionality with
>>> 'toObjectIDString'.
>>> * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: Replace
>>> duplicated functionality with 'toObjectIDString'.
>>> *
>>> tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java:
>>> Don't print out type passed (differs from browser to browser).
>>> *
>>> tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java:
>>> Don't check type passed (differs from browser to browser). Remove
>>> known-to-fail. Reformat.
>>
>> As promised attached is the unit-test for the newly introduced
>> Java->JS function (which encapsulates logic that was duplicated in
>> many areas)
>>
>> Note that this patch contains a Makefile patch for unit testing
>> sun.applet package, however this will be committed with another
>> now-approved patch so I have left it out of the ChangeLog.
>>
>> ChangeLog:
>> 2012-12-XX Adam Domurad
>>
>> Unit test for PluginAppletSecurityContext#toObjectIDString. Make
>> PluginAppletSecurityContext more unit-testable.
>> *
>> plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java:
>> Don't initialize security manager in constructor. Fix a few
>> Java->JS
>> corner cases.
>> * plugin/icedteanp/java/sun/applet/PluginMain.java: Initialize
>> SecurityManager before creating PluginAppletSecurityContext.
>> * tests/netx/unit/sun/applet/PluginAppletSecurityContextTest.java:
>> Unit test for all the corner cases of converting a Java object to a
>> string that can be precisely identified.
>>
>> Happy hacking,
>> -Adam
>>
>>
>
> Tests first. A lot of questions....
>
>> jsfix-unittest.patch
>>
>>
>> diff --git a/Makefile.am b/Makefile.am
>> --- a/Makefile.am
>> +++ b/Makefile.am
>> @@ -969,7 +969,7 @@ stamps/netx-unit-tests-compile.stamp: st
>> mkdir -p $(NETX_UNIT_TEST_DIR)&& \
>> $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \
>> -d $(NETX_UNIT_TEST_DIR) \
>> - -classpath
>> $(JUNIT_JAR):$(NETX_DIR)/lib/classes.jar:$(TEST_EXTENSIONS_DIR) \
>> + -classpath
>> $(JUNIT_JAR):$(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar:$(NETX_DIR)/lib/classes.jar:$(TEST_EXTENSIONS_DIR)
>> \
>> @netx-unit-tests-source-files.txt&& \
>> mkdir -p stamps&& \
>> touch $@
>> @@ -999,7 +999,7 @@ stamps/run-netx-unit-tests.stamp: stamps
>> done ; \
>> cd $(NETX_UNIT_TEST_DIR) ; \
>> class_names=`cat $(UNIT_CLASS_NAMES)` ; \
>> -
>> CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):.
>> \
>> +
>> CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):.
>> \
>
> Just for confirmation, I remember both those changes already in,
> little bit better (without installed path)
This is already in, yes
>
>> $(BOOT_DIR)/bin/java -Xbootclasspath:$(RUNTIME) CommandLine
>> $$class_names
>> if WITH_XSLTPROC
>> $(XSLTPROC) --stringparam logs logs_unit.html
>> $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl
>> $(NETX_UNIT_TEST_DIR)/tests-output.xml> $(TESTS_DIR)/index_unit.html
>> diff --git
>> a/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
>> b/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
>> --- a/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
>> +++ b/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
>> @@ -53,7 +53,6 @@ import java.security.Permissions;
>> import java.security.PrivilegedAction;
>> import java.security.ProtectionDomain;
>> import java.util.ArrayList;
>> -import java.util.Arrays;
>> import java.util.Hashtable;
>> import java.util.List;
>> import java.util.Map;
>> @@ -241,16 +240,6 @@ public class PluginAppletSecurityContext
>> public PluginAppletSecurityContext(int identifier) {
>> this.identifier = identifier;
>>
>> - // We need a security manager.. and since there is a good
>> chance that
>> - // an applet will be loaded at some point, we should make it
>> the SM
>> - // that JNLPRuntime will try to install
>> - if (System.getSecurityManager() == null) {
>> - JNLPRuntime.initialize(/* isApplication */false);
>> - JNLPRuntime.setDefaultLaunchHandler(new
>> DefaultLaunchHandler(System.err));
>> - }
>> -
>> - JNLPRuntime.disableExit();
>> -
>
> Can't the moving of this initiliazaton cause some hole?
This code is invoked exactly once, and I figured this type of thing
shouldn't be in a constructor.
It was causing problems for my unit tests because of the security
manager it installed. A different solution is welcome.
The problem is I need access to PluginAppletSecurityContext
#toObjectIDString. It requires a security context instance. IMO this is
an indicator that this class 'does too much' (a class called
SecurityContext handling all the liveconnect logic??).
If you feel I should do it, I can move liveconnect logic into a
different class and then testing will be fine.
> What corner cases it fixed? Can't they be fixed by better way?
> Anyway - it should be in different changeset.
>
>> URL u = null;
>> try {
>> u = new URL("file://");
>> @@ -348,16 +337,16 @@ public class PluginAppletSecurityContext
>> */
>> public String toObjectIDString(Object obj, Class> type,
>> boolean unboxPrimitives) {
>>
>> + /* Void (can occur from declared return type), pass special
>> "void" string: */
>> + if (type == Void.TYPE) {
>> + return "literalreturn void";
>> + }
>> +
>> /* Null, pass special "null" string: */
>> if (obj == null) {
>> return "literalreturn null";
>> }
>>
>> - /* Void (can occur from declared return type), pass special
>> "void" string: */
>> - if (type == Void.TYPE) {
>> - return "literalreturn void";
>> - }
>> -
>> /* Primitive, accurately represented by its toString()
>> form: */
>> boolean returnAsString = ( type == Boolean.TYPE
>> || type == Byte.TYPE
>> @@ -378,7 +367,7 @@ public class PluginAppletSecurityContext
>>
>> /* Floating point number, we ensure we give enough
>> precision: */
>> if ( type == Float.TYPE || type == Double.TYPE ||
>> - ( unboxPrimitives&& (type == Double.class || type
>> == Double.class) )) {
>> + ( unboxPrimitives&& (type == Float.class || type ==
>> Double.class) )) {
>
> Why this? Also Shouldn't it be in different changeset?
I will move this into the fix itself, they were bugs discovered during
unit testing :-)
[.. rest snipped..]
From adomurad at icedtea.classpath.org Fri Jan 4 09:32:23 2013
From: adomurad at icedtea.classpath.org (adomurad at icedtea.classpath.org)
Date: Fri, 04 Jan 2013 17:32:23 +0000
Subject: /hg/icedtea-web: Minor code formatting & cosmetic changes
Message-ID:
changeset e335e39c382b in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=e335e39c382b
author: Adam Domurad
date: Fri Jan 04 12:32:15 2013 -0500
Minor code formatting & cosmetic changes
diffstat:
ChangeLog | 11 +
plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java | 14 +-
plugin/icedteanp/java/sun/applet/PluginAppletViewer.java | 10 +-
tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java | 2 -
tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java | 59 ++++-----
5 files changed, 54 insertions(+), 42 deletions(-)
diffs (186 lines):
diff -r b758667cc17c -r e335e39c382b ChangeLog
--- a/ChangeLog Thu Jan 03 13:17:37 2013 -0500
+++ b/ChangeLog Fri Jan 04 12:32:15 2013 -0500
@@ -1,3 +1,14 @@
+2013-01-04 Adam Domurad
+
+ * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java:
+ Code-formatting fixes and cosmetic changes.
+ * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java:
+ Same.
+ * tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java:
+ Same.
+ * tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java:
+ Same.
+
2013-01-03 Adam Domurad
Fix breakage in unit test CodeBaseClassLoaderTest.testParentClassLoaderIsAskedForClassesApplication
diff -r b758667cc17c -r e335e39c382b plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
--- a/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java Thu Jan 03 13:17:37 2013 -0500
+++ b/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java Fri Jan 04 12:32:15 2013 -0500
@@ -53,13 +53,16 @@
import java.security.PrivilegedAction;
import java.security.ProtectionDomain;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
+import net.sourceforge.jnlp.DefaultLaunchHandler;
import net.sourceforge.jnlp.runtime.JNLPRuntime;
-import net.sourceforge.jnlp.DefaultLaunchHandler;
+import netscape.javascript.JSObject;
import netscape.javascript.JSObjectCreatePermission;
+import netscape.javascript.JSUtil;
class Signature {
private String signature;
@@ -489,9 +492,7 @@
final Object fValue = MethodOverloadResolver.getCostAndCastedObject(value, f.getType())[1];
AccessControlContext acc = callContext != null ? callContext : getClosedAccessControlContext();
- checkPermission(src,
- message.startsWith("SetStaticField") ? (Class) o : o.getClass(),
- acc);
+ checkPermission(src, message.startsWith("SetStaticField") ? (Class) o : o.getClass(), acc);
Object ret = AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
@@ -514,8 +515,9 @@
Integer arrayID = parseCall(args[1], null, Integer.class);
Integer index = parseCall(args[2], null, Integer.class);
- Object ret = Array.get(store.getObject(arrayID), index);
- Class retClass = store.getObject(arrayID).getClass().getComponentType(); // prevent auto-boxing influence
+ Object array = store.getObject(arrayID);
+ Object ret = Array.get(array, index);
+ Class> retClass = array.getClass().getComponentType(); // prevent auto-boxing influence
if (ret == null) {
write(reference, "GetObjectArrayElement literalreturn null");
diff -r b758667cc17c -r e335e39c382b plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
--- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Thu Jan 03 13:17:37 2013 -0500
+++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Fri Jan 04 12:32:15 2013 -0500
@@ -1014,9 +1014,10 @@
}
public static void setMember(long internal, String name, Object value) {
- System.err.println("Setting to class " + value.getClass() + ":" + value.getClass().isPrimitive());
- AppletSecurityContextManager.getSecurityContext(0).store(name);
- int nameID = AppletSecurityContextManager.getSecurityContext(0).getIdentifier(name);
+ PluginDebug.debug("Setting to class " + value.getClass() + ":" + value.getClass().isPrimitive());
+ PluginAppletSecurityContext securityContext = AppletSecurityContextManager.getSecurityContext(0);
+ securityContext.store(name);
+ int nameID = securityContext.getIdentifier(name);
Long reference = getRequestIdentifier();
// work on a copy of value, as we don't want to be manipulating
@@ -1072,7 +1073,8 @@
// FIXME: handle long index as well.
public static void setSlot(long internal, int index, Object value) {
- AppletSecurityContextManager.getSecurityContext(0).store(value);
+ PluginAppletSecurityContext securityContext = AppletSecurityContextManager.getSecurityContext(0);
+ securityContext.store(value);
Long reference = getRequestIdentifier();
// work on a copy of value, as we don't want to be manipulating
diff -r b758667cc17c -r e335e39c382b tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java
--- a/tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java Thu Jan 03 13:17:37 2013 -0500
+++ b/tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java Fri Jan 04 12:32:15 2013 -0500
@@ -55,8 +55,6 @@
}
public void setJSMember(JSObject js, String memb, Object val) {
- String typeName = val.getClass().getName();
- System.out.println("setJSMember: passed '" + typeName + "'");
js.setMember(memb, val);
}
}
\ No newline at end of file
diff -r b758667cc17c -r e335e39c382b tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java
--- a/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java Thu Jan 03 13:17:37 2013 -0500
+++ b/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java Fri Jan 04 12:32:15 2013 -0500
@@ -37,10 +37,11 @@
import static org.junit.Assert.assertTrue;
+import net.sourceforge.jnlp.annotations.KnownToFail;
+
import net.sourceforge.jnlp.ProcessResult;
import net.sourceforge.jnlp.ServerAccess.AutoClose;
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 net.sourceforge.jnlp.browsertesting.BrowserTest;
@@ -51,40 +52,38 @@
public class JSObjectFromEvalTest extends BrowserTest {
- private static final String END_STRING = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING;
+ private static final String END_STRING = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING;
- private static final String JAVA_CREATE = "Java create\n";
- private static final String JS_CREATE = "JS create\n";
- private static final String JAVA_SET = "Java set\n";
- private static final String PASSED_INTEGER = "setJSMember: passed 'java.lang.Integer'\n";
- private static final String CORRECT_VALUE = "obj.test = 0";
+ private static final String JAVA_CREATE = "Java create\n";
+ private static final String JS_CREATE = "JS create\n";
+ private static final String JAVA_SET = "Java set\n";
+ private static final String CORRECT_VALUE = "obj.test = 0";
- @Test
- @TestInBrowsers(testIn = { Browsers.all })
- @NeedsDisplay
- @Bug(id = { "PR1198" })
- @KnownToFail
- public void testJSObjectSetMemberIsSet() throws Exception {
- ProcessResult pr = server.executeBrowser("/JSObjectFromEval.html",
- AutoClose.CLOSE_ON_BOTH);
+ @Test
+ @TestInBrowsers(testIn = { Browsers.all })
+ @NeedsDisplay
+ @KnownToFail
+ @Bug(id = { "PR1198" })
+ public void testJSObjectSetMemberIsSet() throws Exception {
+ ProcessResult pr = server.executeBrowser("/JSObjectFromEval.html",
+ AutoClose.CLOSE_ON_BOTH);
- String expectedJSCreateOutput = JS_CREATE + JAVA_SET + PASSED_INTEGER
- + CORRECT_VALUE;
- String expectedJavaCreateOutput = JAVA_CREATE + JAVA_SET
- + PASSED_INTEGER + CORRECT_VALUE;
+ String expectedJSCreateOutput = JS_CREATE + JAVA_SET + CORRECT_VALUE;
+ String expectedJavaCreateOutput = JAVA_CREATE + JAVA_SET
+ + CORRECT_VALUE;
- // No reason JS create should fail, this is mostly a sanity check:
- assertTrue("stdout should contain 'JS create [...] " + CORRECT_VALUE
- + "' but did not.", pr.stdout.contains(expectedJSCreateOutput));
+ // No reason JS create should fail, this is mostly a sanity check:
+ assertTrue("stdout should contain 'JS create [...] " + CORRECT_VALUE
+ + "' but did not.", pr.stdout.contains(expectedJSCreateOutput));
- // Demonstrates PR1198:
- assertTrue("stdout should contain 'Java create [...] " + CORRECT_VALUE
- + "' but did not.",
- pr.stdout.contains(expectedJavaCreateOutput));
+ // Demonstrates PR1198:
+ assertTrue("stdout should contain 'Java create [...] " + CORRECT_VALUE
+ + "' but did not.",
+ pr.stdout.contains(expectedJavaCreateOutput));
- // Make sure we got to the end of the script
- assertTrue("stdout should contain '" + END_STRING + "' but did not.",
- pr.stdout.contains(END_STRING));
- }
+ // Make sure we got to the end of the script
+ assertTrue("stdout should contain '" + END_STRING + "' but did not.",
+ pr.stdout.contains(END_STRING));
+ }
}
From adomurad at redhat.com Fri Jan 4 11:36:05 2013
From: adomurad at redhat.com (Adam Domurad)
Date: Fri, 04 Jan 2013 14:36:05 -0500
Subject: [rfc][icedtea-web] Fix for PR1198, JSObject passed incorrectly
to Javascript
In-Reply-To: <50E6AD9E.9040100@redhat.com>
References: <50B92039.4070304@redhat.com> <50E6AD9E.9040100@redhat.com>
Message-ID: <50E72F25.1030903@redhat.com>
On 01/04/2013 05:23 AM, Jiri Vanek wrote:
> [.. snipped..]
As you suggested, I have separated the cosmetic changes and pushed them.
It did prove quite tricky, though.
>>
>> diff --git a/NEWS b/NEWS
>> --- a/NEWS
>> +++ b/NEWS
>> @@ -19,6 +19,7 @@ New in release 1.4 (2012-XX-XX):
>> * Plugin
>> - PR1106: Buffer overflow in plugin table-
>> - PR1166: Embedded JNLP File is not supported in applet tag
>> + - PR1198: JSObject is not passed to javascript correctly
>> * Common
>> - PR1049: Extension jnlp's signed jar with the content of only
>> META-INF/* is considered
>> - PR955: regression: SweetHome3D fails to run
>> diff --git a/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc
>> b/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc
>> --- a/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc
>> +++ b/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc
>> @@ -131,7 +131,7 @@ JavaRequestProcessor::newMessageOnBus(co
>> !message_parts->at(4)->find("GetObjectArrayElement"))
>> {
>>
>> - if (!message_parts->at(5)->find("literalreturn"))
>> + if (!message_parts->at(5)->find("literalreturn") ||
>> !message_parts->at(5)->find("jsobject"))
>> {
>> // literal returns don't have a corresponding
>> jni id
>> result->return_identifier = 0;
>> diff --git a/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
>> b/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
>> --- a/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
>> +++ b/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
>> @@ -413,7 +413,7 @@ PluginRequestProcessor::setMember(std::v
>> member = (NPVariant*)
>> (IcedTeaPluginUtilities::stringToJSID(*(message_parts->at(5))));
>> propertyNameID = *(message_parts->at(6));
>>
>> - if (*(message_parts->at(7)) == "literalreturn")
>> + if (*(message_parts->at(7)) == "literalreturn" ||
>> *(message_parts->at(7)) == "jsobject" )
>> {
>> value.append(*(message_parts->at(7)));
>> value.append(" ");
>> diff --git a/plugin/icedteanp/IcedTeaPluginUtils.cc
>> b/plugin/icedteanp/IcedTeaPluginUtils.cc
>> --- a/plugin/icedteanp/IcedTeaPluginUtils.cc
>> +++ b/plugin/icedteanp/IcedTeaPluginUtils.cc
>> @@ -776,6 +776,14 @@ javaStringResultToNPVariant(const std::s
>> }
>>
>> static bool
>> +javaJSObjectResultToNPVariant(const std::string& js_id, NPVariant*
>> variant)
>> +{
>> + NPVariant* result_variant = (NPVariant*)
>> IcedTeaPluginUtilities::stringToJSID(js_id);
>> + *variant = *result_variant;
>> + return true;
>> +}
>
> It returns always true?? Maybe void or *variant?
I left this accidentally after it could no longer fail, made it void.
>
>> +
>> +static bool
>> javaObjectResultToNPVariant(NPP instance, const std::string&
>> jobject_id, NPVariant* variant)
>> {
>> // Reference the class object so we can construct an NPObject
>> with it and the instance
>> @@ -811,9 +819,14 @@ IcedTeaPluginUtilities::javaResultToNPVa
>> std::string* java_value, NPVariant* variant)
>> {
>> int literal_n = sizeof("literalreturn"); // Accounts for one
>> space char
>> + int jsobject_n = sizeof("jsobject"); // Accounts for one space char
>> +
>> if (strncmp("literalreturn ", java_value->c_str(), literal_n)
>> == 0)
>> {
>> javaPrimitiveResultToNPVariant(java_value->substr(literal_n), variant);
>> + } else if (strncmp("jsobject ", java_value->c_str(), jsobject_n)
>> == 0)
>> + {
>> + javaJSObjectResultToNPVariant(java_value->substr(jsobject_n),
>> variant);
>> } else
>> {
>> std::string jobject_id = *java_value;
>>
[... long snip...]
>> public void setJSMember(JSObject js, String memb, Object val) {
>> - String typeName = val.getClass().getName();
>> - System.out.println("setJSMember: passed '" + typeName + "'");
> Not worthy to keep in debug?
> Anyway - cosmetic change. See my comment lower.
No, this was part of the expected reproducer output. It was removed from
the checks because the type is dependent on the browser. It was causing
failures on some browsers. I have pushed it with my cosmetic changes anyway.
>> js.setMember(memb, val);
>> }
>> }
>> \ No newline at end of file
>> diff --git
>> a/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java
>> b/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java
>>
>> ---
>> a/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java
>> +++
>> b/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java
>> @@ -40,7 +40,6 @@ import static org.junit.Assert.assertTru
>> import net.sourceforge.jnlp.ProcessResult;
>> import net.sourceforge.jnlp.ServerAccess.AutoClose;
>> 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 net.sourceforge.jnlp.browsertesting.BrowserTest;
>> @@ -51,40 +50,37 @@ import org.junit.Test;
>>
>> public class JSObjectFromEvalTest extends BrowserTest {
>>
>> - private static final String END_STRING =
>> AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING;
>> + private static final String END_STRING =
>> AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING;
>>
>> - private static final String JAVA_CREATE = "Java create\n";
>> - private static final String JS_CREATE = "JS create\n";
>> - private static final String JAVA_SET = "Java set\n";
>> - private static final String PASSED_INTEGER = "setJSMember:
>> passed 'java.lang.Integer'\n";
>> - private static final String CORRECT_VALUE = "obj.test = 0";
>> + private static final String JAVA_CREATE = "Java create\n";
>> + private static final String JS_CREATE = "JS create\n";
>> + private static final String JAVA_SET = "Java set\n";
>> + private static final String CORRECT_VALUE = "obj.test = 0";
>>
>> - @Test
>> - @TestInBrowsers(testIn = { Browsers.all })
>> - @NeedsDisplay
>> - @Bug(id = { "PR1198" })
>> - @KnownToFail
>> - public void testJSObjectSetMemberIsSet() throws Exception {
>> - ProcessResult pr =
>> server.executeBrowser("/JSObjectFromEval.html",
>> - AutoClose.CLOSE_ON_BOTH);
>> + @Test
>> + @TestInBrowsers(testIn = { Browsers.all })
>> + @NeedsDisplay
>> + @Bug(id = { "PR1198" })
>> + public void testJSObjectSetMemberIsSet() throws Exception {
>> + ProcessResult pr =
>> server.executeBrowser("/JSObjectFromEval.html",
>> + AutoClose.CLOSE_ON_BOTH);
>>
>> - String expectedJSCreateOutput = JS_CREATE + JAVA_SET +
>> PASSED_INTEGER
>> - + CORRECT_VALUE;
>> - String expectedJavaCreateOutput = JAVA_CREATE + JAVA_SET
>> - + PASSED_INTEGER + CORRECT_VALUE;
>> + String expectedJSCreateOutput = JS_CREATE + JAVA_SET +
>> CORRECT_VALUE;
>> + String expectedJavaCreateOutput = JAVA_CREATE + JAVA_SET
>> + + CORRECT_VALUE;
>>
>> - // No reason JS create should fail, this is mostly a sanity
>> check:
>> - assertTrue("stdout should contain 'JS create [...] " +
>> CORRECT_VALUE
>> - + "' but did not.",
>> pr.stdout.contains(expectedJSCreateOutput));
>> + // No reason JS create should fail, this is mostly a sanity
>> check:
>> + assertTrue("stdout should contain 'JS create [...] " +
>> CORRECT_VALUE
>> + + "' but did not.",
>> pr.stdout.contains(expectedJSCreateOutput));
>>
>> - // Demonstrates PR1198:
>> - assertTrue("stdout should contain 'Java create [...] " +
>> CORRECT_VALUE
>> - + "' but did not.",
>> - pr.stdout.contains(expectedJavaCreateOutput));
>> + // Demonstrates PR1198:
>> + assertTrue("stdout should contain 'Java create [...] " +
>> CORRECT_VALUE
>> + + "' but did not.",
>> + pr.stdout.contains(expectedJavaCreateOutput));
>>
>> - // Make sure we got to the end of the script
>> - assertTrue("stdout should contain '" + END_STRING + "' but
>> did not.",
>> - pr.stdout.contains(END_STRING));
>> - }
>> + // Make sure we got to the end of the script
>> + assertTrue("stdout should contain '" + END_STRING + "' but
>> did not.",
>> + pr.stdout.contains(END_STRING));
>> + }
>>
>> }
>
> Cosmetic changes - normlay I'm for smughling small cosmetich changes
> which were found during coding, especially somnething like
> > - buf
> > - .append(" "
> > - + Integer
> > - .toString(((int) b[i])& 0x0ff, 16));
> > + buf.append(" " + Integer.toString(((int)
> b[i])& 0x0ff, 16));
>
> :))
>
> into patch. But there is one whole refacotred file and little bit
> more. If you will be willing can you separate the changes? You can
> push the comsetic changes directly.
>
> Well and then you will start to hate me with removing of KnowToFail...
> Thanx for fix.
> J.
>
>
> ps: Try to check js<->java automated tests and manual liveConnect
> testuite. I think there wil be some hddien fixes by this aptch. Adnd
> With some luck also no regressions;) Maybe jana Can meassure those
> results for you. She is th eguru of liveConnect testing afterall..
> pps: Dont take me wrong, this is really nice cleanup and fix.
Will do.
Attached is an updated patch, with some cleanup removed (since it was
pushed) and the fixes from my unit test patch added.
See my reply to unit test review though -- I need some additional advice
on what to do about the security manager problem.
Happy hacking,
-Adam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jsfix3.patch
Type: text/x-patch
Size: 26866 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130104/2509b0a9/jsfix3.patch
From amiko212 at 126.com Sat Jan 5 22:04:01 2013
From: amiko212 at 126.com (liu chao jun)
Date: Sun, 6 Jan 2013 14:04:01 +0800 (CST)
Subject: Run SPECJVM2008 Error
Message-ID: <3d6ca.1e99d.13c0e75688b.Coremail.amiko212@126.com>
hi all ,
A new bug was found when i run SPEJVM2008 after finishing developing icedtea1-11-4 against llvm-3.2 , When it runs ok
until startup.scimark.* ,it seems stop but the java process of it is alive ,however if i kill the process of the startup.scimark.*
manual the current case is run ok ,but the next is the same , is anybody met this before ? Thank you very much !
BR//Amiko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130106/99f1f487/attachment.html
From bugzilla-daemon at icedtea.classpath.org Sun Jan 6 09:31:00 2013
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Sun, 06 Jan 2013 17:31:00 +0000
Subject: [Bug 1248] New: Fails to load "NemId" internet banking login applet
("Invalid checksum occurred")
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1248
Bug ID: 1248
Summary: Fails to load "NemId" internet banking login applet
("Invalid checksum occurred")
Classification: Unclassified
Product: IcedTea
Version: 7-1.3
Hardware: arm
OS: Linux
Status: NEW
Severity: major
Priority: P3
Component: NPPlugin
Assignee: dbhole at redhat.com
Reporter: runesvend at gmail.com
CC: unassigned at icedtea.classpath.org
Created attachment 814
--> http://icedtea.classpath.org/bugzilla/attachment.cgi?id=814&action=edit
firefox terminal output
This bug occurs in Firefox running in Ubuntu (armhf) on a Samsung ARM
Chromebook.
Steps to reproduce:
Go to the site https://www.portalbank.dk/6610/
What happens:
The plugin on the site fails to load. Errors in the terminal output mention
"Invalid checksum occurred".
Please let me know if there are additional steps I can take to help diagnose
this issue (as I realize not everyone has armhf hardware available, which may
be why this bug happens).
--
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/20130106/87f5384f/attachment.html
From bugzilla-daemon at icedtea.classpath.org Sun Jan 6 09:32:25 2013
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Sun, 06 Jan 2013 17:32:25 +0000
Subject: [Bug 1248] Fails to load "NemId" internet banking login applet
("Invalid checksum occurred")
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1248
Rune K. Svendsen changed:
What |Removed |Added
----------------------------------------------------------------------------
URL| |https://www.portalbank.dk/6
| |610/
CC| |runesvend at gmail.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/20130106/03f1fdec/attachment.html
From bugzilla-daemon at icedtea.classpath.org Sun Jan 6 15:12:07 2013
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Sun, 06 Jan 2013 23:12:07 +0000
Subject: [Bug 1248] Fails to load "NemId" internet banking login applet
("Invalid checksum occurred")
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1248
Rune K. Svendsen changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Rune K. Svendsen ---
Upon further research, it appears that the applet in question loads
x86-specific binaries for execution.
The file DanID_Applet.jar contains an x86 ELF file disguised as a GIF file:
error.gif: ELF 32-bit LSB shared object, Intel 80386,
version 1 (SYSV), dynamically linked,
BuildID[sha1]=0x24d556c0242ff5b0f28d097a920c4f82d6e89aca, not stripped
Apparently this collects various system information to create a "checksum" that
is sent to the bank and logged.
--
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/20130106/8870cca4/attachment.html
From ptisnovs at icedtea.classpath.org Mon Jan 7 01:54:39 2013
From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org)
Date: Mon, 07 Jan 2013 09:54:39 +0000
Subject: /hg/rhino-tests: Added new test and updated three other tests in...
Message-ID:
changeset 87019bd63c13 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=87019bd63c13
author: Pavel Tisnovsky
date: Mon Jan 07 10:57:47 2013 +0100
Added new test and updated three other tests in the test case AbstractScriptEngineClassTest.
diffstat:
ChangeLog | 6 +
src/org/RhinoTests/AbstractScriptEngineClassTest.java | 63 +++++++++++++++---
2 files changed, 59 insertions(+), 10 deletions(-)
diffs (152 lines):
diff -r f2a6c496bf93 -r 87019bd63c13 ChangeLog
--- a/ChangeLog Fri Dec 21 11:21:05 2012 +0100
+++ b/ChangeLog Mon Jan 07 10:57:47 2013 +0100
@@ -1,3 +1,9 @@
+2013-01-07 Pavel Tisnovsky
+
+ * src/org/RhinoTests/AbstractScriptEngineClassTest.java:
+ Added new test for a method GetCanonicalName().
+ Updated tests GetFields(), GetDeclaredFields() and GetField().
+
2012-12-21 Pavel Tisnovsky
* src/org/RhinoTests/ScriptEngineManagerClassTest.java:
diff -r f2a6c496bf93 -r 87019bd63c13 src/org/RhinoTests/AbstractScriptEngineClassTest.java
--- a/src/org/RhinoTests/AbstractScriptEngineClassTest.java Fri Dec 21 11:21:05 2012 +0100
+++ b/src/org/RhinoTests/AbstractScriptEngineClassTest.java Mon Jan 07 10:57:47 2013 +0100
@@ -1,7 +1,7 @@
/*
Rhino test framework
- Copyright (C) 2011, 2012 Red Hat
+ Copyright (C) 2011, 2012, 2013 Red Hat
This file is part of IcedTea.
@@ -45,6 +45,7 @@
import java.util.List;
import java.util.Map;
import java.util.HashMap;
+import java.util.TreeMap;
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
@@ -261,6 +262,15 @@
}
/**
+ * Test for method javax.script.AbstractScriptEngine.getClass().getCanonicalName()
+ */
+ protected void testGetCanonicalName() {
+ String canonicalName = this.abstractScriptEngineClass.getCanonicalName();
+ assertEquals(canonicalName, "javax.script.AbstractScriptEngine",
+ "Method javax.script.AbstractScriptEngine.getClass().getCanonicalName() returns wrong value " + canonicalName);
+ }
+
+ /**
* Test for method javax.script.AbstractScriptEngine.getClass().getSuperclass()
*/
protected void testGetSuperclass() {
@@ -341,7 +351,7 @@
*/
protected void testGetFields() {
// following fields should exists
- final String[] fieldsThatShouldExists = {
+ final String[] fieldsThatShouldExist_jdk6 = {
"public static final java.lang.String javax.script.ScriptEngine.ARGV",
"public static final java.lang.String javax.script.ScriptEngine.FILENAME",
"public static final java.lang.String javax.script.ScriptEngine.ENGINE",
@@ -350,6 +360,19 @@
"public static final java.lang.String javax.script.ScriptEngine.LANGUAGE",
"public static final java.lang.String javax.script.ScriptEngine.LANGUAGE_VERSION",
};
+ final String[] fieldsThatShouldExist_jdk7 = {
+ "public static final java.lang.String javax.script.ScriptEngine.ARGV",
+ "public static final java.lang.String javax.script.ScriptEngine.FILENAME",
+ "public static final java.lang.String javax.script.ScriptEngine.ENGINE",
+ "public static final java.lang.String javax.script.ScriptEngine.ENGINE_VERSION",
+ "public static final java.lang.String javax.script.ScriptEngine.NAME",
+ "public static final java.lang.String javax.script.ScriptEngine.LANGUAGE",
+ "public static final java.lang.String javax.script.ScriptEngine.LANGUAGE_VERSION",
+ };
+
+ // get the right array of field signatures
+ final String[] fieldsThatShouldExist = getJavaVersion() < 7 ? fieldsThatShouldExist_jdk6 : fieldsThatShouldExist_jdk7;
+
// get all fields
Field[] fields = this.abstractScriptEngineClass.getFields();
// and transform the array into a list of field names
@@ -358,7 +381,7 @@
fieldsAsString.add(field.toString());
}
// check if all required fields really exists
- for (String fieldThatShouldExists : fieldsThatShouldExists) {
+ for (String fieldThatShouldExists : fieldsThatShouldExist) {
assertTrue(fieldsAsString.contains(fieldThatShouldExists),
"field " + fieldThatShouldExists + " not found");
}
@@ -368,10 +391,18 @@
* Test for method javax.script.AbstractScriptEngine.getClass().getDeclaredFields()
*/
protected void testGetDeclaredFields() {
- // following fields should be declared
- final String[] fieldsThatShouldExists = {
+ // following declared fields should exists
+ final String[] declaredFieldsThatShouldExist_jdk6 = {
"protected javax.script.ScriptContext javax.script.AbstractScriptEngine.context",
};
+ final String[] declaredFieldsThatShouldExist_jdk7 = {
+ "protected javax.script.ScriptContext javax.script.AbstractScriptEngine.context",
+ };
+
+ // get the right array of field signatures
+ // following fields should be declared
+ final String[] declaredFieldsThatShouldExist = getJavaVersion() < 7 ? declaredFieldsThatShouldExist_jdk6 : declaredFieldsThatShouldExist_jdk7;
+
// get all declared fields
Field[] declaredFields = this.abstractScriptEngineClass.getDeclaredFields();
// and transform the array into a list of field names
@@ -380,9 +411,9 @@
declaredFieldsAsString.add(field.toString());
}
// check if all required fields really exists
- for (String fieldThatShouldExists : fieldsThatShouldExists) {
- assertTrue(declaredFieldsAsString.contains(fieldThatShouldExists),
- "field " + fieldThatShouldExists + " not found");
+ for (String declaredFieldThatShouldExists : declaredFieldsThatShouldExist) {
+ assertTrue(declaredFieldsAsString.contains(declaredFieldThatShouldExists),
+ "field " + declaredFieldThatShouldExists + " not found");
}
}
@@ -391,7 +422,7 @@
*/
protected void testGetField() {
// following fields should exists
- final String[] fieldsThatShouldExists = {
+ final String[] fieldsThatShouldExist_jdk6 = {
"ARGV",
"FILENAME",
"ENGINE",
@@ -400,8 +431,20 @@
"LANGUAGE",
"LANGUAGE_VERSION",
};
+ final String[] fieldsThatShouldExist_jdk7 = {
+ "ARGV",
+ "FILENAME",
+ "ENGINE",
+ "ENGINE_VERSION",
+ "NAME",
+ "LANGUAGE",
+ "LANGUAGE_VERSION",
+ };
+
+ final String[] fieldsThatShouldExist = getJavaVersion() < 7 ? fieldsThatShouldExist_jdk6 : fieldsThatShouldExist_jdk7;
+
// check if all required fields really exists
- for (String fieldThatShouldExists : fieldsThatShouldExists) {
+ for (String fieldThatShouldExists : fieldsThatShouldExist) {
try {
Field field = this.abstractScriptEngineClass.getField(fieldThatShouldExists);
String fieldName = field.getName();
From ptisnovs at icedtea.classpath.org Mon Jan 7 02:42:46 2013
From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org)
Date: Mon, 07 Jan 2013 10:42:46 +0000
Subject: /hg/gfx-test: Added two helper methods used to create test images.
Message-ID:
changeset f58d79d0af5e in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=f58d79d0af5e
author: Pavel Tisnovsky
date: Mon Jan 07 11:45:55 2013 +0100
Added two helper methods used to create test images.
Fixed names of two tests and removed one redundant test.
Added (c) year.
diffstat:
ChangeLog | 8 ++
src/org/gfxtest/framework/ImageFactory.java | 82 ++++++++++++++++++++++++
src/org/gfxtest/testsuites/BitBltBasicTests.java | 20 +-----
3 files changed, 92 insertions(+), 18 deletions(-)
diffs (149 lines):
diff -r c71e4eb14bec -r f58d79d0af5e ChangeLog
--- a/ChangeLog Fri Dec 21 10:35:45 2012 +0100
+++ b/ChangeLog Mon Jan 07 11:45:55 2013 +0100
@@ -1,3 +1,11 @@
+2013-01-07 Pavel Tisnovsky
+
+ * src/org/gfxtest/framework/ImageFactory.java:
+ Added two helper methods used to create test images.
+ * src/org/gfxtest/testsuites/BitBltBasicTests.java:
+ Fixed names of two tests and removed one redundant test.
+ Added (c) year.
+
2012-12-21 Pavel Tisnovsky
* src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java:
diff -r c71e4eb14bec -r f58d79d0af5e src/org/gfxtest/framework/ImageFactory.java
--- a/src/org/gfxtest/framework/ImageFactory.java Fri Dec 21 10:35:45 2012 +0100
+++ b/src/org/gfxtest/framework/ImageFactory.java Mon Jan 07 11:45:55 2013 +0100
@@ -651,4 +651,86 @@
// return buffered image containing computed color pattern
return image;
}
+
+ /**
+ * Create image containing grayscale 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 createHorizontalGrayscaleGradientImage(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) | rgb;
+ // 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 grayscale 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 createVerticalGrayscaleGradientImage(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) | rgb;
+ image.setRGB(x, y, color);
+ }
+ }
+
+ // return buffered image containing computed color pattern
+ return image;
+ }
}
diff -r c71e4eb14bec -r f58d79d0af5e src/org/gfxtest/testsuites/BitBltBasicTests.java
--- a/src/org/gfxtest/testsuites/BitBltBasicTests.java Fri Dec 21 10:35:45 2012 +0100
+++ b/src/org/gfxtest/testsuites/BitBltBasicTests.java Mon Jan 07 11:45:55 2013 +0100
@@ -2075,7 +2075,7 @@
* graphics canvas
* @return test result status - PASSED, FAILED or ERROR
*/
- public TestResult testBitBltBWDotsImageTypeByteBinary(TestImage image, Graphics2D graphics2d)
+ public TestResult testBitBltBWDotsBufferedImageTypeByteBinary(TestImage image, Graphics2D graphics2d)
{
// create new buffered image and then perform basic BitBlt test.
return CommonBitmapOperations.doBitBltTestWithBWDotsImage(image, graphics2d, BufferedImage.TYPE_BYTE_BINARY);
@@ -2256,7 +2256,7 @@
* graphics canvas
* @return test result status - PASSED, FAILED or ERROR
*/
- public TestResult testBitBltColorDotsImageTypeByteBinary(TestImage image, Graphics2D graphics2d)
+ public TestResult testBitBltColorDotsBufferedImageTypeByteBinary(TestImage image, Graphics2D graphics2d)
{
// create new buffered image and then perform basic BitBlt test.
return CommonBitmapOperations.doBitBltTestWithColorDotsImage(image, graphics2d, BufferedImage.TYPE_BYTE_BINARY);
@@ -2428,22 +2428,6 @@
}
/**
- * Test basic BitBlt operation for color dots pattern buffered image
- * with type TYPE_BYTE_BINARY.
- *
- * @param image
- * image used as a destination for BitBlt-type operations
- * @param graphics2d
- * graphics canvas
- * @return test result status - PASSED, FAILED or ERROR
- */
- public TestResult testBitBltColorDotsImageTypeByteIntARGB(TestImage image, Graphics2D graphics2d)
- {
- // create new buffered image and then perform basic BitBlt test.
- return CommonBitmapOperations.doBitBltTestWithColorDotsImage(image, graphics2d, BufferedImage.TYPE_INT_ARGB);
- }
-
- /**
* Entry point to the test suite.
*
* @param args not used in this case
From jvanek at redhat.com Mon Jan 7 06:41:35 2013
From: jvanek at redhat.com (Jiri Vanek)
Date: Mon, 07 Jan 2013 15:41:35 +0100
Subject: [rfc][icedtea-web] make download indicator more compact
In-Reply-To: <50E704C5.4060300@redhat.com>
References: <50E5ACDF.7080609@redhat.com> <50E704C5.4060300@redhat.com>
Message-ID: <50EADE9F.3000101@redhat.com>
On 01/04/2013 05:35 PM, Adam Domurad wrote:
> On 01/03/2013 11:07 AM, Jiri Vanek wrote:
>> Hi!
>>
>> This patch is adding "show details" to download indicator. For One jar jnlp files it behaviour is
>> unaffected. For Multiple jars there is just one progress bar, but can be shown "old stile"
>> detailed one via clicking to "Show details". Then can be minimalised by "hide details". Button is
>> localised.
>>
>> The button is nasty not nice.. Any better idea? but still this is better then previous approach.
>>
>> Looking forward to have this inside!
>>
>> Best rigards
>> J.
>
> Thanks for looking into this! I was actually comparing our download indicator to proprietary just
> yesterday, while staring at multiple jars downloading. The average user does not want to know about
> the jars being downloaded, in fact I think such information can look scary :-).
>
>> diff -r 9549226afa8f netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java
>> --- a/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java Thu Jan 03 09:54:16 2013 +0100
>> +++ b/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java Thu Jan 03 17:07:28 2013 +0100
>> @@ -62,6 +62,7 @@
>>
>> /** shared constraint */
>> static GridBagConstraints vertical;
>> + static GridBagConstraints verticalNoClean;
>> static GridBagConstraints verticalIndent;
>> static {
>> vertical = new GridBagConstraints();
>> @@ -70,8 +71,12 @@
>> vertical.fill = GridBagConstraints.HORIZONTAL;
>> vertical.anchor = GridBagConstraints.WEST;
>>
>> + verticalNoClean = new GridBagConstraints();
>> + verticalNoClean.weightx = 1.0;
>> +
>> verticalIndent = (GridBagConstraints) vertical.clone();
>> verticalIndent.insets = new Insets(0, 10, 3, 0);
>> +
>
> Nit: These two blank lines (and all the ones added below) have tabs :-)
>
>> }
>>
>> /**
>> @@ -114,15 +119,15 @@
>>
>> frame.getContentPane().add(result, vertical);
>> frame.pack();
>> -
>> if (!frame.isVisible()) {
>> - Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
>> - Insets insets =
>> Toolkit.getDefaultToolkit().getScreenInsets(frame.getGraphicsConfiguration());
>> - Dimension screen = new Dimension(screenSize.width - insets.left,
>> - screenSize.height - insets.top);
>> - frame.setLocation(screen.width - frame.getWidth(),
>> - screen.height - frame.getHeight());
>> + placeFrameToLowerRight();
>> }
>> + result.addComponentListener(new ComponentAdapter() {
>> + @Override
>> + public void componentResized(ComponentEvent e) {
>> + placeFrameToLowerRight();
>> + }
>> + });
>>
>> frame.setVisible(true);
>>
>> @@ -131,6 +136,32 @@
>> }
>>
>> /**
>> + * The insets are calculated differently during first appearance
>> + * and during another appearance in case of some configurations.
>> + *
>> + * So the first value is stored to avoid jumping of window during later packing
>> + * of frame.
>> + *
>> + * However the second calculation is more correct:(
>> + *
>> + * This is affecting only multiple monitors which have different assets.
>> + * The underlying issue is that Toolkit.getDefaultToolkit().getScreenInsets
>> + * is returning assets for "random" monitor.
>> + */
>> + Dimension screen = null;
>> +
>> + private void placeFrameToLowerRight() throws HeadlessException {
>> + if (screen == null) {
>> + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
>> + Insets insets =
>> Toolkit.getDefaultToolkit().getScreenInsets(frame.getGraphicsConfiguration());
>> + screen = new Dimension(screenSize.width - insets.left,
>> + screenSize.height - insets.top);
>> + }
>> + frame.setLocation(screen.width - frame.getWidth(),
>> + screen.height - frame.getHeight());
>> + }
>> +
>> + /**
>> * Remove a download service listener that was obtained by
>> * calling the getDownloadListener method from the shared
>> * download info window.
>> @@ -163,12 +194,26 @@
>> * Groups the url progress in a panel.
>> */
>> static class DownloadPanel extends JPanel implements DownloadServiceListener {
>> -
>> + private static enum States{
>> + oneJAr, collapsed, detailed;
>
> Enums should be all-caps
>
>> +
>> + }
>> +
>> + private static final String DETAILS=R("ButShowDetails");
>> + private static final String HIDE_DETAILS=R("ButHideDetails");
>> /** the download name */
>> private String downloadName;
>>
>> /** Downloading part: */
>> private JLabel header = new JLabel();
>> + /** Show/hide details button: */
>> + private JButton details = new JButton(DETAILS);
>> + /** used instead of details button in case of one jar*/
>> + private JLabel delimiter = new JLabel("");
>> + /** all already created progress bars*/
>> + private List progressPanels = new ArrayList();
>> + private States state=States.oneJAr;
>> + private ProgressPanel mainProgressPanel;
>>
>> /** list of URLs being downloaded */
>> private List urls = new ArrayList();
>> @@ -176,6 +221,7 @@
>> /** list of ProgressPanels */
>> private List panels = new ArrayList();
>>
>> +
>
> Nit: two blank lines are unnecessary.
>
>> /**
>> * Create a new download panel for with the specified download
>> * name.
>> @@ -184,9 +230,35 @@
>> setLayout(new GridBagLayout());
>>
>> this.downloadName = downloadName;
>> - this.add(header, vertical);
>> + this.add(header, verticalNoClean);
>> header.setFont(header.getFont().deriveFont(Font.BOLD));
>> -
>> + this.add(delimiter, vertical);
>> + details.addActionListener(new ActionListener() {
>> + @Override
>> + public void actionPerformed(ActionEvent e) {
>> + if (state == States.detailed) {
>> + state = States.collapsed;
>> + details.setText(DETAILS);
>> + for (ProgressPanel progressPanel : progressPanels) {
>> + remove(progressPanel);
>> + }
>> + add(mainProgressPanel, verticalIndent);
>> + synchronized (frameMutex) {
>> + frame.pack();
>> + }
>> + } else {
>> + state = States.detailed;
>> + details.setText(HIDE_DETAILS);
>> + remove(mainProgressPanel);
>> + for (ProgressPanel progressPanel : progressPanels) {
>> + add(progressPanel, verticalIndent);
>> + }
>> + synchronized (frameMutex) {
>> + frame.pack();
>> + }
>> + }
>> + }
>> + });
>> setOverallPercent(0);
>> }
>>
>> @@ -196,14 +268,25 @@
>> protected void addProgressPanel(URL url, String version) {
>> if (!urls.contains(url)) {
>> ProgressPanel panel = new ProgressPanel(url, version);
>> -
>> - add(panel, verticalIndent);
>> + if (state != States.collapsed) {
>> + add(panel, verticalIndent);
>> + }
>> + progressPanels.add(panel);
>> + urls.add(url);
>> + panels.add(panel);
>> + if (panels.size() == 2){
>
> Small comment here would be good explaining why this 'magic number'
>
>> + remove(panels.get(0));
>> + remove(panels.get(1));
>> + remove(delimiter);
>> + add(details,vertical);
>> + mainProgressPanel=new ProgressPanel();
>> + add(mainProgressPanel, verticalIndent);
>> + state=States.collapsed;
>> + }
>> synchronized (frameMutex) {
>> frame.pack();
>> }
>>
>> - urls.add(url);
>> - panels.add(panel);
>> }
>> }
>>
>> @@ -219,10 +302,10 @@
>> addProgressPanel(url, version);
>>
>> setOverallPercent(overallPercent);
>> -
>> ProgressPanel panel = panels.get(urls.indexOf(url));
>> panel.setProgress(readSoFar, total);
>> panel.repaint();
>> +
>> }
>> };
>> SwingUtilities.invokeLater(r);
>> @@ -230,12 +313,28 @@
>>
>> /**
>> * Sets the overall percent completed.
>> + * should be called via invokeLater
>> */
>> public void setOverallPercent(int percent) {
>> // don't get whole string from resource and sub in
>> // values because it'll be doing a MessageFormat for
>> // each update.
>> header.setText(downloading + " " + downloadName + ": " + percent + "% " + complete +
>> ".");
>> + Container c = header.getParent();
>> + //we need to adapt nbboth panels and also frame to new length of header text
>
> nbboth > both
>
>> + while (c != null) {
>> + c.invalidate();
>> + c.validate();
>> + if (c instanceof Window){
>> + ((Window) c).pack();
>> + }
>> + c=c.getParent();
>> + }
>> +
>> + if (mainProgressPanel != null) {
>> + mainProgressPanel.setProgress(percent, 100);
>> + mainProgressPanel.repaint();
>> + }
>> }
>>
>> /**
>> @@ -276,12 +375,28 @@
>>
>> private long total;
>> private long readSoFar;
>> + private Dimension size = new Dimension(80, 15);
>>
>> + ProgressPanel() {
>> + bar.setMinimumSize(size);
>> + bar.setPreferredSize(size);
>> + bar.setOpaque(false);
>> +
>> + setLayout(new GridBagLayout());
>> +
>> + GridBagConstraints gbc = new GridBagConstraints();
>> + styleGridBagConstraints(gbc);
>> + add(bar, gbc);
>> + }
>> +
>> ProgressPanel(URL url, String version) {
>> - JLabel location = new JLabel(" " + url.getHost() + "/" + url.getFile());
>> + this(" " + url.getHost() + "/" + url.getFile(),version);
>> + }
>> + ProgressPanel(String caption, String version) {
>> + JLabel location = new JLabel(caption);
>>
>> - bar.setMinimumSize(new Dimension(80, 15));
>> - bar.setPreferredSize(new Dimension(80, 15));
>> + bar.setMinimumSize(size);
>> + bar.setPreferredSize(size);
>> bar.setOpaque(false);
>>
>> setLayout(new GridBagLayout());
>> @@ -291,12 +406,8 @@
>> gbc.fill = GridBagConstraints.NONE;
>> gbc.gridwidth = GridBagConstraints.RELATIVE;
>> add(bar, gbc);
>> -
>> - gbc.insets = new Insets(0, 3, 0, 0);
>> - gbc.weightx = 1.0;
>> - gbc.fill = GridBagConstraints.HORIZONTAL;
>> - gbc.gridwidth = GridBagConstraints.REMAINDER;
>> - gbc.anchor = GridBagConstraints.WEST;
>> +
>> + styleGridBagConstraints(gbc);
>> add(location, gbc);
>> }
>>
>> @@ -325,6 +436,14 @@
>> g.fillRect(x + 1, y + 1, divide - 1, h - 1);
>> }
>> }
>> +
>> + private void styleGridBagConstraints(GridBagConstraints gbc) {
>> + gbc.insets = new Insets(0, 3, 0, 0);
>> + gbc.weightx = 1.0;
>> + gbc.fill = GridBagConstraints.HORIZONTAL;
>> + gbc.gridwidth = GridBagConstraints.REMAINDER;
>> + gbc.anchor = GridBagConstraints.WEST;
>> + }
>> };
>>
>> }
>
> Code looks OK nits aside.
Thanx for nits. Should be fixed now
>
> As for button ... yes it is nasty. IMO maybe we can take different approach here. The people
> interested in how the individual jars are downloading would mainly be 1. us trying to fix jar
> loading issues, 2. developers looking into jar loading issues.
>
> So what if the ICEDTEAPLUGIN_DEBUG environment variable turned this on/off ? It can be argued it is
> a bit hard for developers to access, but it isn't any easier to access this information from oracle
> plugin.
I think I don't like this idea :(
I have added an attempt to use an icon, And I must say it is much better. Btw, I have created this
icon.. so no wonders here :) But looks quite cool :)
>
> As well, I would be very happy to see the loading bar integrated with the splash screen (if splash
> screen is on). I believe this would nicely complement the user friendliness of the splash screen.
You mean to sync progress on progress bar with the one in splash? Or also showing the downlaoded
resources somehow and show details button in splash?
Sounds reasonable, but definitely as different changeset.
Thanx for review an ideas,
J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixedDownloadIndicatorDialog2.patch
Type: text/x-patch
Size: 11443 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130107/f4d4c30c/fixedDownloadIndicatorDialog2.patch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: magnifyGlass-small.png
Type: image/png
Size: 1008 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130107/f4d4c30c/magnifyGlass-small.png
From jvanek at redhat.com Mon Jan 7 06:53:01 2013
From: jvanek at redhat.com (Jiri Vanek)
Date: Mon, 07 Jan 2013 15:53:01 +0100
Subject: [rfc][icedtea-web] Fix for PR1198, JSObject passed incorrectly
to Javascript
In-Reply-To: <50E70F2D.2070805@redhat.com>
References: <50B92039.4070304@redhat.com> <50BCF77F.2020808@redhat.com>
<50E6A438.1010605@redhat.com> <50E70F2D.2070805@redhat.com>
Message-ID: <50EAE14D.5050505@redhat.com>
On 01/04/2013 06:19 PM, Adam Domurad wrote:
> On 01/04/2013 04:43 AM, Jiri Vanek wrote:
>> On 12/03/2012 08:03 PM, Adam Domurad wrote:
>>> On 11/30/2012 04:08 PM, Adam Domurad wrote:
>>>> Hi all. Attached is a fix for PR1198.
>>>>
>>>> I still plan to write unit tests for at least the new method
>>>> PluginAppletViewer.toObjectIDString, but I wanted to get this out before leaving for the weekend.
>>>>
>>>> One tricky thing with this patch was that it had to consolidate _a lot_ of duplicated
>>>> functionality (actually I found some subtle differences in handling, this should be more
>>>> consistent). Once that was done the actual patch was fairly straight forward.
>>>>
>>>> The basic issue was that JSObject was being passed as if it were a normal Java object, when the
>>>> liveconnect spec specifies that it should be returned as the underlying javascript object.
>>>>
>>>> A method was added to JSObject to get the underlying reference. This was kept package-private to
>>>> not pollute its public interface. As well, a new permission was added for accessing this method.
>>>> To access this outside of the package, a utility was created in JSUtil.
>>>>
>>>> This patch adds a special case to Java->JS communication when sending objects, to indicate that
>>>> a Javascript object is being passed.
>>>>
>>>> With patch applied, JSObjectFromEval should pass in all browsers.
>>>>
>>>> 2012-11-30 Adam Domurad
>>>>
>>>> Fix PR1198: JSObject passed incorrectly to Javascript
>>>> * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc: Pass extra data for
>>>> 'jsobject' object result messages.
>>>> * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: Same.
>>>> * plugin/icedteanp/IcedTeaPluginUtils.cc: Add special casing of
>>>> javascript references passed from java.
>>>> * plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java:
>>>> New permission for unboxing a JSObject's internal reference.
>>>> * plugin/icedteanp/java/netscape/javascript/JSObject.java
>>>> (getInternalReference): New, package-private, retrieves internal
>>>> reference (Must have proper permission).
>>>> * plugin/icedteanp/java/netscape/javascript/JSUtil.java
>>>> (getJSObjectInternalReference) New, utility for accessing
>>>> JSObject#getInternalReference from outside the package.
>>>> * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java:
>>>> (toObjectIDString): New, creates a string that precisely identifies a
>>>> Java object.
>>>> (handleMessage): Replace a lot of duplicated functionality with
>>>> 'toObjectIDString'.
>>>> * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: Replace
>>>> duplicated functionality with 'toObjectIDString'.
>>>> * tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java:
>>>> Don't print out type passed (differs from browser to browser).
>>>> * tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java:
>>>> Don't check type passed (differs from browser to browser). Remove
>>>> known-to-fail. Reformat.
>>>
>>> As promised attached is the unit-test for the newly introduced Java->JS function (which
>>> encapsulates logic that was duplicated in many areas)
>>>
>>> Note that this patch contains a Makefile patch for unit testing sun.applet package, however this
>>> will be committed with another now-approved patch so I have left it out of the ChangeLog.
>>>
>>> ChangeLog:
>>> 2012-12-XX Adam Domurad
>>>
>>> Unit test for PluginAppletSecurityContext#toObjectIDString. Make
>>> PluginAppletSecurityContext more unit-testable.
>>> * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java:
>>> Don't initialize security manager in constructor. Fix a few Java->JS
>>> corner cases.
>>> * plugin/icedteanp/java/sun/applet/PluginMain.java: Initialize
>>> SecurityManager before creating PluginAppletSecurityContext.
>>> * tests/netx/unit/sun/applet/PluginAppletSecurityContextTest.java:
>>> Unit test for all the corner cases of converting a Java object to a
>>> string that can be precisely identified.
>>>
>>> Happy hacking,
>>> -Adam
>>>
>>>
>>
>> Tests first. A lot of questions....
>>
>>> jsfix-unittest.patch
>>>
>>>
>>> diff --git a/Makefile.am b/Makefile.am
>>> --- a/Makefile.am
...
>>> -
>>> - JNLPRuntime.disableExit();
>>> -
>>
>> Can't the moving of this initiliazaton cause some hole?
>
> This code is invoked exactly once, and I figured this type of thing shouldn't be in a constructor.
> It was causing problems for my unit tests because of the security manager it installed. A different
> solution is welcome.
> The problem is I need access to PluginAppletSecurityContext #toObjectIDString. It requires a
> security context instance. IMO this is an indicator that this class 'does too much' (a class called
> SecurityContext handling all the liveconnect logic??).
> If you feel I should do it, I can move liveconnect logic into a different class and then testing
> will be fine.
I understood why you did it, I wanted to ensure you know what you are doing :)
I completely agree that with this class doing to much. Some refactoring is possible as another
changeset. But I'm for it (although not understanding all possible security impacts).
>> What corner cases it fixed? Can't they be fixed by better way?
>> Anyway - it should be in different changeset.
>>
>>> URL u = null;
>>> try {
>>> u = new URL("file://");
>>> @@ -348,16 +337,16 @@ public class PluginAppletSecurityContext
>>> */
>>> public String toObjectIDString(Object obj, Class> type, boolean unboxPrimitives) {
>>>
>>> + /* Void (can occur from declared return type), pass special "void" string: */
>>> + if (type == Void.TYPE) {
>>> + return "literalreturn void";
>>> + }
>>> +
>>> /* Null, pass special "null" string: */
>>> if (obj == null) {
>>> return "literalreturn null";
>>> }
>>>
>>> - /* Void (can occur from declared return type), pass special "void" string: */
>>> - if (type == Void.TYPE) {
>>> - return "literalreturn void";
>>> - }
>>> -
>>> /* Primitive, accurately represented by its toString() form: */
>>> boolean returnAsString = ( type == Boolean.TYPE
>>> || type == Byte.TYPE
>>> @@ -378,7 +367,7 @@ public class PluginAppletSecurityContext
>>>
>>> /* Floating point number, we ensure we give enough precision: */
>>> if ( type == Float.TYPE || type == Double.TYPE ||
>>> - ( unboxPrimitives&& (type == Double.class || type == Double.class) )) {
>>> + ( unboxPrimitives&& (type == Float.class || type == Double.class) )) {
>>
>> Why this? Also Shouldn't it be in different changeset?
>
> I will move this into the fix itself, they were bugs discovered during unit testing :-)
>
> [.. rest snipped..]
Isn't missing updated junit patch here?
Thanx for looking into it.
J.
From jvanek at redhat.com Mon Jan 7 07:07:53 2013
From: jvanek at redhat.com (Jiri Vanek)
Date: Mon, 07 Jan 2013 16:07:53 +0100
Subject: [rfc][icedtea-web] Fix for PR1198, JSObject passed incorrectly
to Javascript
In-Reply-To: <50E72F25.1030903@redhat.com>
References: <50B92039.4070304@redhat.com> <50E6AD9E.9040100@redhat.com>
<50E72F25.1030903@redhat.com>
Message-ID: <50EAE4C9.1010107@redhat.com>
On 01/04/2013 08:36 PM, Adam Domurad wrote:
> On 01/04/2013 05:23 AM, Jiri Vanek wrote:
>> [.. snipped..]
>
> As you suggested, I have separated the cosmetic changes and pushed them. It did prove quite tricky,
> though.
ty :)
>
>>>
>>> diff --git a/NEWS b/NEWS
>>> --- a/NEWS
>>> +++ b/NEWS
>>> @@ -19,6 +19,7 @@ New in release 1.4 (2012-XX-XX):
>>> * Plugin
>>> - PR1106: Buffer overflow in plugin table-
>>> - PR1166: Embedded JNLP File is not supported in applet tag
>>> + - PR1198: JSObject is not passed to javascript correctly
>>> * Common
>>> - PR1049: Extension jnlp's signed jar with the content of only META-INF/* is considered
>>> - PR955: regression: SweetHome3D fails to run
>>> diff --git a/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc
>>> b/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc
>>> --- a/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc
>>> +++ b/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc
>>> @@ -131,7 +131,7 @@ JavaRequestProcessor::newMessageOnBus(co
>>> !message_parts->at(4)->find("GetObjectArrayElement"))
>>> {
>>>
>>> - if (!message_parts->at(5)->find("literalreturn"))
>>> + if (!message_parts->at(5)->find("literalreturn") ||
>>> !message_parts->at(5)->find("jsobject"))
>>> {
>>> // literal returns don't have a corresponding jni id
>>> result->return_identifier = 0;
>>> diff --git a/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
>>> b/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
>>> --- a/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
>>> +++ b/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
>>> @@ -413,7 +413,7 @@ PluginRequestProcessor::setMember(std::v
>>> member = (NPVariant*) (IcedTeaPluginUtilities::stringToJSID(*(message_parts->at(5))));
>>> propertyNameID = *(message_parts->at(6));
>>>
>>> - if (*(message_parts->at(7)) == "literalreturn")
>>> + if (*(message_parts->at(7)) == "literalreturn" || *(message_parts->at(7)) == "jsobject" )
>>> {
>>> value.append(*(message_parts->at(7)));
>>> value.append(" ");
>>> diff --git a/plugin/icedteanp/IcedTeaPluginUtils.cc b/plugin/icedteanp/IcedTeaPluginUtils.cc
>>> --- a/plugin/icedteanp/IcedTeaPluginUtils.cc
>>> +++ b/plugin/icedteanp/IcedTeaPluginUtils.cc
>>> @@ -776,6 +776,14 @@ javaStringResultToNPVariant(const std::s
>>> }
>>>
>>> static bool
>>> +javaJSObjectResultToNPVariant(const std::string& js_id, NPVariant* variant)
>>> +{
>>> + NPVariant* result_variant = (NPVariant*) IcedTeaPluginUtilities::stringToJSID(js_id);
>>> + *variant = *result_variant;
>>> + return true;
>>> +}
>>
>> It returns always true?? Maybe void or *variant?
>
> I left this accidentally after it could no longer fail, made it void.
yap
>
>>
>>> +
>>> +static bool
>>> javaObjectResultToNPVariant(NPP instance, const std::string& jobject_id, NPVariant* variant)
>>> {
>>> // Reference the class object so we can construct an NPObject with it and the instance
>>> @@ -811,9 +819,14 @@ IcedTeaPluginUtilities::javaResultToNPVa
>>> std::string* java_value, NPVariant* variant)
>>> {
>>> int literal_n = sizeof("literalreturn"); // Accounts for one space char
>>> + int jsobject_n = sizeof("jsobject"); // Accounts for one space char
>>> +
>>> if (strncmp("literalreturn ", java_value->c_str(), literal_n) == 0)
>>> {
>>> javaPrimitiveResultToNPVariant(java_value->substr(literal_n), variant);
>>> + } else if (strncmp("jsobject ", java_value->c_str(), jsobject_n) == 0)
>>> + {
>>> + javaJSObjectResultToNPVariant(java_value->substr(jsobject_n), variant);
>>> } else
>>> {
>>> std::string jobject_id = *java_value;
>>>
> [... long snip...]
>>> public void setJSMember(JSObject js, String memb, Object val) {
>>> - String typeName = val.getClass().getName();
>>> - System.out.println("setJSMember: passed '" + typeName + "'");
>> Not worthy to keep in debug?
>> Anyway - cosmetic change. See my comment lower.
>
> No, this was part of the expected reproducer output. It was removed from the checks because the type
> is dependent on the browser. It was causing failures on some browsers. I have pushed it with my
> cosmetic changes anyway.
oook.
>
>>> js.setMember(memb, val);
>>> }
>>> }
>>> \ No newline at end of file
>>> diff --git a/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java
>>> b/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java
>>> --- a/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java
>>> +++ b/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java
>>> @@ -40,7 +40,6 @@ import static org.junit.Assert.assertTru
>>> import net.sourceforge.jnlp.ProcessResult;
>>> import net.sourceforge.jnlp.ServerAccess.AutoClose;
>>> 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 net.sourceforge.jnlp.browsertesting.BrowserTest;
>>> @@ -51,40 +50,37 @@ import org.junit.Test;
>>>
>>> public class JSObjectFromEvalTest extends BrowserTest {
>>>
>>> - private static final String END_STRING = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING;
>>> + private static final String END_STRING = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING;
>>>
>>> - private static final String JAVA_CREATE = "Java create\n";
>>> - private static final String JS_CREATE = "JS create\n";
>>> - private static final String JAVA_SET = "Java set\n";
>>> - private static final String PASSED_INTEGER = "setJSMember: passed 'java.lang.Integer'\n";
>>> - private static final String CORRECT_VALUE = "obj.test = 0";
>>> + private static final String JAVA_CREATE = "Java create\n";
>>> + private static final String JS_CREATE = "JS create\n";
>>> + private static final String JAVA_SET = "Java set\n";
>>> + private static final String CORRECT_VALUE = "obj.test = 0";
>>>
>>> - @Test
>>> - @TestInBrowsers(testIn = { Browsers.all })
>>> - @NeedsDisplay
>>> - @Bug(id = { "PR1198" })
>>> - @KnownToFail
>>> - public void testJSObjectSetMemberIsSet() throws Exception {
>>> - ProcessResult pr = server.executeBrowser("/JSObjectFromEval.html",
>>> - AutoClose.CLOSE_ON_BOTH);
>>> + @Test
>>> + @TestInBrowsers(testIn = { Browsers.all })
>>> + @NeedsDisplay
>>> + @Bug(id = { "PR1198" })
>>> + public void testJSObjectSetMemberIsSet() throws Exception {
>>> + ProcessResult pr = server.executeBrowser("/JSObjectFromEval.html",
>>> + AutoClose.CLOSE_ON_BOTH);
>>>
>>> - String expectedJSCreateOutput = JS_CREATE + JAVA_SET + PASSED_INTEGER
>>> - + CORRECT_VALUE;
>>> - String expectedJavaCreateOutput = JAVA_CREATE + JAVA_SET
>>> - + PASSED_INTEGER + CORRECT_VALUE;
>>> + String expectedJSCreateOutput = JS_CREATE + JAVA_SET + CORRECT_VALUE;
>>> + String expectedJavaCreateOutput = JAVA_CREATE + JAVA_SET
>>> + + CORRECT_VALUE;
>>>
>>> - // No reason JS create should fail, this is mostly a sanity check:
>>> - assertTrue("stdout should contain 'JS create [...] " + CORRECT_VALUE
>>> - + "' but did not.", pr.stdout.contains(expectedJSCreateOutput));
>>> + // No reason JS create should fail, this is mostly a sanity check:
>>> + assertTrue("stdout should contain 'JS create [...] " + CORRECT_VALUE
>>> + + "' but did not.", pr.stdout.contains(expectedJSCreateOutput));
>>>
>>> - // Demonstrates PR1198:
>>> - assertTrue("stdout should contain 'Java create [...] " + CORRECT_VALUE
>>> - + "' but did not.",
>>> - pr.stdout.contains(expectedJavaCreateOutput));
>>> + // Demonstrates PR1198:
>>> + assertTrue("stdout should contain 'Java create [...] " + CORRECT_VALUE
>>> + + "' but did not.",
>>> + pr.stdout.contains(expectedJavaCreateOutput));
>>>
>>> - // Make sure we got to the end of the script
>>> - assertTrue("stdout should contain '" + END_STRING + "' but did not.",
>>> - pr.stdout.contains(END_STRING));
>>> - }
>>> + // Make sure we got to the end of the script
>>> + assertTrue("stdout should contain '" + END_STRING + "' but did not.",
>>> + pr.stdout.contains(END_STRING));
>>> + }
>>>
>>> }
>>
>> Cosmetic changes - normlay I'm for smughling small cosmetich changes which were found during
>> coding, especially somnething like
>> > - buf
>> > - .append(" "
>> > - + Integer
>> > - .toString(((int) b[i])& 0x0ff, 16));
>> > + buf.append(" " + Integer.toString(((int) b[i])& 0x0ff, 16));
>>
>> :))
>>
>> into patch. But there is one whole refacotred file and little bit more. If you will be willing can
>> you separate the changes? You can push the comsetic changes directly.
>>
>> Well and then you will start to hate me with removing of KnowToFail...
>> Thanx for fix.
>> J.
>>
>>
>> ps: Try to check js<->java automated tests and manual liveConnect testuite. I think there wil be
>> some hddien fixes by this aptch. Adnd With some luck also no regressions;) Maybe jana Can meassure
>> those results for you. She is th eguru of liveConnect testing afterall..
>> pps: Dont take me wrong, this is really nice cleanup and fix.
>
> Will do.
>
> Attached is an updated patch, with some cleanup removed (since it was pushed) and the fixes from my
> unit test patch added.
> See my reply to unit test review though -- I need some additional advice on what to do about the
> security manager problem.
>
> Happy hacking,
> -Adam
>
> jsfix3.patch
>
>
> diff --git a/NEWS b/NEWS
> --- a/NEWS
> +++ b/NEWS
> @@ -21,6 +21,7 @@ New in release 1.4 (2012-XX-XX):
> - PR1166: Embedded JNLP File is not supported in applet tag
> - PR1217: Add command line arguments for plugins
> - PR1189: Icedtea-plugin requires code attribute when using jnlp_href
> + - PR1198: JSObject is not passed to javascript correctly
> * Common
> - PR1049: Extension jnlp's signed jar with the content of only META-INF/* is considered
> - PR955: regression: SweetHome3D fails to run
> diff --git a/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc b/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc
> --- a/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc
> +++ b/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc
> @@ -131,7 +131,7 @@ JavaRequestProcessor::newMessageOnBus(co
> !message_parts->at(4)->find("GetObjectArrayElement"))
> {
>
> - if (!message_parts->at(5)->find("literalreturn"))
> + if (!message_parts->at(5)->find("literalreturn") || !message_parts->at(5)->find("jsobject"))
> {
> // literal returns don't have a corresponding jni id
> result->return_identifier = 0;
> diff --git a/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc b/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
> --- a/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
> +++ b/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
> @@ -413,7 +413,7 @@ PluginRequestProcessor::setMember(std::v
> member = (NPVariant*) (IcedTeaPluginUtilities::stringToJSID(*(message_parts->at(5))));
> propertyNameID = *(message_parts->at(6));
>
> - if (*(message_parts->at(7)) == "literalreturn")
> + if (*(message_parts->at(7)) == "literalreturn" || *(message_parts->at(7)) == "jsobject" )
> {
> value.append(*(message_parts->at(7)));
> value.append(" ");
> diff --git a/plugin/icedteanp/IcedTeaPluginUtils.cc b/plugin/icedteanp/IcedTeaPluginUtils.cc
> --- a/plugin/icedteanp/IcedTeaPluginUtils.cc
> +++ b/plugin/icedteanp/IcedTeaPluginUtils.cc
> @@ -776,6 +776,14 @@ javaStringResultToNPVariant(const std::s
> }
>
> static bool
> +javaJSObjectResultToNPVariant(const std::string& js_id, NPVariant* variant)
> +{
> + NPVariant* result_variant = (NPVariant*) IcedTeaPluginUtilities::stringToJSID(js_id);
> + *variant = *result_variant;
> + return true;
> +}
> +
> +static bool
> javaObjectResultToNPVariant(NPP instance, const std::string& jobject_id, NPVariant* variant)
> {
> // Reference the class object so we can construct an NPObject with it and the instance
> @@ -811,9 +819,14 @@ IcedTeaPluginUtilities::javaResultToNPVa
> std::string* java_value, NPVariant* variant)
> {
> int literal_n = sizeof("literalreturn"); // Accounts for one space char
> + int jsobject_n = sizeof("jsobject"); // Accounts for one space char
> +
> if (strncmp("literalreturn ", java_value->c_str(), literal_n) == 0)
> {
> javaPrimitiveResultToNPVariant(java_value->substr(literal_n), variant);
> + } else if (strncmp("jsobject ", java_value->c_str(), jsobject_n) == 0)
> + {
> + javaJSObjectResultToNPVariant(java_value->substr(jsobject_n), variant);
> } else
> {
> std::string jobject_id = *java_value;
> diff --git a/plugin/icedteanp/java/netscape/javascript/JSObject.java b/plugin/icedteanp/java/netscape/javascript/JSObject.java
> --- a/plugin/icedteanp/java/netscape/javascript/JSObject.java
> +++ b/plugin/icedteanp/java/netscape/javascript/JSObject.java
> @@ -100,6 +100,16 @@ public final class JSObject {
> }
>
> /**
> + * Package-private method used through JSUtil#getJSObjectInternalReference.
> + * We make this package-private to avoid polluting the public interface.
> + * @return the internal identifier
> + */
> + long getInternalReference() {
> + AccessController.getContext().checkPermission(new JSObjectUnboxPermission());
> + return internal;
> + }
> +
> + /**
> * it is illegal to construct a JSObject manually
> */
> public JSObject(int jsobj_addr) {
> diff --git a/plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java b/plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java
> new file mode 100644
> --- /dev/null
> +++ b/plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java
> @@ -0,0 +1,49 @@
> +/* JSObjectUnboxPermission.java
> + Copyright (C) 2012 Red Hat
> +
> +This file is part of IcedTea.
> +
> +IcedTea is free software; you can redistribute it and/or modify
> +it under the terms of the GNU General Public License as published by
> +the Free Software Foundation; either version 2, or (at your option)
> +any later version.
> +
> +IcedTea is distributed in the hope that it will be useful, but
> +WITHOUT ANY WARRANTY; without even the implied warranty of
> +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> +General Public License for more details.
> +
> +You should have received a copy of the GNU General Public License
> +along with IcedTea; see the file COPYING. If not, write to the
> +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> +02110-1301 USA.
> +
> +Linking this library statically or dynamically with other modules is
> +making a combined work based on this library. Thus, the terms and
> +conditions of the GNU General Public License cover the whole
> +combination.
> +
> +As a special exception, the copyright holders of this library give you
> +permission to link this library with independent modules to produce an
> +executable, regardless of the license terms of these independent
> +modules, and to copy and distribute the resulting executable under
> +terms of your choice, provided that you also meet, for each linked
> +independent module, the terms and conditions of the license of that
> +module. An independent module is a module which is not derived from
> +or based on this library. If you modify this library, you may extend
> +this exception to your version of the library, but you are not
> +obligated to do so. If you do not wish to do so, delete this
> +exception statement from your version. */
> +
> +package netscape.javascript;
> +
> +import java.security.BasicPermission;
> +
> +/**
> + * Permission to access internal reference of JSObject
> + */
> +public class JSObjectUnboxPermission extends BasicPermission {
> + public JSObjectUnboxPermission() {
> + super("JSObjectUnbox");
> + }
> +}
> diff --git a/plugin/icedteanp/java/netscape/javascript/JSUtil.java b/plugin/icedteanp/java/netscape/javascript/JSUtil.java
> --- a/plugin/icedteanp/java/netscape/javascript/JSUtil.java
> +++ b/plugin/icedteanp/java/netscape/javascript/JSUtil.java
> @@ -57,4 +57,16 @@ public class JSUtil {
>
> return captureStream.toString();
> }
> -}
> +
> + /**
> + * Uses package-private method JSObject.getInternalReference.
> + * This is package-private to avoid polluting the public interface.
> + * @param js JSObject to unbox
> + * @return the internal reference stored by the JSObject
> + */
> + public static long getJSObjectInternalReference(JSObject js) {
> + // NB: permission is checked in JSObject
> + return js.getInternalReference();
> + }
> +
> +}
> \ No newline at end of file
> diff --git a/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java b/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
> --- a/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
> +++ b/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
> @@ -321,6 +321,83 @@ public class PluginAppletSecurityContext
> return map;
> }
>
> + private static long privilegedJSObjectUnbox(final JSObject js) {
> + return AccessController.doPrivileged(new PrivilegedAction() {
> + public Long run() {
> + return JSUtil.getJSObjectInternalReference(js);
> + }
> + });
> + }
> +
> + /**
> + * Create a string that identifies a Java object precisely, for passing to
> + * Javascript.
> + *
> + * For builtin value types, a 'literalreturn' prefix is used and the object
> + * is passed with a string representation.
> + *
> + * For JSObject's, a 'jsobject' prefix is used and the object is passed
> + * with the JSObject's internal identifier.
> + *
> + * For other Java objects, an object store reference is used.
> + *
> + * @param obj the object for which to create an identifier
> + * @param type the type to use for representation decisions
> + * @param unboxPrimitives whether to treat boxed primitives as value types
> + * @return an identifier string
> + */
> + public String toObjectIDString(Object obj, Class> type, boolean unboxPrimitives) {
> +
> + /* Void (can occur from declared return type), pass special "void" string: */
> + if (type == Void.TYPE) {
> + return "literalreturn void";
> + }
> +
> + /* Null, pass special "null" string: */
> + if (obj == null) {
> + return "literalreturn null";
> + }
> +
> + /* Primitive, accurately represented by its toString() form: */
> + boolean returnAsString = ( type == Boolean.TYPE
> + || type == Byte.TYPE
> + || type == Short.TYPE
> + || type == Integer.TYPE
> + || type == Long.TYPE );
> + if (unboxPrimitives) {
> + returnAsString = ( returnAsString
> + || type == Boolean.class
> + || type == Byte.class
> + || type == Short.class
> + || type == Integer.class
> + || type == Long.class);
> + }
> + if (returnAsString) {
> + return "literalreturn " + obj.toString();
> + }
> +
> + /* Floating point number, we ensure we give enough precision: */
> + if ( type == Float.TYPE || type == Double.TYPE ||
> + ( unboxPrimitives && (type == Float.class || type == Double.class) )) {
> + return "literalreturn " + String.format("%308.308e", obj);
> + }
> +
> + /* Character that should be returned as number: */
> + if (type == Character.TYPE || (unboxPrimitives && type == Character.class)) {
> + return "literalreturn " + (int) (Character) obj;
> + }
> +
> + /* JSObject, unwrap underlying Javascript reference: */
> + if (type == netscape.javascript.JSObject.class) {
> + long reference = privilegedJSObjectUnbox((JSObject)obj);
> + return "jsobject " + Long.toString(reference);
> + }
> +
> + /* Other kind of object, track this object and return our reference: */
> + store.reference(obj);
> + return store.getIdentifier(obj).toString();
> + }
> +
> public void handleMessage(int reference, String src, AccessControlContext callContext, String message) {
>
> startTime = new java.util.Date().getTime();
> @@ -429,56 +506,16 @@ public class PluginAppletSecurityContext
> if (ret instanceof Throwable)
> throw (Throwable) ret;
>
> - if (ret == null) {
> - write(reference, "GetStaticField literalreturn null");
> - } else if (f.getType() == Boolean.TYPE
> - || f.getType() == Byte.TYPE
> - || f.getType() == Short.TYPE
> - || f.getType() == Integer.TYPE
> - || f.getType() == Long.TYPE) {
> - write(reference, "GetStaticField literalreturn " + ret);
> - } else if (f.getType() == Float.TYPE
> - || f.getType() == Double.TYPE) {
> - write(reference, "GetStaticField literalreturn " + String.format("%308.308e", ret));
> - } else if (f.getType() == Character.TYPE) {
> - write(reference, "GetStaticField literalreturn " + (int) (Character) ret);
> - } else {
> - // Track returned object.
> - store.reference(ret);
> - write(reference, "GetStaticField " + store.getIdentifier(ret));
> - }
> + String objIDStr = toObjectIDString(ret, f.getType(), false /*do not unbox primitives*/);
> + write(reference, "GetStaticField " + objIDStr);
> } else if (message.startsWith("GetValue")) {
> String[] args = message.split(" ");
> Integer index = parseCall(args[1], null, Integer.class);
>
> Object ret = store.getObject(index);
>
> - if (ret == null) {
> - write(reference, "GetValue literalreturn null");
> - } else if (ret.getClass() == Boolean.TYPE
> - || ret.getClass() == Boolean.class
> - || ret.getClass() == Byte.TYPE
> - || ret.getClass() == Byte.class
> - || ret.getClass() == Short.TYPE
> - || ret.getClass() == Short.class
> - || ret.getClass() == Integer.TYPE
> - || ret.getClass() == Integer.class
> - || ret.getClass() == Long.TYPE
> - || ret.getClass() == Long.class) {
> - write(reference, "GetValue literalreturn " + ret);
> - } else if (ret.getClass() == Float.TYPE
> - || ret.getClass() == Float.class
> - || ret.getClass() == Double.TYPE
> - || ret.getClass() == Double.class) {
> - write(reference, "GetValue literalreturn " + String.format("%308.308e", ret));
> - } else if (ret.getClass() == Character.TYPE
> - || ret.getClass() == Character.class) {
> - write(reference, "GetValue literalreturn " + (int) (Character) ret);
> - } else {
> - // Track returned object.
> - store.reference(ret);
> - write(reference, "GetValue " + store.getIdentifier(ret));
> - }
> + String objIDStr = toObjectIDString(ret, ret.getClass(), true /*unbox primitives*/);
> + write(reference, "GetValue " + objIDStr);
> } else if (message.startsWith("SetStaticField") ||
> message.startsWith("SetField")) {
> String[] args = message.split(" ");
> @@ -519,24 +556,8 @@ public class PluginAppletSecurityContext
> Object ret = Array.get(array, index);
> Class> retClass = array.getClass().getComponentType(); // prevent auto-boxing influence
>
> - if (ret == null) {
> - write(reference, "GetObjectArrayElement literalreturn null");
> - } else if (retClass == Boolean.TYPE
> - || retClass == Byte.TYPE
> - || retClass == Short.TYPE
> - || retClass == Integer.TYPE
> - || retClass == Long.TYPE) {
> - write(reference, "GetObjectArrayElement literalreturn " + ret);
> - } else if (retClass == Float.TYPE
> - || retClass == Double.TYPE) {
> - write(reference, "GetObjectArrayElement literalreturn " + String.format("%308.308e", ret));
> - } else if (retClass == Character.TYPE) {
> - write(reference, "GetObjectArrayElement literalreturn " + (int) (Character) ret);
> - } else {
> - // Track returned object.
> - store.reference(ret);
> - write(reference, "GetObjectArrayElement " + store.getIdentifier(ret));
> - }
> + String objIDStr = toObjectIDString(ret, retClass, false /*do not unbox primitives*/);
> + write(reference, "GetObjectArrayElement " + objIDStr);
>
> } else if (message.startsWith("SetObjectArrayElement")) {
> String[] args = message.split(" ");
> @@ -586,25 +607,8 @@ public class PluginAppletSecurityContext
> if (ret instanceof Throwable)
> throw (Throwable) ret;
>
> - if (ret == null) {
> - write(reference, "GetField literalreturn null");
> - } else if (f.getType() == Boolean.TYPE
> - || f.getType() == Byte.TYPE
> - || f.getType() == Short.TYPE
> - || f.getType() == Integer.TYPE
> - || f.getType() == Long.TYPE) {
> - write(reference, "GetField literalreturn " + ret);
> - } else if (f.getType() == Float.TYPE
> - || f.getType() == Double.TYPE) {
> - write(reference, "GetField literalreturn " + String.format("%308.308e", ret));
> - } else if (f.getType() == Character.TYPE) {
> - write(reference, "GetField literalreturn " + (int) (Character) ret);
> - } else {
> - // Track returned object.
> - store.reference(ret);
> - write(reference, "GetField " + store.getIdentifier(ret));
> - }
> -
> + String objIDStr = toObjectIDString(ret, f.getType(), false /*do not unbox primitives*/);
> + write(reference, "GetField " + objIDStr);
> } else if (message.startsWith("GetObjectClass")) {
> int oid = Integer.parseInt(message.substring("GetObjectClass"
> .length() + 1));
> @@ -690,27 +694,8 @@ public class PluginAppletSecurityContext
> , collapsedArgs, " and that returned: ", ret
> , " of type ", retO);
>
> - if (m.getReturnType().equals(java.lang.Void.class) ||
> - m.getReturnType().equals(java.lang.Void.TYPE)) {
> - write(reference, "CallMethod literalreturn void");
> - } else if (ret == null) {
> - write(reference, "CallMethod literalreturn null");
> - } else if (m.getReturnType() == Boolean.TYPE
> - || m.getReturnType() == Byte.TYPE
> - || m.getReturnType() == Short.TYPE
> - || m.getReturnType() == Integer.TYPE
> - || m.getReturnType() == Long.TYPE) {
> - write(reference, "CallMethod literalreturn " + ret);
> - } else if (m.getReturnType() == Float.TYPE
> - || m.getReturnType() == Double.TYPE) {
> - write(reference, "CallMethod literalreturn " + String.format("%308.308e", ret));
> - } else if (m.getReturnType() == Character.TYPE) {
> - write(reference, "CallMethod literalreturn " + (int) (Character) ret);
> - } else {
> - // Track returned object.
> - store.reference(ret);
> - write(reference, "CallMethod " + store.getIdentifier(ret));
> - }
> + String objIDStr = toObjectIDString(ret, m.getReturnType(), false /*do not unbox primitives*/);
> + write(reference, "CallMethod " + objIDStr);
> } else if (message.startsWith("GetSuperclass")) {
> String[] args = message.split(" ");
> Integer classID = parseCall(args[1], null, Integer.class);
> @@ -778,10 +763,7 @@ public class PluginAppletSecurityContext
> buf = new StringBuffer(b.length * 2);
> buf.append(b.length);
> for (int i = 0; i < b.length; i++)
> - buf
> - .append(" "
> - + Integer
> - .toString(((int) b[i]) & 0x0ff, 16));
> + buf.append(" " + Integer.toString(((int) b[i]) & 0x0ff, 16));
>
> write(reference, "GetStringUTFChars " + buf);
> } else if (message.startsWith("GetStringChars")) {
> @@ -797,10 +779,7 @@ public class PluginAppletSecurityContext
> buf = new StringBuffer(b.length * 2);
> buf.append(b.length);
> for (int i = 0; i < b.length; i++)
> - buf
> - .append(" "
> - + Integer
> - .toString(((int) b[i]) & 0x0ff, 16));
> + buf.append(" " + Integer.toString(((int) b[i]) & 0x0ff, 16));
>
> PluginDebug.debug("Java: GetStringChars: ", o);
> PluginDebug.debug(" String BYTES: ", buf);
> @@ -817,10 +796,7 @@ public class PluginAppletSecurityContext
> buf = new StringBuffer(b.length * 2);
> buf.append(b.length);
> for (int i = 0; i < b.length; i++)
> - buf
> - .append(" "
> - + Integer
> - .toString(((int) b[i]) & 0x0ff, 16));
> + buf.append(" " + Integer.toString(((int) b[i]) & 0x0ff, 16));
>
> write(reference, "GetToStringValue " + buf);
> } else if (message.startsWith("NewArray")) {
> 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
> @@ -1022,36 +1022,13 @@ public class PluginAppletViewer extends
>
> // work on a copy of value, as we don't want to be manipulating
> // complex objects
> - String valueToSetTo;
> - if (value instanceof java.lang.Byte ||
> - value instanceof java.lang.Character ||
> - value instanceof java.lang.Short ||
> - value instanceof java.lang.Integer ||
> - value instanceof java.lang.Long ||
> - value instanceof java.lang.Float ||
> - value instanceof java.lang.Double ||
> - value instanceof java.lang.Boolean) {
> -
> - valueToSetTo = "literalreturn " + value.toString();
> -
> - // Character -> Str results in str value.. we need int value as
> - // per specs.
> - if (value instanceof java.lang.Character) {
> - valueToSetTo = "literalreturn " + (int) ((java.lang.Character) value).charValue();
> - } else if (value instanceof Float ||
> - value instanceof Double) {
> - valueToSetTo = "literalreturn " + String.format("%308.308e", value);
> - }
> -
> - } else {
> - AppletSecurityContextManager.getSecurityContext(0).store(value);
> - valueToSetTo = Integer.toString(AppletSecurityContextManager.getSecurityContext(0).getIdentifier(value));
> - }
> + String objIDStr = securityContext.toObjectIDString(value,
> + value.getClass(), true /* unbox primitives */);
>
> // Prefix with dummy instance for convenience.
> PluginCallRequest request = requestFactory.getPluginCallRequest("void",
> "instance " + 0 + " reference " + reference + " SetMember " +
> - internal + " " + nameID + " " + valueToSetTo, reference);
> + internal + " " + nameID + " " + objIDStr, reference);
>
> streamhandler.postCallRequest(request);
> streamhandler.write(request.getMessage());
> @@ -1077,38 +1054,13 @@ public class PluginAppletViewer extends
> securityContext.store(value);
> Long reference = getRequestIdentifier();
>
> - // work on a copy of value, as we don't want to be manipulating
> - // complex objects
> - String valueToSetTo;
> - if (value instanceof java.lang.Byte ||
> - value instanceof java.lang.Character ||
> - value instanceof java.lang.Short ||
> - value instanceof java.lang.Integer ||
> - value instanceof java.lang.Long ||
> - value instanceof java.lang.Float ||
> - value instanceof java.lang.Double ||
> - value instanceof java.lang.Boolean) {
> -
> - valueToSetTo = "literalreturn " + value.toString();
> -
> - // Character -> Str results in str value.. we need int value as
> - // per specs.
> - if (value instanceof java.lang.Character) {
> - valueToSetTo = "literalreturn " + (int) ((java.lang.Character) value).charValue();
> - } else if (value instanceof Float ||
> - value instanceof Double) {
> - valueToSetTo = "literalreturn " + String.format("%308.308e", value);
> - }
> -
> - } else {
> - AppletSecurityContextManager.getSecurityContext(0).store(value);
> - valueToSetTo = Integer.toString(AppletSecurityContextManager.getSecurityContext(0).getIdentifier(value));
> - }
> + String objIDStr = securityContext.toObjectIDString(value,
> + value.getClass(), true /* unbox primitives */);
>
> // Prefix with dummy instance for convenience.
> PluginCallRequest request = requestFactory.getPluginCallRequest("void",
> "instance " + 0 + " reference " + reference + " SetSlot " +
> - internal + " " + index + " " + valueToSetTo, reference);
> + internal + " " + index + " " + objIDStr, reference);
>
> streamhandler.postCallRequest(request);
> streamhandler.write(request.getMessage());
> diff --git a/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java b/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java
> --- a/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java
> +++ b/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java
> @@ -37,8 +37,6 @@ exception statement from your version.
>
> import static org.junit.Assert.assertTrue;
>
> -import net.sourceforge.jnlp.annotations.KnownToFail;
> -
> import net.sourceforge.jnlp.ProcessResult;
> import net.sourceforge.jnlp.ServerAccess.AutoClose;
> import net.sourceforge.jnlp.annotations.Bug;
> @@ -62,7 +60,6 @@ public class JSObjectFromEvalTest extend
> @Test
> @TestInBrowsers(testIn = { Browsers.all })
> @NeedsDisplay
> - @KnownToFail
> @Bug(id = { "PR1198" })
> public void testJSObjectSetMemberIsSet() throws Exception {
> ProcessResult pr = server.executeBrowser("/JSObjectFromEval.html",
>
I'm now ok with the patch except missing unit tests. Also I'm missing the prommised :
" ( unboxPrimitives&& (type == Float.class || type == Double.class) " fixes.
So lets push after those two are solved. Thank you!
J.
From jvanek at redhat.com Mon Jan 7 07:09:14 2013
From: jvanek at redhat.com (Jiri Vanek)
Date: Mon, 07 Jan 2013 16:09:14 +0100
Subject: [rfc][icedtea-web] Fix for PR1198, JSObject passed incorrectly
to Javascript
In-Reply-To: <50E72F25.1030903@redhat.com>
References: <50B92039.4070304@redhat.com> <50E6AD9E.9040100@redhat.com>
<50E72F25.1030903@redhat.com>
Message-ID: <50EAE51A.4020505@redhat.com>
On 01/04/2013 08:36 PM, Adam Domurad wrote:
>
> streamhandler.postCallRequest(request);
> streamhandler.write(request.getMessage());
> diff --git a/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java b/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java
> --- a/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java
> +++ b/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java
> @@ -37,8 +37,6 @@ exception statement from your version.
>
> import static org.junit.Assert.assertTrue;
>
> -import net.sourceforge.jnlp.annotations.KnownToFail;
> -
> import net.sourceforge.jnlp.ProcessResult;
> import net.sourceforge.jnlp.ServerAccess.AutoClose;
> import net.sourceforge.jnlp.annotations.Bug;
> @@ -62,7 +60,6 @@ public class JSObjectFromEvalTest extend
> @Test
> @TestInBrowsers(testIn = { Browsers.all })
> @NeedsDisplay
> - @KnownToFail
> @Bug(id = { "PR1198" })
> public void testJSObjectSetMemberIsSet() throws Exception {
> ProcessResult pr = server.executeBrowser("/JSObjectFromEval.html",
One forgotten question to above chunk:
You told that there was one important change in tests - well I have noted this one, it does not look
so dramatic:) Was there something else??
J.
From adomurad at redhat.com Mon Jan 7 07:47:48 2013
From: adomurad at redhat.com (Adam Domurad)
Date: Mon, 07 Jan 2013 10:47:48 -0500
Subject: [rfc][icedtea-web] Fix for PR1198, JSObject passed incorrectly
to Javascript
In-Reply-To: <50EAE14D.5050505@redhat.com>
References: <50B92039.4070304@redhat.com> <50BCF77F.2020808@redhat.com>
<50E6A438.1010605@redhat.com> <50E70F2D.2070805@redhat.com>
<50EAE14D.5050505@redhat.com>
Message-ID: <50EAEE24.2080804@redhat.com>
On 01/07/2013 09:53 AM, Jiri Vanek wrote:
>> [.. rest snipped..]
> Isn't missing updated junit patch here?
Sorry, was awaiting your advice -- if you did not like this
security-manager-in-constructor change than the unit test would not be
valid, a quite different approach would have to be used.
>
> Thanx for looking into it.
> J.
>
patch attached,
-Adam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jsfix-unittest2.patch
Type: text/x-patch
Size: 12372 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130107/33d9ed54/jsfix-unittest2.patch
From adomurad at redhat.com Mon Jan 7 07:54:24 2013
From: adomurad at redhat.com (Adam Domurad)
Date: Mon, 07 Jan 2013 10:54:24 -0500
Subject: [rfc][icedtea-web] Fix for PR1198, JSObject passed incorrectly
to Javascript
In-Reply-To: <50EAE4C9.1010107@redhat.com>
References: <50B92039.4070304@redhat.com> <50E6AD9E.9040100@redhat.com>
<50E72F25.1030903@redhat.com> <50EAE4C9.1010107@redhat.com>
Message-ID: <50EAEFB0.7090004@redhat.com>
On 01/07/2013 10:07 AM, Jiri Vanek wrote:
> On 01/04/2013 08:36 PM, Adam Domurad wrote:
>> On 01/04/2013 05:23 AM, Jiri Vanek wrote:
>>> [.. snipped..]
>>
>> As you suggested, I have separated the cosmetic changes and pushed
>> them. It did prove quite tricky,
>> though.
>
> ty :)
>
>>
>>>>
>>>> diff --git a/NEWS b/NEWS
>>>> --- a/NEWS
>>>> +++ b/NEWS
>>>> @@ -19,6 +19,7 @@ New in release 1.4 (2012-XX-XX):
>>>> * Plugin
>>>> - PR1106: Buffer overflow in plugin table-
>>>> - PR1166: Embedded JNLP File is not supported in applet tag
>>>> + - PR1198: JSObject is not passed to javascript correctly
>>>> * Common
>>>> - PR1049: Extension jnlp's signed jar with the content of only
>>>> META-INF/* is considered
>>>> - PR955: regression: SweetHome3D fails to run
>>>> diff --git a/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc
>>>> b/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc
>>>> --- a/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc
>>>> +++ b/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc
>>>> @@ -131,7 +131,7 @@ JavaRequestProcessor::newMessageOnBus(co
>>>> !message_parts->at(4)->find("GetObjectArrayElement"))
>>>> {
>>>>
>>>> - if (!message_parts->at(5)->find("literalreturn"))
>>>> + if (!message_parts->at(5)->find("literalreturn") ||
>>>> !message_parts->at(5)->find("jsobject"))
>>>> {
>>>> // literal returns don't have a corresponding
>>>> jni id
>>>> result->return_identifier = 0;
>>>> diff --git a/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
>>>> b/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
>>>> --- a/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
>>>> +++ b/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
>>>> @@ -413,7 +413,7 @@ PluginRequestProcessor::setMember(std::v
>>>> member = (NPVariant*)
>>>> (IcedTeaPluginUtilities::stringToJSID(*(message_parts->at(5))));
>>>> propertyNameID = *(message_parts->at(6));
>>>>
>>>> - if (*(message_parts->at(7)) == "literalreturn")
>>>> + if (*(message_parts->at(7)) == "literalreturn" ||
>>>> *(message_parts->at(7)) == "jsobject" )
>>>> {
>>>> value.append(*(message_parts->at(7)));
>>>> value.append(" ");
>>>> diff --git a/plugin/icedteanp/IcedTeaPluginUtils.cc
>>>> b/plugin/icedteanp/IcedTeaPluginUtils.cc
>>>> --- a/plugin/icedteanp/IcedTeaPluginUtils.cc
>>>> +++ b/plugin/icedteanp/IcedTeaPluginUtils.cc
>>>> @@ -776,6 +776,14 @@ javaStringResultToNPVariant(const std::s
>>>> }
>>>>
>>>> static bool
>>>> +javaJSObjectResultToNPVariant(const std::string& js_id, NPVariant*
>>>> variant)
>>>> +{
>>>> + NPVariant* result_variant = (NPVariant*)
>>>> IcedTeaPluginUtilities::stringToJSID(js_id);
>>>> + *variant = *result_variant;
>>>> + return true;
>>>> +}
>>>
>>> It returns always true?? Maybe void or *variant?
>>
>> I left this accidentally after it could no longer fail, made it void.
> yap
>
>>
>>>
>>>> +
>>>> +static bool
>>>> javaObjectResultToNPVariant(NPP instance, const std::string&
>>>> jobject_id, NPVariant* variant)
>>>> {
>>>> // Reference the class object so we can construct an NPObject
>>>> with it and the instance
>>>> @@ -811,9 +819,14 @@ IcedTeaPluginUtilities::javaResultToNPVa
>>>> std::string* java_value, NPVariant* variant)
>>>> {
>>>> int literal_n = sizeof("literalreturn"); // Accounts for one
>>>> space char
>>>> + int jsobject_n = sizeof("jsobject"); // Accounts for one space
>>>> char
>>>> +
>>>> if (strncmp("literalreturn ", java_value->c_str(), literal_n)
>>>> == 0)
>>>> {
>>>> javaPrimitiveResultToNPVariant(java_value->substr(literal_n),
>>>> variant);
>>>> + } else if (strncmp("jsobject ", java_value->c_str(),
>>>> jsobject_n) == 0)
>>>> + {
>>>> + javaJSObjectResultToNPVariant(java_value->substr(jsobject_n),
>>>> variant);
>>>> } else
>>>> {
>>>> std::string jobject_id = *java_value;
>>>>
>> [... long snip...]
>>>> public void setJSMember(JSObject js, String memb, Object val) {
>>>> - String typeName = val.getClass().getName();
>>>> - System.out.println("setJSMember: passed '" + typeName + "'");
>>> Not worthy to keep in debug?
>>> Anyway - cosmetic change. See my comment lower.
>>
>> No, this was part of the expected reproducer output. It was removed
>> from the checks because the type
>> is dependent on the browser. It was causing failures on some
>> browsers. I have pushed it with my
>> cosmetic changes anyway.
>
> oook.
>>
>>>> js.setMember(memb, val);
>>>> }
>>>> }
>>>> \ No newline at end of file
>>>> diff --git
>>>> a/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java
>>>> b/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java
>>>>
>>>> ---
>>>> a/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java
>>>> +++
>>>> b/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java
>>>> @@ -40,7 +40,6 @@ import static org.junit.Assert.assertTru
>>>> import net.sourceforge.jnlp.ProcessResult;
>>>> import net.sourceforge.jnlp.ServerAccess.AutoClose;
>>>> 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 net.sourceforge.jnlp.browsertesting.BrowserTest;
>>>> @@ -51,40 +50,37 @@ import org.junit.Test;
>>>>
>>>> public class JSObjectFromEvalTest extends BrowserTest {
>>>>
>>>> - private static final String END_STRING =
>>>> AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING;
>>>> + private static final String END_STRING =
>>>> AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING;
>>>>
>>>> - private static final String JAVA_CREATE = "Java create\n";
>>>> - private static final String JS_CREATE = "JS create\n";
>>>> - private static final String JAVA_SET = "Java set\n";
>>>> - private static final String PASSED_INTEGER = "setJSMember:
>>>> passed 'java.lang.Integer'\n";
>>>> - private static final String CORRECT_VALUE = "obj.test = 0";
>>>> + private static final String JAVA_CREATE = "Java create\n";
>>>> + private static final String JS_CREATE = "JS create\n";
>>>> + private static final String JAVA_SET = "Java set\n";
>>>> + private static final String CORRECT_VALUE = "obj.test = 0";
>>>>
>>>> - @Test
>>>> - @TestInBrowsers(testIn = { Browsers.all })
>>>> - @NeedsDisplay
>>>> - @Bug(id = { "PR1198" })
>>>> - @KnownToFail
>>>> - public void testJSObjectSetMemberIsSet() throws Exception {
>>>> - ProcessResult pr =
>>>> server.executeBrowser("/JSObjectFromEval.html",
>>>> - AutoClose.CLOSE_ON_BOTH);
>>>> + @Test
>>>> + @TestInBrowsers(testIn = { Browsers.all })
>>>> + @NeedsDisplay
>>>> + @Bug(id = { "PR1198" })
>>>> + public void testJSObjectSetMemberIsSet() throws Exception {
>>>> + ProcessResult pr =
>>>> server.executeBrowser("/JSObjectFromEval.html",
>>>> + AutoClose.CLOSE_ON_BOTH);
>>>>
>>>> - String expectedJSCreateOutput = JS_CREATE + JAVA_SET +
>>>> PASSED_INTEGER
>>>> - + CORRECT_VALUE;
>>>> - String expectedJavaCreateOutput = JAVA_CREATE + JAVA_SET
>>>> - + PASSED_INTEGER + CORRECT_VALUE;
>>>> + String expectedJSCreateOutput = JS_CREATE + JAVA_SET +
>>>> CORRECT_VALUE;
>>>> + String expectedJavaCreateOutput = JAVA_CREATE + JAVA_SET
>>>> + + CORRECT_VALUE;
>>>>
>>>> - // No reason JS create should fail, this is mostly a
>>>> sanity check:
>>>> - assertTrue("stdout should contain 'JS create [...] " +
>>>> CORRECT_VALUE
>>>> - + "' but did not.",
>>>> pr.stdout.contains(expectedJSCreateOutput));
>>>> + // No reason JS create should fail, this is mostly a
>>>> sanity check:
>>>> + assertTrue("stdout should contain 'JS create [...] " +
>>>> CORRECT_VALUE
>>>> + + "' but did not.",
>>>> pr.stdout.contains(expectedJSCreateOutput));
>>>>
>>>> - // Demonstrates PR1198:
>>>> - assertTrue("stdout should contain 'Java create [...] " +
>>>> CORRECT_VALUE
>>>> - + "' but did not.",
>>>> - pr.stdout.contains(expectedJavaCreateOutput));
>>>> + // Demonstrates PR1198:
>>>> + assertTrue("stdout should contain 'Java create [...] " +
>>>> CORRECT_VALUE
>>>> + + "' but did not.",
>>>> + pr.stdout.contains(expectedJavaCreateOutput));
>>>>
>>>> - // Make sure we got to the end of the script
>>>> - assertTrue("stdout should contain '" + END_STRING + "' but
>>>> did not.",
>>>> - pr.stdout.contains(END_STRING));
>>>> - }
>>>> + // Make sure we got to the end of the script
>>>> + assertTrue("stdout should contain '" + END_STRING + "' but
>>>> did not.",
>>>> + pr.stdout.contains(END_STRING));
>>>> + }
>>>>
>>>> }
>>>
>>> Cosmetic changes - normlay I'm for smughling small cosmetich changes
>>> which were found during
>>> coding, especially somnething like
>>> > - buf
>>> > - .append(" "
>>> > - + Integer
>>> > - .toString(((int) b[i])& 0x0ff, 16));
>>> > + buf.append(" " + Integer.toString(((int)
>>> b[i])& 0x0ff, 16));
>>>
>>> :))
>>>
>>> into patch. But there is one whole refacotred file and little bit
>>> more. If you will be willing can
>>> you separate the changes? You can push the comsetic changes directly.
>>>
>>> Well and then you will start to hate me with removing of KnowToFail...
>>> Thanx for fix.
>>> J.
>>>
>>>
>>> ps: Try to check js<->java automated tests and manual liveConnect
>>> testuite. I think there wil be
>>> some hddien fixes by this aptch. Adnd With some luck also no
>>> regressions;) Maybe jana Can meassure
>>> those results for you. She is th eguru of liveConnect testing
>>> afterall..
>>> pps: Dont take me wrong, this is really nice cleanup and fix.
>>
>> Will do.
>>
>> Attached is an updated patch, with some cleanup removed (since it was
>> pushed) and the fixes from my
>> unit test patch added.
>> See my reply to unit test review though -- I need some additional
>> advice on what to do about the
>> security manager problem.
>>
>> Happy hacking,
>> -Adam
>> [..snip..]
>> import net.sourceforge.jnlp.ProcessResult;
>> import net.sourceforge.jnlp.ServerAccess.AutoClose;
>> import net.sourceforge.jnlp.annotations.Bug;
>> @@ -62,7 +60,6 @@ public class JSObjectFromEvalTest extend
>> @Test
>> @TestInBrowsers(testIn = { Browsers.all })
>> @NeedsDisplay
>> - @KnownToFail
>> @Bug(id = { "PR1198" })
>> public void testJSObjectSetMemberIsSet() throws Exception {
>> ProcessResult pr =
>> server.executeBrowser("/JSObjectFromEval.html",
>>
>
>
> I'm now ok with the patch except missing unit tests. Also I'm missing
> the prommised :
> " ( unboxPrimitives&& (type == Float.class || type == Double.class) "
> fixes.
Missing how ?
From patch:
+ if ( type == Float.TYPE || type == Double.TYPE ||
+ ( unboxPrimitives && (type == Float.class || type ==
Double.class) )) {
>
> So lets push after those two are solved. Thank you!
> J.
Answer to PS:
>
> One forgotten question to above chunk:
>
> You told that there was one important change in tests - well I have
> noted this one, it does not look so dramatic:) Was there something else??
>
> J.
Sorry, it was pushed as 'cosmetic change' because it would have been
painful to separate :). It was removal of a test assert that explicitly
checked that the return type was java.lang.Integer, but some JS engines
actually returned java.lang.Double. The fix is in HEAD now.
I have also posted new iteration of unit tests.
Thanks for the review!
-Adam
From jvanek at redhat.com Mon Jan 7 08:06:30 2013
From: jvanek at redhat.com (Jiri Vanek)
Date: Mon, 07 Jan 2013 17:06:30 +0100
Subject: [rfc][icedtea-web] Fix for PR1198, JSObject passed incorrectly
to Javascript
In-Reply-To: <50EAEFB0.7090004@redhat.com>
References: <50B92039.4070304@redhat.com> <50E6AD9E.9040100@redhat.com>
<50E72F25.1030903@redhat.com> <50EAE4C9.1010107@redhat.com>
<50EAEFB0.7090004@redhat.com>
Message-ID: <50EAF286.1000703@redhat.com>
On 01/07/2013 04:54 PM, Adam Domurad wrote:
> On 01/07/2013 10:07 AM, Jiri Vanek wrote:
>> On 01/04/2013 08:36 PM, Adam Domurad wrote:
>>> On 01/04/2013 05:23 AM, Jiri Vanek wrote:
...snip...
>>> @Bug(id = { "PR1198" })
>>> public void testJSObjectSetMemberIsSet() throws Exception {
>>> ProcessResult pr = server.executeBrowser("/JSObjectFromEval.html",
>>>
>>
>>
>> I'm now ok with the patch except missing unit tests. Also I'm missing the prommised :
>> " ( unboxPrimitives&& (type == Float.class || type == Double.class) " fixes.
>
> Missing how ?
> From patch:
>
> + if ( type == Float.TYPE || type == Double.TYPE ||
> + ( unboxPrimitives && (type == Float.class || type == Double.class) )) {
>
>
>>
Ok. Sorry, overlooked.
>> So lets push after those two are solved. Thank you!
>> J.
>
> Answer to PS:
>
>>
>> One forgotten question to above chunk:
>>
>> You told that there was one important change in tests - well I have noted this one, it does not
>> look so dramatic:) Was there something else??
>>
>> J.
>
> Sorry, it was pushed as 'cosmetic change' because it would have been painful to separate :). It was
> removal of a test assert that explicitly checked that the return type was java.lang.Integer, but
> some JS engines actually returned java.lang.Double. The fix is in HEAD now.
>
> I have also posted new iteration of unit tests.
I see.. :-/ not only money is root of all evil!
>
> Thanks for the review!
> -Adam
>
From jvanek at redhat.com Mon Jan 7 08:44:10 2013
From: jvanek at redhat.com (Jiri Vanek)
Date: Mon, 07 Jan 2013 17:44:10 +0100
Subject: [rfc][icedtea-web] Fix for PR1198, JSObject passed incorrectly
to Javascript
In-Reply-To: <50EAEE24.2080804@redhat.com>
References: <50B92039.4070304@redhat.com> <50BCF77F.2020808@redhat.com>
<50E6A438.1010605@redhat.com> <50E70F2D.2070805@redhat.com>
<50EAE14D.5050505@redhat.com> <50EAEE24.2080804@redhat.com>
Message-ID: <50EAFB5A.9000104@redhat.com>
On 01/07/2013 04:47 PM, Adam Domurad wrote:
> On 01/07/2013 09:53 AM, Jiri Vanek wrote:
>>> [.. rest snipped..]
>> Isn't missing updated junit patch here?
>
> Sorry, was awaiting your advice -- if you did not like this security-manager-in-constructor change
> than the unit test would not be valid, a quite different approach would have to be used.
>
>>
>> Thanx for looking into it.
>> J.
>>
>
>
> patch attached,
> -Adam
>
> jsfix-unittest2.patch
>
>
> diff --git a/plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java b/plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java
> new file mode 100644
> --- /dev/null
> +++ b/plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java
> @@ -0,0 +1,49 @@
> +/* JSObjectUnboxPermission.java
> + Copyright (C) 2012 Red Hat
> +
> +This file is part of IcedTea.
> +
> +IcedTea is free software; you can redistribute it and/or modify
> +it under the terms of the GNU General Public License as published by
> +the Free Software Foundation; either version 2, or (at your option)
> +any later version.
> +
> +IcedTea is distributed in the hope that it will be useful, but
> +WITHOUT ANY WARRANTY; without even the implied warranty of
> +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> +General Public License for more details.
> +
> +You should have received a copy of the GNU General Public License
> +along with IcedTea; see the file COPYING. If not, write to the
> +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> +02110-1301 USA.
> +
> +Linking this library statically or dynamically with other modules is
> +making a combined work based on this library. Thus, the terms and
> +conditions of the GNU General Public License cover the whole
> +combination.
> +
> +As a special exception, the copyright holders of this library give you
> +permission to link this library with independent modules to produce an
> +executable, regardless of the license terms of these independent
> +modules, and to copy and distribute the resulting executable under
> +terms of your choice, provided that you also meet, for each linked
> +independent module, the terms and conditions of the license of that
> +module. An independent module is a module which is not derived from
> +or based on this library. If you modify this library, you may extend
> +this exception to your version of the library, but you are not
> +obligated to do so. If you do not wish to do so, delete this
> +exception statement from your version. */
> +
> +package netscape.javascript;
> +
> +import java.security.BasicPermission;
> +
> +/**
> + * Permission to access internal reference of JSObject
> + */
> +public class JSObjectUnboxPermission extends BasicPermission {
> + public JSObjectUnboxPermission() {
> + super("JSObjectUnbox");
> + }
> +}
> diff --git a/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java b/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
> --- a/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
> +++ b/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
> @@ -53,7 +53,6 @@ import java.security.Permissions;
> import java.security.PrivilegedAction;
> import java.security.ProtectionDomain;
> import java.util.ArrayList;
> -import java.util.Arrays;
> import java.util.Hashtable;
> import java.util.List;
> import java.util.Map;
> @@ -241,16 +240,6 @@ public class PluginAppletSecurityContext
> public PluginAppletSecurityContext(int identifier) {
> this.identifier = identifier;
>
> - // We need a security manager.. and since there is a good chance that
> - // an applet will be loaded at some point, we should make it the SM
> - // that JNLPRuntime will try to install
> - if (System.getSecurityManager() == null) {
> - JNLPRuntime.initialize(/* isApplication */false);
> - JNLPRuntime.setDefaultLaunchHandler(new DefaultLaunchHandler(System.err));
> - }
> -
> - JNLPRuntime.disableExit();
> -
> URL u = null;
> try {
> u = new URL("file://");
> diff --git a/plugin/icedteanp/java/sun/applet/PluginMain.java b/plugin/icedteanp/java/sun/applet/PluginMain.java
> --- a/plugin/icedteanp/java/sun/applet/PluginMain.java
> +++ b/plugin/icedteanp/java/sun/applet/PluginMain.java
> @@ -73,6 +73,7 @@ import java.net.ProxySelector;
> import java.util.Enumeration;
> import java.util.Properties;
>
> +import net.sourceforge.jnlp.DefaultLaunchHandler;
> import net.sourceforge.jnlp.config.DeploymentConfiguration;
> import net.sourceforge.jnlp.runtime.JNLPRuntime;
> import net.sourceforge.jnlp.security.JNLPAuthenticator;
> @@ -106,6 +107,15 @@ public class PluginMain {
> // must be called before JNLPRuntime.initialize()
> JNLPRuntime.setRedirectStreams(redirectStreams);
>
> + // We need a security manager for PluginAppletSecurityContext,
> + // so we ensure it is initialized
> + if (System.getSecurityManager() == null) {
> + JNLPRuntime.initialize(/* isApplication */false);
> + JNLPRuntime.setDefaultLaunchHandler(new DefaultLaunchHandler(System.err));
> + }
> +
> + JNLPRuntime.disableExit();
> +
> PluginAppletSecurityContext sc = new PluginAppletSecurityContext(0);
> sc.prePopulateLCClasses();
Well, I'm still not comfortable with this change.
I'm not sure which security parts can be affected:-/ I really would like to know Jana's opinion here.
Do you mind to move it to separate method?
> PluginAppletSecurityContext.setStreamhandler(streamHandler);
> diff --git a/tests/netx/unit/sun/applet/PluginAppletSecurityContextTest.java b/tests/netx/unit/sun/applet/PluginAppletSecurityContextTest.java
> new file mode 100644
> --- /dev/null
> +++ b/tests/netx/unit/sun/applet/PluginAppletSecurityContextTest.java
> @@ -0,0 +1,181 @@
> +package sun.applet;
> +
> +import static org.junit.Assert.assertTrue;
> +import static org.junit.Assert.assertFalse;
> +import static org.junit.Assert.assertEquals;
> +
> +import netscape.javascript.JSObject;
> +
> +import org.junit.Test;
> +
> +public class PluginAppletSecurityContextTest {
> +
> + @Test
> + public void toIDStringNullTest() {
> + PluginAppletSecurityContext pasc = new PluginAppletSecurityContext(0);
> + assertEquals("literalreturn null",
> + pasc.toObjectIDString(null, Object.class, false));
> + }
> +
> + @Test
> + public void toIDStringVoidTest() {
> + PluginAppletSecurityContext pasc = new PluginAppletSecurityContext(0);
> + assertEquals("literalreturn void",
> + pasc.toObjectIDString(null, Void.TYPE, false));
> +
> + assertFalse("literalreturn void".equals(pasc.toObjectIDString(null,
> + Void.class, false)));
> + }
> +
> + @Test
> + public void toIDStringIntegralTest() {
> + // NB: the special .TYPE classes here represent primitives
> + PluginAppletSecurityContext pasc = new PluginAppletSecurityContext(0);
> +
> + // Test both unboxing allowed and not allowed to be sure it doesn't
> + // alter result
> + // although it really shouldn't
> + for (boolean unboxPrimitives : new Boolean[] { false, true }) {
> + assertEquals("literalreturn true", pasc.toObjectIDString(
> + new Boolean(true), Boolean.TYPE, unboxPrimitives));
> +
> + assertEquals("literalreturn 1", pasc.toObjectIDString(new Byte(
> + (byte) 1), Byte.TYPE, unboxPrimitives));
> +
> + assertEquals("literalreturn 1", pasc.toObjectIDString(
> + new Character((char) 1), Character.TYPE, unboxPrimitives));
> +
> + assertEquals("literalreturn 1", pasc.toObjectIDString(new Short(
> + (short) 1), Short.TYPE, unboxPrimitives));
> +
> + assertEquals("literalreturn 1", pasc.toObjectIDString(
> + new Integer(1), Integer.TYPE, unboxPrimitives));
> +
> + assertEquals("literalreturn 1", pasc.toObjectIDString(new Long(1),
> + Long.TYPE, unboxPrimitives));
> + }
> + }
> +
> + @Test
> + public void toIDStringBoxedIntegralNoUnboxingTest() {
> + PluginAppletSecurityContext pasc = new PluginAppletSecurityContext(0);
> +
> + assertFalse("literalreturn true".equals(pasc.toObjectIDString(
> + new Boolean(true), Boolean.class, false)));
> +
> + assertFalse("literalreturn 1".equals(pasc.toObjectIDString(new Byte(
> + (byte) 1), Byte.class, false)));
> +
> + assertFalse("literalreturn 1".equals(pasc.toObjectIDString(
> + new Character((char) 1), Character.class, false)));
> +
> + assertFalse("literalreturn 1".equals(pasc.toObjectIDString(new Short(
> + (short) 1), Short.class, false)));
> +
> + assertFalse("literalreturn 1".equals(pasc.toObjectIDString(new Integer(
> + 1), Integer.class, false)));
> +
> + assertFalse("literalreturn 1".equals(pasc.toObjectIDString(new Long(1),
> + Long.class, false)));
> + }
> +
> + @Test
> + public void toIDStringBoxedIntegralWithUnboxingTest() {
> + PluginAppletSecurityContext pasc = new PluginAppletSecurityContext(0);
> +
> + assertEquals("literalreturn true",
> + pasc.toObjectIDString(new Boolean(true), Boolean.class, true));
> +
> + assertEquals("literalreturn 1",
> + pasc.toObjectIDString(new Byte((byte) 1), Byte.class, true));
> +
> + assertEquals("literalreturn 1", pasc.toObjectIDString(new Character(
> + (char) 1), Character.class, true));
> +
> + assertEquals("literalreturn 1",
> + pasc.toObjectIDString(new Short((short) 1), Short.class, true));
> +
> + assertEquals("literalreturn 1",
> + pasc.toObjectIDString(new Integer(1), Integer.class, true));
> +
> + assertEquals("literalreturn 1",
> + pasc.toObjectIDString(new Long(1), Long.class, true));
> + }
> +
> + @Test
> + public void toIDStringFloatingPoint() {
> + final int prefixLength = "literalreturn ".length();
> +
> + // NB: the special .TYPE classes here represent primitives
> + PluginAppletSecurityContext pasc = new PluginAppletSecurityContext(0);
> +
> + // Test both unboxing allowed and not allowed to be sure it doesn't
> + // alter result
> + // although it really shouldn't
> + for (boolean unboxPrimitives : new Boolean[] { false, true }) {
> + {
> + final float testFloat = 3.141592f;
> + String idString = pasc.toObjectIDString(new Float(testFloat),
> + Float.TYPE, unboxPrimitives);
> + String floatRepr = idString.substring(prefixLength);
> + assertTrue(testFloat == Float.parseFloat(floatRepr));
> + }
> + {
> + final double testDouble = 3.141592;
> + String idString = pasc.toObjectIDString(new Double(testDouble),
> + Double.TYPE, unboxPrimitives);
> + String doubleRepr = idString.substring(prefixLength);
> + assertTrue(testDouble == Double.parseDouble(doubleRepr));
> + }
> +
> + }
> + {
> + final float testFloat = 3.141592f;
> + String idString = pasc.toObjectIDString(new Float(testFloat),
> + Float.class, true);
> + String floatRepr = idString.substring(prefixLength);
> + assertTrue(testFloat == Float.parseFloat(floatRepr));
> + }
> + {
> + final double testDouble = 3.141592;
> + String idString = pasc.toObjectIDString(new Double(testDouble),
> + Double.class, true);
> + String doubleRepr = idString.substring(prefixLength);
> + assertTrue(testDouble == Double.parseDouble(doubleRepr));
> + }
> + {
> + final float testFloat = 3.141592f;
> + String idString = pasc.toObjectIDString(new Float(testFloat),
> + Float.class, false);
> + assertFalse(idString.startsWith("literalreturn "));
> + }
> + {
> + final double testDouble = 3.141592;
> + String idString = pasc.toObjectIDString(new Double(testDouble),
> + Double.class, false);
> + assertFalse(idString.startsWith("literalreturn "));
> + }
> + }
> +
> +// FIXME: How can we get the permissions to do this?
> +// @Test
> +// public void toIDStringJSObject() {
> +// PluginAppletSecurityContext pasc = new PluginAppletSecurityContext(0);
> +//
> +// long testReference = 1;
> +// assertEquals("literalreturn 1", pasc.toObjectIDString(new JSObject(
> +// testReference), JSObject.class, false));
> +// }
Otherwise I'm of for test to go, even with this one commented out. I will try to revisit this once
it will be inside.
> +
> + @Test
> + public void toIDStringArbitraryObject() {
> + PluginAppletSecurityContext pasc = new PluginAppletSecurityContext(0);
> +
> + final Object testObject = new Object();
> + String idString = pasc.toObjectIDString(testObject,
> + testObject.getClass(), false);
> +
> + assertFalse(idString.startsWith("literalreturn"));
> + assertFalse(idString.startsWith("jsobject"));
> + }
> +}
>
From dbhole at icedtea.classpath.org Mon Jan 7 08:55:49 2013
From: dbhole at icedtea.classpath.org (dbhole at icedtea.classpath.org)
Date: Mon, 07 Jan 2013 16:55:49 +0000
Subject: /hg/release/icedtea-web-1.2: Converted Messages.properties to Un...
Message-ID:
changeset cd6608773628 in /hg/release/icedtea-web-1.2
details: http://icedtea.classpath.org/hg/release/icedtea-web-1.2?cmd=changeset;node=cd6608773628
author: Deepak Bhole
date: Mon Jan 07 11:47:37 2013 -0500
Converted Messages.properties to Unix format
diffstat:
ChangeLog | 5 +
netx/net/sourceforge/jnlp/resources/Messages.properties | 636 ++++++++--------
2 files changed, 323 insertions(+), 318 deletions(-)
diffs (truncated from 667 to 500 lines):
diff -r c74251bbaffd -r cd6608773628 ChangeLog
--- a/ChangeLog Mon Dec 03 16:26:42 2012 -0500
+++ b/ChangeLog Mon Jan 07 11:47:37 2013 -0500
@@ -1,3 +1,8 @@
+2013-01-07 Deepak Bhole
+
+ * netx/net/sourceforge/jnlp/resources/Messages.properties: Converted to
+ Unix format.
+
2012-09-17 Deepak Bhole
PR1161: X509VariableTrustManager does not work correctly with OpenJDK7
diff -r c74251bbaffd -r cd6608773628 netx/net/sourceforge/jnlp/resources/Messages.properties
--- a/netx/net/sourceforge/jnlp/resources/Messages.properties Mon Dec 03 16:26:42 2012 -0500
+++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Mon Jan 07 11:47:37 2013 -0500
@@ -1,294 +1,294 @@
-# Default (English) UI messages for netx
-# L=Launcher, B=Boot, P=Parser, C=cache S=security
-#
-# General
-NullParameter=Null parameter
-ButAllow=Allow
-ButBrowse=Browse...
-ButCancel=\ Cancel\
-ButClose=Close
-ButCopy=Copy to Clipboard
-ButMoreInformation=More Information...
-ButOk=OK
-ButProceed=Proceed
-ButRun=Run
-ButApply=Apply
-ButDone=Done
-ButShowDetails=Show Details
-ButHideDetails=Hide Details
-
-AFileOnTheMachine=a file on the machine
-AlwaysAllowAction=Always allow this action
-Usage=Usage:
-Error=Error
-
-Continue=Do you want to continue?
-Field=Field
-From=From
-Name=Name
-Password=Password:
-Publisher=Publisher
-Unknown=
-Username=Username:
-Value=Value
-Version=Version
-
-# LS - Severity
-LSMinor=Minor
-LSFatal=Fatal
-
-# LC - Category
-LCSystem=System Error
-LCExternalLaunch=External Launch Error
-LCFileFormat=File Format Error
-LCReadError=Read Error
-LCClient=Application Error
-LCLaunching=Launch Error
-LCNotSupported=Unsupported Feature
-LCInit=Initialization Error
-
-LAllThreadGroup=All JNLP applications
-LNullUpdatePolicy=Update policy cannot be null.
-
-LThreadInterrupted=Thread interrupted while waiting for file to launch.
-LThreadInterruptedInfo=
-LCouldNotLaunch=Could not launch JNLP file.
-LCouldNotLaunchInfo=
-LCantRead=Could not read or parse the JNLP file.
-LCantReadInfo=
-LNullLocation=Could not determine .jnlp file location.
-LNullLocationInfo=An attempt was made to launch a JNLP file in another JVM, but the file could not be located. In order to launch in an external JVM, the runtime must be able to locate the .jnlp file either in the local filesystem or on a server.
-LNetxJarMissing=Could not determine location of netx.jar.
-LNetxJarMissingInfo=An attempt was made to lauch a JNLP file in another JVM, but the netx.jar could not be located. In order to launch in an external JVM, the runtime must be able to locate the netx.jar file.
-LNotToSpec=JNLP file not strictly to spec.
-LNotToSpecInfo=The JNLP file contains data that is prohibited by the JNLP specification. The runtime can attempt to ignore the invalid information and continue launching the file.
-LNotApplication=Not an application file.
-LNotApplicationInfo=An attempt was made to load a non-application file as an application.
-LNotApplet=Not an applet file.
-LNotAppletInfo=An attempt was made to load a non-applet file as an applet.
-LNoInstallers=Installers not supported.
-LNoInstallersInfo=JNLP installer files are not yet supported.
-LInitApplet=Could not initialize applet.
-LInitAppletInfo=
-LInitApplication=Could not initialize application.
-LInitApplicationInfo=
-LNotLaunchable=Not a launchable JNLP file.
-LNotLaunchableInfo=File must be a JNLP application, applet, or installer type.
-LCantDetermineMainClass=Unknown Main-Class.
-LCantDetermineMainClassInfo=Could not determine the main class for this application.
-LUnsignedJarWithSecurity=Cannot grant permissions to unsigned jars.
-LUnsignedJarWithSecurityInfo=Application requested security permissions, but jars are not signed.
-LSignedAppJarUsingUnsignedJar=Signed application using unsigned jars.
-LSignedAppJarUsingUnsignedJarInfo=The main application jar is signed, but some of the jars it is using aren't.
-LSignedJNLPFileDidNotMatch=The signed JNLP file did not match the launching JNLP file.
-LNoSecInstance=Error: No security instance for {0}. The application may have trouble continuing
-LCertFoundIn={0} found in cacerts ({1})
-
-JNotApplet=File is not an applet.
-JNotApplication=File is not an application.
-JNotComponent=File is not a component.
-JNotInstaller=File is not an installer.
-JInvalidExtensionDescriptor=Extension does not refer to a component or installer (name={1}, location={2}).
-
-LNotVerified=Jars not verified.
-LCancelOnUserRequest=Canceled on user request.
-LFatalVerification=A fatal error occurred while trying to verify jars.
-LFatalVerificationInfo=
-
-LNotVerifiedDialog=Not all jars could be verified.
-LAskToContinue=Would you still like to continue running this application?
-
-# Parser
-PInvalidRoot=Root node is not a jnlp node
-PNoResources=No resources section defined
-PUntrustedNative=nativelib element cannot be specified unless a trusted environment is requested.
-PExtensionHasJ2SE=j2se element cannot be specified in a component extension file.
-PInnerJ2SE=j2se element cannot be specified within a j2se element.
-PTwoMains=Duplicate main JAR defined in a resources element (there can be only one)
-PNativeHasMain=Cannot specify main attribute on native JARs.
-PNoInfoElement=No information section defined
-PTwoDescriptions=Duplicate description of kind {0}
-PSharing=Element "sharing-allowed" is illegal in a standard JNLP file
-PTwoSecurity=Only one security element allowed per JNLPFile.
-PEmptySecurity=Security element specified but does not contain a permissions element.
-PTwoDescriptors=Only one application descriptor element allowed per JNLPFile.
-PTwoDesktops=Only one desktop element allowed
-PTwoMenus=Only one menu element allowed
-PTwoTitles=Only one title element allowed
-PTwoIcons=Only one icon element allowed
-PTwoUpdates=Only one update element is allowed
-PUnknownApplet=Unknown Applet
-PBadWidth=Invalid applet width.
-PBadHeight=Invalid applet height.
-PUrlNotInCodebase=Relative URL does not specify a subdirectory of the codebase. (node={0}, href={1}, base={2})
-PBadRelativeUrl=Invalid relative URL (node={0}, href={1}, base={2})
-PBadNonrelativeUrl=Invalid non-relative URL (node={0}, href={0}).
-PNeedsAttribute=The {0} element must specify a {1} attribute.
-PBadXML=Invalid XML document syntax.
-PBadHeapSize=Invalid value for heap size ({0})
-
-# Runtime
-BLaunchAbout=Launching about window...
-BNeedsFile=Must specify a .jnlp file
-RNoAboutJnlp=Unable to find about.jnlp
-BFileLoc=JNLP file location
-BBadProp=Incorrect property format {0} (should be key=value)
-BBadParam=Incorrect parameter format {0} (should be name=value)
-BNoDir=Directory {0} does not exist.
-RNoResource=Missing Resource: {0}
-RShutdown=This exception to prevent shutdown of JVM, but the process has been terminated.
-RExitTaken=Exit class already set and caller is not exit class.
-RCantReplaceSM=Changing the SecurityManager is not allowed.
-RCantCreateFile=Cant create file {0}
-RCantDeleteFile=Cant delete file {0}
-RRemoveRPermFailed=Removing read permission on file {0} failed
-RRemoveWPermFailed=Removing write permissions on file {0} failed
-RRemoveXPermFailed=Removing execute permissions on file {0} failed
-RGetRPermFailed=Acquiring read permissions on file {0} failed
-RGetWPermFailed=Acquiring write permissions on file {0} failed
-RGetXPermFailed=Acquiring execute permissions on file {0} failed
-RCantCreateDir=Cant create directory {0}
-RCantRename=Cant rename {0} to {1}
-RDenyStopped=Stopped applications have no permissions.
-RExitNoApp=Can not exit the JVM because the current application cannot be determined.
-RNoLockDir=Unable to create locks directory ({0})
-RNestedJarExtration=Unable to extract nested jar.
-RUnexpected=Unexpected {0} at {1}
-RConfigurationError=Fatal error while reading the configuration
-RConfigurationFatal=ERROR: a fatal error has occurred while loading configuration. Perhaps a global configuration was required but could not be found
-RPRoxyPacNotSupported=Using Proxy Auto Config (PAC) files is not supported.
-RProxyFirefoxNotFound=Unable to use Firefox's proxy settings. Using "DIRECT" as proxy type.
-RProxyFirefoxOptionNotImplemented=Browser proxy option "{0}" ({1}) not supported yet.
-RBrowserLocationPromptTitle=Browser Location
-RBrowserLocationPromptMessage=Specify Browser Location
-RBrowserLocationPromptMessageWithReason=Specify Browser Location (the browser command "{0}" is invalid).
-
-# Boot options, message should be shorter than this ---------------->
-BOUsage=javaws [-run-options]
-BOUsage2=javaws [-control-options]
-BOJnlp = Location of JNLP file to launch (url or file).
-BOArg = Adds an application argument before launching.
-BOParam = Adds an applet parameter before launching.
-BOProperty = Sets a system property before launching.
-BOUpdate = Update check if seconds since last checked.
-BOLicense = Display the GPL license and exit.
-BOVerbose = Enable verbose output.
-BOAbout = Shows a sample application.
-BONosecurity= Disables the secure runtime environment.
-BONoupdate = Disables checking for updates.
-BOHeadless = Disables download window, other UIs.
-BOStrict = Enables strict checking of JNLP file format.
-BOViewer = Shows the trusted certificate viewer.
-BXnofork = Do not create another JVM.
-BXclearcache= Clean the JNLP application cache.
-BOHelp = Print this message and exit.
-
-# Cache
-CAutoGen=automatically generated - do not edit
-CNotCacheable={0} is not a cacheable resource
-CDownloading=Downloading
-CComplete=Complete
-CChooseCache=Choose a cache directory...
-CChooseCacheInfo=Netx needs a location for storing cache files.
-CChooseCacheDir=Cache directory
-CCannotClearCache=Can not clear cache at this time
-CFakeCache=Cache is corrupt. Disabling.
-CFakedCache=Cache is corrupt and has been disabled. It is strongly recommended that you run 'javaws -Xclearcache' and rerun your application as soon as possible.
-CStillCorupted=Cache is still corrupt, clearing it.
-CCleaningUnsuccessful=Unable to clear cache due to running javaws instance. Please try to shut down all instances of javaws, run 'javaws -Xclearcache', and rerun your jnlp file
-CClearedReloading=Cache cleared, re-loading.
-CReloadRestarting=Cache re-loaded and application re-starting. It is strongly recommended that you run 'javaws -Xclearcache' and re-run your application as soon as possible.
-CStillBroken=Unable to fix corrupt cache. Please shutdown all javaws instances, run 'javaws -Xclearcache', and re-start your application.
-
-# Security
-SFileReadAccess=The application has requested read access to {0}. Do you want to allow this action?
-SFileWriteAccess=The application has requested write access to {0}. Do you want to allow this action?
-SDesktopShortcut=The application has requested permission to create a desktop launcher. Do you want to allow this action?
-SSigUnverified=The application's digital signature cannot be verified. Do you want to run the application?
-SSigVerified=The application's digital signature has been verified. Do you want to run the application?
-SSignatureError=The application's digital signature has an error. Do you want to run the application?
-SUntrustedSource=The digital signature could not be verified by a trusted source. Only run if you trust the origin of the application.
-SWarnFullPermissionsIgnorePolicy=The code executed will be given full permissions, ignoring any java policies you may have.
-STrustedSource=The digital signature has been validated by a trusted source.
-SClipboardReadAccess=The application has requested read-only access to the system clipboard. Do you want to allow this action?
-SClipboardWriteAccess=The application has requested write-only access to the system clipboard. Do you want to allow this action?
-SPrinterAccess=The application has requested printer access. Do you want to allow this action?
-SNetworkAccess=The application has requested permission to establish connections to {0}. Do you want to allow this action?
-SNoAssociatedCertificate=
+# Default (English) UI messages for netx
+# L=Launcher, B=Boot, P=Parser, C=cache S=security
+#
+# General
+NullParameter=Null parameter
+ButAllow=Allow
+ButBrowse=Browse...
+ButCancel=\ Cancel\
+ButClose=Close
+ButCopy=Copy to Clipboard
+ButMoreInformation=More Information...
+ButOk=OK
+ButProceed=Proceed
+ButRun=Run
+ButApply=Apply
+ButDone=Done
+ButShowDetails=Show Details
+ButHideDetails=Hide Details
+
+AFileOnTheMachine=a file on the machine
+AlwaysAllowAction=Always allow this action
+Usage=Usage:
+Error=Error
+
+Continue=Do you want to continue?
+Field=Field
+From=From
+Name=Name
+Password=Password:
+Publisher=Publisher
+Unknown=
+Username=Username:
+Value=Value
+Version=Version
+
+# LS - Severity
+LSMinor=Minor
+LSFatal=Fatal
+
+# LC - Category
+LCSystem=System Error
+LCExternalLaunch=External Launch Error
+LCFileFormat=File Format Error
+LCReadError=Read Error
+LCClient=Application Error
+LCLaunching=Launch Error
+LCNotSupported=Unsupported Feature
+LCInit=Initialization Error
+
+LAllThreadGroup=All JNLP applications
+LNullUpdatePolicy=Update policy cannot be null.
+
+LThreadInterrupted=Thread interrupted while waiting for file to launch.
+LThreadInterruptedInfo=
+LCouldNotLaunch=Could not launch JNLP file.
+LCouldNotLaunchInfo=
+LCantRead=Could not read or parse the JNLP file.
+LCantReadInfo=
+LNullLocation=Could not determine .jnlp file location.
+LNullLocationInfo=An attempt was made to launch a JNLP file in another JVM, but the file could not be located. In order to launch in an external JVM, the runtime must be able to locate the .jnlp file either in the local filesystem or on a server.
+LNetxJarMissing=Could not determine location of netx.jar.
+LNetxJarMissingInfo=An attempt was made to lauch a JNLP file in another JVM, but the netx.jar could not be located. In order to launch in an external JVM, the runtime must be able to locate the netx.jar file.
+LNotToSpec=JNLP file not strictly to spec.
+LNotToSpecInfo=The JNLP file contains data that is prohibited by the JNLP specification. The runtime can attempt to ignore the invalid information and continue launching the file.
+LNotApplication=Not an application file.
+LNotApplicationInfo=An attempt was made to load a non-application file as an application.
+LNotApplet=Not an applet file.
+LNotAppletInfo=An attempt was made to load a non-applet file as an applet.
+LNoInstallers=Installers not supported.
+LNoInstallersInfo=JNLP installer files are not yet supported.
+LInitApplet=Could not initialize applet.
+LInitAppletInfo=
+LInitApplication=Could not initialize application.
+LInitApplicationInfo=
+LNotLaunchable=Not a launchable JNLP file.
+LNotLaunchableInfo=File must be a JNLP application, applet, or installer type.
+LCantDetermineMainClass=Unknown Main-Class.
+LCantDetermineMainClassInfo=Could not determine the main class for this application.
+LUnsignedJarWithSecurity=Cannot grant permissions to unsigned jars.
+LUnsignedJarWithSecurityInfo=Application requested security permissions, but jars are not signed.
+LSignedAppJarUsingUnsignedJar=Signed application using unsigned jars.
+LSignedAppJarUsingUnsignedJarInfo=The main application jar is signed, but some of the jars it is using aren't.
+LSignedJNLPFileDidNotMatch=The signed JNLP file did not match the launching JNLP file.
+LNoSecInstance=Error: No security instance for {0}. The application may have trouble continuing
+LCertFoundIn={0} found in cacerts ({1})
+
+JNotApplet=File is not an applet.
+JNotApplication=File is not an application.
+JNotComponent=File is not a component.
+JNotInstaller=File is not an installer.
+JInvalidExtensionDescriptor=Extension does not refer to a component or installer (name={1}, location={2}).
+
+LNotVerified=Jars not verified.
+LCancelOnUserRequest=Canceled on user request.
+LFatalVerification=A fatal error occurred while trying to verify jars.
+LFatalVerificationInfo=
+
+LNotVerifiedDialog=Not all jars could be verified.
+LAskToContinue=Would you still like to continue running this application?
+
+# Parser
+PInvalidRoot=Root node is not a jnlp node
+PNoResources=No resources section defined
+PUntrustedNative=nativelib element cannot be specified unless a trusted environment is requested.
+PExtensionHasJ2SE=j2se element cannot be specified in a component extension file.
+PInnerJ2SE=j2se element cannot be specified within a j2se element.
+PTwoMains=Duplicate main JAR defined in a resources element (there can be only one)
+PNativeHasMain=Cannot specify main attribute on native JARs.
+PNoInfoElement=No information section defined
+PTwoDescriptions=Duplicate description of kind {0}
+PSharing=Element "sharing-allowed" is illegal in a standard JNLP file
+PTwoSecurity=Only one security element allowed per JNLPFile.
+PEmptySecurity=Security element specified but does not contain a permissions element.
+PTwoDescriptors=Only one application descriptor element allowed per JNLPFile.
+PTwoDesktops=Only one desktop element allowed
+PTwoMenus=Only one menu element allowed
+PTwoTitles=Only one title element allowed
+PTwoIcons=Only one icon element allowed
+PTwoUpdates=Only one update element is allowed
+PUnknownApplet=Unknown Applet
+PBadWidth=Invalid applet width.
+PBadHeight=Invalid applet height.
+PUrlNotInCodebase=Relative URL does not specify a subdirectory of the codebase. (node={0}, href={1}, base={2})
+PBadRelativeUrl=Invalid relative URL (node={0}, href={1}, base={2})
+PBadNonrelativeUrl=Invalid non-relative URL (node={0}, href={0}).
+PNeedsAttribute=The {0} element must specify a {1} attribute.
+PBadXML=Invalid XML document syntax.
+PBadHeapSize=Invalid value for heap size ({0})
+
+# Runtime
+BLaunchAbout=Launching about window...
+BNeedsFile=Must specify a .jnlp file
+RNoAboutJnlp=Unable to find about.jnlp
+BFileLoc=JNLP file location
+BBadProp=Incorrect property format {0} (should be key=value)
+BBadParam=Incorrect parameter format {0} (should be name=value)
+BNoDir=Directory {0} does not exist.
+RNoResource=Missing Resource: {0}
+RShutdown=This exception to prevent shutdown of JVM, but the process has been terminated.
+RExitTaken=Exit class already set and caller is not exit class.
+RCantReplaceSM=Changing the SecurityManager is not allowed.
+RCantCreateFile=Cant create file {0}
+RCantDeleteFile=Cant delete file {0}
+RRemoveRPermFailed=Removing read permission on file {0} failed
+RRemoveWPermFailed=Removing write permissions on file {0} failed
+RRemoveXPermFailed=Removing execute permissions on file {0} failed
+RGetRPermFailed=Acquiring read permissions on file {0} failed
+RGetWPermFailed=Acquiring write permissions on file {0} failed
+RGetXPermFailed=Acquiring execute permissions on file {0} failed
+RCantCreateDir=Cant create directory {0}
+RCantRename=Cant rename {0} to {1}
+RDenyStopped=Stopped applications have no permissions.
+RExitNoApp=Can not exit the JVM because the current application cannot be determined.
+RNoLockDir=Unable to create locks directory ({0})
+RNestedJarExtration=Unable to extract nested jar.
+RUnexpected=Unexpected {0} at {1}
+RConfigurationError=Fatal error while reading the configuration
+RConfigurationFatal=ERROR: a fatal error has occurred while loading configuration. Perhaps a global configuration was required but could not be found
+RPRoxyPacNotSupported=Using Proxy Auto Config (PAC) files is not supported.
+RProxyFirefoxNotFound=Unable to use Firefox's proxy settings. Using "DIRECT" as proxy type.
+RProxyFirefoxOptionNotImplemented=Browser proxy option "{0}" ({1}) not supported yet.
+RBrowserLocationPromptTitle=Browser Location
+RBrowserLocationPromptMessage=Specify Browser Location
+RBrowserLocationPromptMessageWithReason=Specify Browser Location (the browser command "{0}" is invalid).
+
+# Boot options, message should be shorter than this ---------------->
+BOUsage=javaws [-run-options]
+BOUsage2=javaws [-control-options]
+BOJnlp = Location of JNLP file to launch (url or file).
+BOArg = Adds an application argument before launching.
+BOParam = Adds an applet parameter before launching.
+BOProperty = Sets a system property before launching.
+BOUpdate = Update check if seconds since last checked.
+BOLicense = Display the GPL license and exit.
+BOVerbose = Enable verbose output.
+BOAbout = Shows a sample application.
+BONosecurity= Disables the secure runtime environment.
+BONoupdate = Disables checking for updates.
+BOHeadless = Disables download window, other UIs.
+BOStrict = Enables strict checking of JNLP file format.
+BOViewer = Shows the trusted certificate viewer.
+BXnofork = Do not create another JVM.
+BXclearcache= Clean the JNLP application cache.
+BOHelp = Print this message and exit.
+
+# Cache
+CAutoGen=automatically generated - do not edit
+CNotCacheable={0} is not a cacheable resource
+CDownloading=Downloading
+CComplete=Complete
+CChooseCache=Choose a cache directory...
+CChooseCacheInfo=Netx needs a location for storing cache files.
+CChooseCacheDir=Cache directory
+CCannotClearCache=Can not clear cache at this time
+CFakeCache=Cache is corrupt. Disabling.
+CFakedCache=Cache is corrupt and has been disabled. It is strongly recommended that you run 'javaws -Xclearcache' and rerun your application as soon as possible.
+CStillCorupted=Cache is still corrupt, clearing it.
+CCleaningUnsuccessful=Unable to clear cache due to running javaws instance. Please try to shut down all instances of javaws, run 'javaws -Xclearcache', and rerun your jnlp file
+CClearedReloading=Cache cleared, re-loading.
+CReloadRestarting=Cache re-loaded and application re-starting. It is strongly recommended that you run 'javaws -Xclearcache' and re-run your application as soon as possible.
+CStillBroken=Unable to fix corrupt cache. Please shutdown all javaws instances, run 'javaws -Xclearcache', and re-start your application.
+
+# Security
+SFileReadAccess=The application has requested read access to {0}. Do you want to allow this action?
+SFileWriteAccess=The application has requested write access to {0}. Do you want to allow this action?
+SDesktopShortcut=The application has requested permission to create a desktop launcher. Do you want to allow this action?
+SSigUnverified=The application's digital signature cannot be verified. Do you want to run the application?
+SSigVerified=The application's digital signature has been verified. Do you want to run the application?
+SSignatureError=The application's digital signature has an error. Do you want to run the application?
+SUntrustedSource=The digital signature could not be verified by a trusted source. Only run if you trust the origin of the application.
+SWarnFullPermissionsIgnorePolicy=The code executed will be given full permissions, ignoring any java policies you may have.
+STrustedSource=The digital signature has been validated by a trusted source.
+SClipboardReadAccess=The application has requested read-only access to the system clipboard. Do you want to allow this action?
+SClipboardWriteAccess=The application has requested write-only access to the system clipboard. Do you want to allow this action?
+SPrinterAccess=The application has requested printer access. Do you want to allow this action?
+SNetworkAccess=The application has requested permission to establish connections to {0}. Do you want to allow this action?
+SNoAssociatedCertificate=
SUnverified=(unverified)
-SAlwaysTrustPublisher=Always trust content from this publisher
-SHttpsUnverified=The website's HTTPS certificate cannot be verified.
-SNotAllSignedSummary=Only parts of this application code are signed.
-SNotAllSignedDetail=This application contains both signed and unsigned code. While signed code is safe if you trust the provider, unsigned code may imply code outside of the trusted provider's control.
-SNotAllSignedQuestion=Do you wish to proceed and run this application anyway?
-SAuthenticationPrompt=The {0} server at {1} is requesting authentication. It says "{2}"
-SJNLPFileIsNotSigned=This application contains a digital signature in which the launching JNLP file is not signed.
-
-# Security - used for the More Information dialog
-SBadKeyUsage=Resources contain entries whose signer certificate's KeyUsage extension doesn't allow code signing.
-SBadExtendedKeyUsage=Resources contain entries whose signer certificate's ExtendedKeyUsage extension doesn't allow code signing.
-SBadNetscapeCertType=Resources contain entries whose signer certificate's NetscapeCertType extension doesn't allow code signing.
-SHasUnsignedEntry=Resources contain unsigned entries which have not been integrity-checked.
-SHasExpiredCert=The digital signature has expired.
-SHasExpiringCert=Resources contain entries whose signer certificate will expire within six months.
-SNotYetValidCert=Resources contain entries whose signer certificate is not yet valid.
-SUntrustedCertificate=The digital signature was generated with an untrusted certificate.
-STrustedCertificate=The digital signature was generated with a trusted certificate.
-SCNMisMatch=The expected hostname for this certificate is: "{0}" The address being connected to is: "{1}"
-SRunWithoutRestrictions=This application will be run without the security restrictions normally provided by java.
-SCertificateDetails=Certificate Details
-
-# Security - certificate information
-SIssuer=Issuer
-SSerial=Serial
-SMD5Fingerprint=MD5 Fingerprint
-SSHA1Fingerprint=SHA1 Fingerprint
-SSignature=Signature
-SSignatureAlgorithm=Signature Algorithm
-SSubject=Subject
-SValidity=Validity
-
-# Certificate Viewer
-CVCertificateViewer=Certificates
-CVCertificateType=Certificate Type
-CVDetails=Details
-CVExport=Export
-CVExportPasswordMessage=Enter password to protect key file:
-CVImport=Import
-CVImportPasswordMessage=Enter password to access file:
-CVIssuedBy=Issued By
-CVIssuedTo=Issued To
-CVPasswordTitle=Authentication Required
-CVRemove=Remove
-CVRemoveConfirmMessage=Are you sure you want to remove the selected certificate?
-CVRemoveConfirmTitle=Confirmation - Remove Certificate?
-CVUser=User
-CVSystem=System
-
From dbhole at icedtea.classpath.org Mon Jan 7 08:56:00 2013
From: dbhole at icedtea.classpath.org (dbhole at icedtea.classpath.org)
Date: Mon, 07 Jan 2013 16:56:00 +0000
Subject: /hg/release/icedtea-web-1.3: Converted Messages.properties to Un...
Message-ID:
changeset b96993bf1061 in /hg/release/icedtea-web-1.3
details: http://icedtea.classpath.org/hg/release/icedtea-web-1.3?cmd=changeset;node=b96993bf1061
author: Deepak Bhole
date: Mon Jan 07 11:47:42 2013 -0500
Converted Messages.properties to Unix format
diffstat:
ChangeLog | 5 +
netx/net/sourceforge/jnlp/resources/Messages.properties | 886 ++++++++--------
2 files changed, 448 insertions(+), 443 deletions(-)
diffs (truncated from 902 to 500 lines):
diff -r b8bd24f0aad1 -r b96993bf1061 ChangeLog
--- a/ChangeLog Wed Nov 07 13:06:52 2012 -0500
+++ b/ChangeLog Mon Jan 07 11:47:42 2013 -0500
@@ -1,3 +1,8 @@
+2013-01-07 Deepak Bhole
+
+ * netx/net/sourceforge/jnlp/resources/Messages.properties: Converted to
+ Unix format.
+
2012-11-02 Jiri Vanek
Renamed reproducers-related variables and targets
diff -r b8bd24f0aad1 -r b96993bf1061 netx/net/sourceforge/jnlp/resources/Messages.properties
--- a/netx/net/sourceforge/jnlp/resources/Messages.properties Wed Nov 07 13:06:52 2012 -0500
+++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Mon Jan 07 11:47:42 2013 -0500
@@ -1,443 +1,443 @@
-# Default (English) UI messages for netx
-# L=Launcher, B=Boot, P=Parser, C=cache S=security
-#
-# General
-NullParameter=Null parameter
-ButAllow=Allow
-ButBrowse=Browse...
-ButCancel=\ Cancel\
-ButClose=Close
-ButCopy=Copy to Clipboard
-ButMoreInformation=More Information...
-ButOk=OK
-ButProceed=Proceed
-ButRun=Run
-ButApply=Apply
-ButDone=Done
-ButShowDetails=Show Details
-ButHideDetails=Hide Details
-
-AFileOnTheMachine=a file on the machine
-AlwaysAllowAction=Always allow this action
-Usage=Usage:
-Error=Error
-
-Continue=Do you want to continue?
-Field=Field
-From=From
-Name=Name
-Password=Password:
-Publisher=Publisher
-Unknown=
-Username=Username:
-Value=Value
-Version=Version
-
-# LS - Severity
-LSMinor=Minor
-LSFatal=Fatal
-
-# LC - Category
-LCSystem=System Error
-LCExternalLaunch=External Launch Error
-LCFileFormat=File Format Error
-LCReadError=Read Error
-LCClient=Application Error
-LCLaunching=Launch Error
-LCNotSupported=Unsupported Feature
-LCInit=Initialization Error
-
-LAllThreadGroup=All JNLP applications
-LNullUpdatePolicy=Update policy cannot be null.
-
-LThreadInterrupted=Thread interrupted while waiting for file to launch.
-LThreadInterruptedInfo=
-LCouldNotLaunch=Could not launch JNLP file.
-LCouldNotLaunchInfo=
-LCantRead=Could not read or parse the JNLP file.
-LCantReadInfo=
-LNullLocation=Could not determine .jnlp file location.
-LNullLocationInfo=An attempt was made to launch a JNLP file in another JVM, but the file could not be located. In order to launch in an external JVM, the runtime must be able to locate the .jnlp file either in the local filesystem or on a server.
-LNetxJarMissing=Could not determine location of netx.jar.
-LNetxJarMissingInfo=An attempt was made to lauch a JNLP file in another JVM, but the netx.jar could not be located. In order to launch in an external JVM, the runtime must be able to locate the netx.jar file.
-LNotToSpec=JNLP file not strictly to spec.
-LNotToSpecInfo=The JNLP file contains data that is prohibited by the JNLP specification. The runtime can attempt to ignore the invalid information and continue launching the file.
-LNotApplication=Not an application file.
-LNotApplicationInfo=An attempt was made to load a non-application file as an application.
-LNotApplet=Not an applet file.
-LNotAppletInfo=An attempt was made to load a non-applet file as an applet.
-LNoInstallers=Installers not supported.
-LNoInstallersInfo=JNLP installer files are not yet supported.
-LInitApplet=Could not initialize applet.
-LInitAppletInfo=
-LInitApplication=Could not initialize application.
-LInitApplicationInfo=
-LNotLaunchable=Not a launchable JNLP file.
-LNotLaunchableInfo=File must be a JNLP application, applet, or installer type.
-LCantDetermineMainClass=Unknown Main-Class.
-LCantDetermineMainClassInfo=Could not determine the main class for this application.
-LUnsignedJarWithSecurity=Cannot grant permissions to unsigned jars.
-LUnsignedJarWithSecurityInfo=Application requested security permissions, but jars are not signed.
-LSignedAppJarUsingUnsignedJar=Signed application using unsigned jars.
-LSignedAppJarUsingUnsignedJarInfo=The main application jar is signed, but some of the jars it is using aren't.
-LSignedJNLPFileDidNotMatch=The signed JNLP file did not match the launching JNLP file.
-LNoSecInstance=Error: No security instance for {0}. The application may have trouble continuing
-LCertFoundIn={0} found in cacerts ({1})
-LSingleInstanceExists=Another instance of this applet already exists and only one may be run at the same time.
-
-JNotApplet=File is not an applet.
-JNotApplication=File is not an application.
-JNotComponent=File is not a component.
-JNotInstaller=File is not an installer.
-JInvalidExtensionDescriptor=Extension does not refer to a component or installer (name={1}, location={2}).
-
-LNotVerified=Jars not verified.
-LCancelOnUserRequest=Canceled on user request.
-LFatalVerification=A fatal error occurred while trying to verify jars.
-LFatalVerificationInfo=
-
-LNotVerifiedDialog=Not all jars could be verified.
-LAskToContinue=Would you still like to continue running this application?
-
-# Parser
-PInvalidRoot=Root node is not a jnlp node
-PNoResources=No resources section defined
-PUntrustedNative=nativelib element cannot be specified unless a trusted environment is requested.
-PExtensionHasJ2SE=j2se element cannot be specified in a component extension file.
-PInnerJ2SE=j2se element cannot be specified within a j2se element.
-PTwoMains=Duplicate main JAR defined in a resources element (there can be only one)
-PNativeHasMain=Cannot specify main attribute on native JARs.
-PNoInfoElement=No information section defined.
-PMissingTitle=title
-PMissingVendor=vendor
-PMissingElement=The {0} section has not been defined for your locale nor does a default value exist in the JNLP file.
-PTwoDescriptions=Duplicate description of kind {0}
-PSharing=Element "sharing-allowed" is illegal in a standard JNLP file
-PTwoSecurity=Only one security element allowed per JNLPFile.
-PEmptySecurity=Security element specified but does not contain a permissions element.
-PTwoDescriptors=Only one application descriptor element allowed per JNLPFile.
-PTwoDesktops=Only one desktop element allowed
-PTwoMenus=Only one menu element allowed
-PTwoTitles=Only one title element allowed
-PTwoIcons=Only one icon element allowed
-PTwoUpdates=Only one update element is allowed
-PUnknownApplet=Unknown Applet
-PBadWidth=Invalid applet width.
-PBadHeight=Invalid applet height.
-PUrlNotInCodebase=Relative URL does not specify a subdirectory of the codebase. (node={0}, href={1}, base={2})
-PBadRelativeUrl=Invalid relative URL (node={0}, href={1}, base={2})
-PBadNonrelativeUrl=Invalid non-relative URL (node={0}, href={1})
-PNeedsAttribute=The {0} element must specify a {1} attribute.
-PBadXML=Invalid XML document syntax.
-PBadHeapSize=Invalid value for heap size ({0})
-
-# Runtime
-BLaunchAbout=Launching about window...
-BNeedsFile=Must specify a .jnlp file
-RNoAboutJnlp=Unable to find about.jnlp
-BFileLoc=JNLP file location
-BBadProp=Incorrect property format {0} (should be key=value)
-BBadParam=Incorrect parameter format {0} (should be name=value)
-BNoDir=Directory {0} does not exist.
-RNoResource=Missing Resource: {0}
-RShutdown=This exception to prevent shutdown of JVM, but the process has been terminated.
-RExitTaken=Exit class already set and caller is not exit class.
-RCantReplaceSM=Changing the SecurityManager is not allowed.
-RCantCreateFile=Cant create file {0}
-RCantDeleteFile=Cant delete file {0}
-RRemoveRPermFailed=Removing read permission on file {0} failed
-RRemoveWPermFailed=Removing write permissions on file {0} failed
-RRemoveXPermFailed=Removing execute permissions on file {0} failed
-RGetRPermFailed=Acquiring read permissions on file {0} failed
-RGetWPermFailed=Acquiring write permissions on file {0} failed
-RGetXPermFailed=Acquiring execute permissions on file {0} failed
-RCantCreateDir=Cant create directory {0}
-RCantRename=Cant rename {0} to {1}
-RDenyStopped=Stopped applications have no permissions.
-RExitNoApp=Can not exit the JVM because the current application cannot be determined.
-RNoLockDir=Unable to create locks directory ({0})
-RNestedJarExtration=Unable to extract nested jar.
-RUnexpected=Unexpected {0} at {1}
-RConfigurationError=Fatal error while reading the configuration
-RConfigurationFatal=ERROR: a fatal error has occurred while loading configuration. Perhaps a global configuration was required but could not be found
-RPRoxyPacNotSupported=Using Proxy Auto Config (PAC) files is not supported.
-RProxyFirefoxNotFound=Unable to use Firefox's proxy settings. Using "DIRECT" as proxy type.
-RProxyFirefoxOptionNotImplemented=Browser proxy option "{0}" ({1}) not supported yet.
-RBrowserLocationPromptTitle=Browser Location
-RBrowserLocationPromptMessage=Specify Browser Location
-RBrowserLocationPromptMessageWithReason=Specify Browser Location (the browser command "{0}" is invalid).
-
-# Boot options, message should be shorter than this ---------------->
-BOUsage=javaws [-run-options]
-BOUsage2=javaws [-control-options]
-BOJnlp = Location of JNLP file to launch (url or file).
-BOArg = Adds an application argument before launching.
-BOParam = Adds an applet parameter before launching.
-BOProperty = Sets a system property before launching.
-BOUpdate = Update check if seconds since last checked.
-BOLicense = Display the GPL license and exit.
-BOVerbose = Enable verbose output.
-BOAbout = Shows a sample application.
-BONosecurity= Disables the secure runtime environment.
-BONoupdate = Disables checking for updates.
-BOHeadless = Disables download window, other UIs.
-BOStrict = Enables strict checking of JNLP file format.
-BOViewer = Shows the trusted certificate viewer.
-BXnofork = Do not create another JVM.
-BXclearcache= Clean the JNLP application cache.
-BOHelp = Print this message and exit.
-
-# Cache
-CAutoGen=automatically generated - do not edit
-CNotCacheable={0} is not a cacheable resource
-CDownloading=Downloading
-CComplete=Complete
-CChooseCache=Choose a cache directory...
-CChooseCacheInfo=Netx needs a location for storing cache files.
-CChooseCacheDir=Cache directory
-CCannotClearCache=Can not clear cache at this time
-CFakeCache=Cache is corrupt. Fixing.
-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.
-
-# Security
-SFileReadAccess=The application has requested read access to {0}. Do you want to allow this action?
-SFileWriteAccess=The application has requested write access to {0}. Do you want to allow this action?
-SDesktopShortcut=The application has requested permission to create a desktop launcher. Do you want to allow this action?
-SSigUnverified=The application's digital signature cannot be verified. Do you want to run the application?
-SSigVerified=The application's digital signature has been verified. Do you want to run the application?
-SSignatureError=The application's digital signature has an error. Do you want to run the application?
-SUntrustedSource=The digital signature could not be verified by a trusted source. Only run if you trust the origin of the application.
-SWarnFullPermissionsIgnorePolicy=The code executed will be given full permissions, ignoring any java policies you may have.
-STrustedSource=The digital signature has been validated by a trusted source.
-SClipboardReadAccess=The application has requested read-only access to the system clipboard. Do you want to allow this action?
-SClipboardWriteAccess=The application has requested write-only access to the system clipboard. Do you want to allow this action?
-SPrinterAccess=The application has requested printer access. Do you want to allow this action?
-SNetworkAccess=The application has requested permission to establish connections to {0}. Do you want to allow this action?
-SNoAssociatedCertificate=
-SUnverified=(unverified)
-SAlwaysTrustPublisher=Always trust content from this publisher
-SHttpsUnverified=The website's HTTPS certificate cannot be verified.
-SNotAllSignedSummary=Only parts of this application code are signed.
-SNotAllSignedDetail=This application contains both signed and unsigned code. While signed code is safe if you trust the provider, unsigned code may imply code outside of the trusted provider's control.
-SNotAllSignedQuestion=Do you wish to proceed and run this application anyway?
-SAuthenticationPrompt=The {0} server at {1} is requesting authentication. It says "{2}"
-SJNLPFileIsNotSigned=This application contains a digital signature in which the launching JNLP file is not signed.
-
-# Security - used for the More Information dialog
-SBadKeyUsage=Resources contain entries whose signer certificate's KeyUsage extension doesn't allow code signing.
-SBadExtendedKeyUsage=Resources contain entries whose signer certificate's ExtendedKeyUsage extension doesn't allow code signing.
-SBadNetscapeCertType=Resources contain entries whose signer certificate's NetscapeCertType extension doesn't allow code signing.
-SHasUnsignedEntry=Resources contain unsigned entries which have not been integrity-checked.
-SHasExpiredCert=The digital signature has expired.
-SHasExpiringCert=Resources contain entries whose signer certificate will expire within six months.
-SNotYetValidCert=Resources contain entries whose signer certificate is not yet valid.
-SUntrustedCertificate=The digital signature was generated with an untrusted certificate.
-STrustedCertificate=The digital signature was generated with a trusted certificate.
-SCNMisMatch=The expected hostname for this certificate is: "{0}" The address being connected to is: "{1}"
-SRunWithoutRestrictions=This application will be run without the security restrictions normally provided by java.
-SCertificateDetails=Certificate Details
-
-# Security - certificate information
-SIssuer=Issuer
-SSerial=Serial
-SMD5Fingerprint=MD5 Fingerprint
-SSHA1Fingerprint=SHA1 Fingerprint
-SSignature=Signature
-SSignatureAlgorithm=Signature Algorithm
-SSubject=Subject
-SValidity=Validity
-
-# Certificate Viewer
-CVCertificateViewer=Certificates
-CVCertificateType=Certificate Type
-CVDetails=Details
-CVExport=Export
-CVExportPasswordMessage=Enter password to protect key file:
-CVImport=Import
-CVImportPasswordMessage=Enter password to access file:
-CVIssuedBy=Issued By
-CVIssuedTo=Issued To
-CVPasswordTitle=Authentication Required
-CVRemove=Remove
-CVRemoveConfirmMessage=Are you sure you want to remove the selected certificate?
-CVRemoveConfirmTitle=Confirmation - Remove Certificate?
-CVUser=User
-CVSystem=System
-
-#KeyStores: see KeyStores.java
-KS=KeyStore
-KSCerts=Trusted Certificates
-KSJsseCerts=Trusted JSSE Certificates
-KSCaCerts=Trusted Root CA Certificates
-KSJsseCaCerts=Trusted JSSE Root CA Certificates,
-KSClientCerts=Client Authentication Certificates
-
-# Deployment Configuration messages
-DCIncorrectValue=Property "{0}" has incorrect value "{1}". Possible values {2}.
-DCInternal=Internal error: {0}
-DCSourceInternal=
-DCUnknownSettingWithName=Property "{0}" is unknown.
-
-# Value Validator messages. Messages should follow "Possible values ..."
-VVPossibleValues=Possible values {0}
-VVPossibleBooleanValues=are {0} or {1}
-VVPossibleFileValues=include the absolute location of a file - it must begin with a /
-VVPossibleRangedIntegerValues=are in range {0} to {1} (inclusive)
-VVPossibleUrlValues=include any valid url (eg http://icedtea.classpath.org/hg/)
-
-# Control Panel - Main
-CPMainDescriptionShort=Configure IcedTea-Web
-CPMainDescriptionLong=Configure how the browser plugin (IcedTeaNPPlugin) and javaws (NetX) work
-
-# Control Panel - Tab Descriptions
-CPAboutDescription=View version information about Icedtea Control Panel.
-CPNetworkSettingsDescription=Configure network settings, including how IcedTea-Web connects to the internet and whether to use any proxies.
-CPTempInternetFilesDescription=Java stores application data for faster execution the next time you run it.
-CPJRESettingsDescription=View and manage Java Runtime Environment versions and settings for Java applications and applets.
-CPCertificatesDescription=Use certificates to positively identify yourself, certifications, authorities, and plublishers.
-CPSecurityDescription=Use this to configure security settings.
-CPDebuggingDescription=Enable options here to help with debugging
-CPDesktopIntegrationDescription=Set whether or not to allow creation of desktop shortcut.
-
-# Control Panel - Buttons
-CPButAbout=About...
-CPButNetworkSettings=Network Settings...
-CPButSettings=Settings...
-CPButView=View...
-CPButCertificates=Certificates...
-
-# Control Panel - Headers
-CPHead=IcedTea Web Control Panel
-CPHeadAbout=About
-CPHeadNetworkSettings=Network Proxy Settings
-CPHeadTempInternetFiles=Temporary Internet Files
-CPHeadJRESettings=Java Runtime Environment Settings
-CPHeadCertificates=Certificates
-CPHeadDebugging=Debugging Settings
-CPHeadDesktopIntegration=Desktop Integrations
-CPHeadSecurity=Security Settings
-
-# Control Panel - Tabs
-CPTabAbout=About IcedTea-Web
-CPTabCache=Cache
-CPTabCertificate=Certificates
-CPTabClassLoader=Class Loaders
-CPTabDebugging=Debugging
-CPTabDesktopIntegration=Desktop Integration
-CPTabNetwork=Network
-CPTabRuntimes=Runtimes
-CPTabSecurity=Security
-
-# Control Panel - AboutPanel
-CPAboutInfo=This is the control panel for setting deployments.properties. Not all options will take effect until implemented. The use of multiple JREs is currently unsupported.
-
-# Control Panel - AdvancedProxySettings
-APSDialogTitle=Network Settings
-APSServersPanel=Servers
-APSProxyTypeLabel=Type
-APSProxyAddressLabel=Proxy Address
-APSProxyPortLabel=Proxy Port
-APSLabelHTTP=HTTP
-APSLabelSecure=Secure
-APSLabelFTP=FTP
-APSLabelSocks=Socks
-APSSameProxyForAllProtocols=Use the same proxy server for all protocols.
-APSExceptionsLabel=Exceptions
-APSExceptionsDescription=Do not use proxy server for addresses beginning with
-APSExceptionInstruction=Separate each entry with a semicolon.
-
-# Control Panel - DebugginPanel
-DPEnableTracing=Enable tracing
-DPEnableLogging=Enable logging
-DPDisable=Disable
-DPHide=Hide on startup
-DPShow=Show on startup
-DPJavaConsole=Java Console
-
-# Control Panel - DesktopShortcutPanel
-DSPNeverCreate=Never create
-DSPAlwaysAllow=Always allow
-DSPAskUser=Ask user
-DSPAskIfHinted=Ask if hinted
-DSPAlwaysIfHinted=Always if hinted
-
-# Control Panel - NetworkSettingsPanel
-NSDescription-1=Unknown Setting.
-NSDescription0=Use direct connection.
-NSDescription1=Override browser proxy settings.
-NSDescription2=Use automatic proxy configuration script at the specified location.
-NSDescription3=Use proxy settings from your default browser to connect to the internet.
-NSAddress=Address
-NSPort=Port
-NSAdvanced=Advanced
-NSBypassLocal=Bypass proxy server for local addresses
-NSDirectConnection=Direct connection
-NSManualProxy=Manual proxy server
-NSAutoProxy=Automatic proxy configuration script
-NSBrowserProxy=Use browser settings
-NSScriptLocation=Script location
-
-# Control Panel - SecurityGeneralPanel
-SGPAllowUserGrantSigned=Allow users to grant permissions to signed content
-SGPAllowUserGrantUntrust=Allow users to grant permissions to content from an untrusted authority
-SGPUseBrowserKeystore=Use certificates and keys in browser keystore (Unsupported)
-SGPUsePersonalCertOneMatch=Use personal certificate automatically if only one matches server request (Unsupported)
-SGPWarnCertHostMismatch=Warn if site certificate does not match hostname
-SGPShowValid=Show site certificate even if it is valid (Unsupported)
-SGPShowSandboxWarning=Show sandbox warning banner
-SGPAllowUserAcceptJNLPSecurityRequests=Allow user to accept JNLP security requests
-SGPCheckCertRevocationList=Check certificates for revocation using Certificate Revocation Lists (CRLs) (Unsupported)
-SGPEnableOnlineCertValidate=Enable online certificate validation (Unsupported)
-SGPEnableTrustedPublisherList=Enable list of trusted publishers (Unsupported)
-SGPEnableBlacklistRevocation=Enable blacklist revocation check (Unsupported)
-SGPEnableCachingPassword=Enable caching password for authentication (Unsupported)
-SGPUseSSL2=Use SSL 2.0 compatible ClientHello format (Unsupported)
-SGPUseSSL3=Use SSL 3.0 (Unsupported)
-SGPUseTLS1=Use TLS 1.0 (Unsupported)
-
-# Control Panel - TemporaryInternetFilesPanel
-TIFPEnableCache=Keep temporary files on my computer
-TIFPLocation=Location
-TIFPLocationLabel=Select the location where temporary files are kept
-TIFPChange=Change
-TIFPDiskSpace=Disk space
-TIFPCompressionLevel=Select the compression level for JAR files
-TIFPNone=None
-TIFPMax=Max
-TIFPCacheSize=Set the amount of disk space for storing temporary files
-TIFPDeleteFiles=Delete files
-TIFPViewFiles=View files...
-
-# Control Panel - Cache Viewer
-CVCPDialogTitle=Cache Viewer
-CVCPButRefresh=Refresh
-CVCPButDelete=Delete
-CVCPColLastModified=Last Modified
-CVCPColSize=Size (Bytes)
-CVCPColDomain=Domain
-CVCPColType=Type
-CVCPColPath=Path
-CVCPColName=Name
-
-# Control Panel - Misc.
-CPJRESupport=IcedTea-Web currently does not support the use of multiple JREs.
-CPInvalidPort=Invalid port number given.\n[Valid port numbers are 1-65535]
-CPInvalidPortTitle=Error on input.
-
-# command line control panel
-CLNoInfo=No information avaiable (is this a valid option?).
-CLValue=Value: {0}
-CLValueSource=Source: {0}
-CLDescription=Description: {0}
-CLUnknownCommand=Unknown command {0}
-CLUnknownProperty=Unknown property-name "{0}"
-CLWarningUnknownProperty=WARNING: Unknown property name "{0}" - creating new property
-CLNoIssuesFound=No issues found.
-CLIncorrectValue=Property "{0}" has incorrect value "{1}". Possible values {2}.
-CLListDescription=Shows a list of all property names and values that are in use by IcedTea-Web
-CLGetDescription=Shows the value for property-name
-CLSetDescription=Sets the property-name to value if possible. The value is checked for being valid. If the administrator has locked the property, this will have no effect
-CLResetDescription=Resets the value for property-name to it\'s default value
-CLInfoDescription=Shows more information about the given property
-CLCheckDescription=Shows any properties that have been defined but are not recognized by IcedTea Web
-CLHelpDescription=The itweb-settings tool allows a user to modify, view and check configuration. \nTo use the GUI, do not pass any arguments. To use the CLI mode, pass in the approrpiate command and parameters. For help with a particular command, try: {0} command help
+# Default (English) UI messages for netx
+# L=Launcher, B=Boot, P=Parser, C=cache S=security
+#
+# General
+NullParameter=Null parameter
+ButAllow=Allow
+ButBrowse=Browse...
+ButCancel=\ Cancel\
+ButClose=Close
+ButCopy=Copy to Clipboard
+ButMoreInformation=More Information...
+ButOk=OK
+ButProceed=Proceed
+ButRun=Run
+ButApply=Apply
+ButDone=Done
+ButShowDetails=Show Details
+ButHideDetails=Hide Details
+
+AFileOnTheMachine=a file on the machine
+AlwaysAllowAction=Always allow this action
+Usage=Usage:
+Error=Error
+
+Continue=Do you want to continue?
+Field=Field
+From=From
+Name=Name
+Password=Password:
+Publisher=Publisher
+Unknown=
+Username=Username:
+Value=Value
+Version=Version
+
+# LS - Severity
+LSMinor=Minor
+LSFatal=Fatal
+
+# LC - Category
+LCSystem=System Error
From dbhole at icedtea.classpath.org Mon Jan 7 08:56:09 2013
From: dbhole at icedtea.classpath.org (dbhole at icedtea.classpath.org)
Date: Mon, 07 Jan 2013 16:56:09 +0000
Subject: /hg/icedtea-web: Converted Messages.properties to Unix format
Message-ID:
changeset 02981a272327 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=02981a272327
author: Deepak Bhole
date: Mon Jan 07 11:47:32 2013 -0500
Converted Messages.properties to Unix format
diffstat:
ChangeLog | 5 +
netx/net/sourceforge/jnlp/resources/Messages.properties | 950 ++++++++--------
2 files changed, 480 insertions(+), 475 deletions(-)
diffs (truncated from 966 to 500 lines):
diff -r e335e39c382b -r 02981a272327 ChangeLog
--- a/ChangeLog Fri Jan 04 12:32:15 2013 -0500
+++ b/ChangeLog Mon Jan 07 11:47:32 2013 -0500
@@ -1,3 +1,8 @@
+2013-01-07 Deepak Bhole
+
+ * netx/net/sourceforge/jnlp/resources/Messages.properties: Converted to
+ Unix format.
+
2013-01-04 Adam Domurad
* plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java:
diff -r e335e39c382b -r 02981a272327 netx/net/sourceforge/jnlp/resources/Messages.properties
--- a/netx/net/sourceforge/jnlp/resources/Messages.properties Fri Jan 04 12:32:15 2013 -0500
+++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Mon Jan 07 11:47:32 2013 -0500
@@ -1,475 +1,475 @@
-# Default (English) UI messages for netx
-# L=Launcher, B=Boot, P=Parser, C=cache S=security
-#
-# General
-NullParameter=Null parameter
-ButAllow=Allow
-ButBrowse=Browse...
-ButCancel=\ Cancel\
-ButClose=Close
-ButCopy=Copy to Clipboard
-ButMoreInformation=More Information...
-ButOk=OK
-ButProceed=Proceed
-ButRun=Run
-ButApply=Apply
-ButDone=Done
-ButShowDetails=Show Details
-ButHideDetails=Hide Details
-
-AFileOnTheMachine=a file on the machine
-AlwaysAllowAction=Always allow this action
-Usage=Usage:
-Error=Error
-
-Continue=Do you want to continue?
-Field=Field
-From=From
-Name=Name
-Password=Password:
-Publisher=Publisher
-Unknown=
-Username=Username:
-Value=Value
-Version=Version
-
-# LS - Severity
-LSMinor=Minor
-LSFatal=Fatal
-
-# LC - Category
-LCSystem=System Error
-LCExternalLaunch=External Launch Error
-LCFileFormat=File Format Error
-LCReadError=Read Error
-LCClient=Application Error
-LCLaunching=Launch Error
-LCNotSupported=Unsupported Feature
-LCInit=Initialization Error
-
-LAllThreadGroup=All JNLP applications
-LNullUpdatePolicy=Update policy cannot be null.
-
-LThreadInterrupted=Thread interrupted while waiting for file to launch.
-LThreadInterruptedInfo=
-LCouldNotLaunch=Could not launch JNLP file.
-LCouldNotLaunchInfo=
-LCantRead=Could not read or parse the JNLP file.
-LCantReadInfo=
-LNullLocation=Could not determine .jnlp file location.
-LNullLocationInfo=An attempt was made to launch a JNLP file in another JVM, but the file could not be located. In order to launch in an external JVM, the runtime must be able to locate the .jnlp file either in the local filesystem or on a server.
-LNetxJarMissing=Could not determine location of netx.jar.
-LNetxJarMissingInfo=An attempt was made to lauch a JNLP file in another JVM, but the netx.jar could not be located. In order to launch in an external JVM, the runtime must be able to locate the netx.jar file.
-LNotToSpec=JNLP file not strictly to spec.
-LNotToSpecInfo=The JNLP file contains data that is prohibited by the JNLP specification. The runtime can attempt to ignore the invalid information and continue launching the file.
-LNotApplication=Not an application file.
-LNotApplicationInfo=An attempt was made to load a non-application file as an application.
-LNotApplet=Not an applet file.
-LNotAppletInfo=An attempt was made to load a non-applet file as an applet.
-LNoInstallers=Installers not supported.
-LNoInstallersInfo=JNLP installer files are not yet supported.
-LInitApplet=Could not initialize applet.
-LInitAppletInfo=
-LInitApplication=Could not initialize application.
-LInitApplicationInfo=
-LNotLaunchable=Not a launchable JNLP file.
-LNotLaunchableInfo=File must be a JNLP application, applet, or installer type.
-LCantDetermineMainClass=Unknown Main-Class.
-LCantDetermineMainClassInfo=Could not determine the main class for this application.
-LUnsignedJarWithSecurity=Cannot grant permissions to unsigned jars.
-LUnsignedJarWithSecurityInfo=Application requested security permissions, but jars are not signed.
-LSignedJNLPAppDifferentCerts=The JNLP application is not fully signed by a single cert.
-LSignedJNLPAppDifferentCertsInfo=The JNLP application has its components individually signed, however there must be a common signer to all entries.
-LSignedAppJarUsingUnsignedJar=Signed application using unsigned jars.
-LSignedAppJarUsingUnsignedJarInfo=The main application jar is signed, but some of the jars it is using aren't.
-LSignedJNLPFileDidNotMatch=The signed JNLP file did not match the launching JNLP file.
-LNoSecInstance=Error: No security instance for {0}. The application may have trouble continuing
-LCertFoundIn={0} found in cacerts ({1})
-LSingleInstanceExists=Another instance of this applet already exists and only one may be run at the same time.
-
-JNotApplet=File is not an applet.
-JNotApplication=File is not an application.
-JNotComponent=File is not a component.
-JNotInstaller=File is not an installer.
-JInvalidExtensionDescriptor=Extension does not refer to a component or installer (name={1}, location={2}).
-
-LNotVerified=Jars not verified.
-LCancelOnUserRequest=Canceled on user request.
-LFatalVerification=A fatal error occurred while trying to verify jars.
-LFatalVerificationInfo=
-
-LNotVerifiedDialog=Not all jars could be verified.
-LAskToContinue=Would you still like to continue running this application?
-
-# Parser
-PInvalidRoot=Root node is not a jnlp node
-PNoResources=No resources section defined
-PUntrustedNative=nativelib element cannot be specified unless a trusted environment is requested.
-PExtensionHasJ2SE=j2se element cannot be specified in a component extension file.
-PInnerJ2SE=j2se element cannot be specified within a j2se element.
-PTwoMains=Duplicate main JAR defined in a resources element (there can be only one)
-PNativeHasMain=Cannot specify main attribute on native JARs.
-PNoInfoElement=No information section defined.
-PMissingTitle=title
-PMissingVendor=vendor
-PMissingElement=The {0} section has not been defined for your locale nor does a default value exist in the JNLP file.
-PTwoDescriptions=Duplicate description of kind {0}
-PSharing=Element "sharing-allowed" is illegal in a standard JNLP file
-PTwoSecurity=Only one security element allowed per JNLPFile.
-PEmptySecurity=Security element specified but does not contain a permissions element.
-PTwoDescriptors=Only one application descriptor element allowed per JNLPFile.
-PTwoDesktops=Only one desktop element allowed
-PTwoMenus=Only one menu element allowed
-PTwoTitles=Only one title element allowed
-PTwoIcons=Only one icon element allowed
-PTwoUpdates=Only one update element is allowed
-PUnknownApplet=Unknown Applet
-PBadWidth=Invalid applet width.
-PBadHeight=Invalid applet height.
-PUrlNotInCodebase=Relative URL does not specify a subdirectory of the codebase. (node={0}, href={1}, base={2})
-PBadRelativeUrl=Invalid relative URL (node={0}, href={1}, base={2})
-PBadNonrelativeUrl=Invalid non-relative URL (node={0}, href={1})
-PNeedsAttribute=The {0} element must specify a {1} attribute.
-PBadXML=Invalid XML document syntax.
-PBadHeapSize=Invalid value for heap size ({0})
-
-# Runtime
-BLaunchAbout=Launching about window...
-BNeedsFile=Must specify a .jnlp file
-RNoAboutJnlp=Unable to find about.jnlp
-BFileLoc=JNLP file location
-BBadProp=Incorrect property format {0} (should be key=value)
-BBadParam=Incorrect parameter format {0} (should be name=value)
-BNoDir=Directory {0} does not exist.
-BNoCodeOrObjectApplet=Applet tag must specify a 'code' or 'object' attribute.
-RNoResource=Missing Resource: {0}
-RShutdown=This exception to prevent shutdown of JVM, but the process has been terminated.
-RExitTaken=Exit class already set and caller is not exit class.
-RCantReplaceSM=Changing the SecurityManager is not allowed.
-RCantCreateFile=Cant create file {0}
-RCantDeleteFile=Cant delete file {0}
-RRemoveRPermFailed=Removing read permission on file {0} failed
-RRemoveWPermFailed=Removing write permissions on file {0} failed
-RRemoveXPermFailed=Removing execute permissions on file {0} failed
-RGetRPermFailed=Acquiring read permissions on file {0} failed
-RGetWPermFailed=Acquiring write permissions on file {0} failed
-RGetXPermFailed=Acquiring execute permissions on file {0} failed
-RCantCreateDir=Cant create directory {0}
-RCantRename=Cant rename {0} to {1}
-RDenyStopped=Stopped applications have no permissions.
-RExitNoApp=Can not exit the JVM because the current application cannot be determined.
-RNoLockDir=Unable to create locks directory ({0})
-RNestedJarExtration=Unable to extract nested jar.
-RUnexpected=Unexpected {0} at {1}
-RConfigurationError=Fatal error while reading the configuration
-RConfigurationFatal=ERROR: a fatal error has occurred while loading configuration. Perhaps a global configuration was required but could not be found
-RPRoxyPacNotSupported=Using Proxy Auto Config (PAC) files is not supported.
-RProxyFirefoxNotFound=Unable to use Firefox's proxy settings. Using "DIRECT" as proxy type.
-RProxyFirefoxOptionNotImplemented=Browser proxy option "{0}" ({1}) not supported yet.
-RBrowserLocationPromptTitle=Browser Location
-RBrowserLocationPromptMessage=Specify Browser Location
-RBrowserLocationPromptMessageWithReason=Specify Browser Location (the browser command "{0}" is invalid).
-
-# Boot options, message should be shorter than this ---------------->
-BOUsage=javaws [-run-options]
-BOUsage2=javaws [-control-options]
-BOJnlp = Location of JNLP file to launch (url or file).
-BOArg = Adds an application argument before launching.
-BOParam = Adds an applet parameter before launching.
-BOProperty = Sets a system property before launching.
-BOUpdate = Update check if seconds since last checked.
-BOLicense = Display the GPL license and exit.
-BOVerbose = Enable verbose output.
-BOAbout = Shows a sample application.
-BONosecurity= Disables the secure runtime environment.
-BONoupdate = Disables checking for updates.
-BOHeadless = Disables download window, other UIs.
-BOStrict = Enables strict checking of JNLP file format.
-BOViewer = Shows the trusted certificate viewer.
-BXnofork = Do not create another JVM.
-BXclearcache= Clean the JNLP application cache.
-BOHelp = Print this message and exit.
-
-# Cache
-CAutoGen=automatically generated - do not edit
-CNotCacheable={0} is not a cacheable resource
-CDownloading=Downloading
-CComplete=Complete
-CChooseCache=Choose a cache directory...
-CChooseCacheInfo=Netx needs a location for storing cache files.
-CChooseCacheDir=Cache directory
-CCannotClearCache=Can not clear cache at this time
-CFakeCache=Cache is corrupt. Fixing.
-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.
-
-# Security
-SFileReadAccess=The application has requested read access to {0}. Do you want to allow this action?
-SFileWriteAccess=The application has requested write access to {0}. Do you want to allow this action?
-SDesktopShortcut=The application has requested permission to create a desktop launcher. Do you want to allow this action?
-SSigUnverified=The application's digital signature cannot be verified. Do you want to run the application?
-SSigVerified=The application's digital signature has been verified. Do you want to run the application?
-SSignatureError=The application's digital signature has an error. Do you want to run the application?
-SUntrustedSource=The digital signature could not be verified by a trusted source. Only run if you trust the origin of the application.
-SWarnFullPermissionsIgnorePolicy=The code executed will be given full permissions, ignoring any java policies you may have.
-STrustedSource=The digital signature has been validated by a trusted source.
-SClipboardReadAccess=The application has requested read-only access to the system clipboard. Do you want to allow this action?
-SClipboardWriteAccess=The application has requested write-only access to the system clipboard. Do you want to allow this action?
-SPrinterAccess=The application has requested printer access. Do you want to allow this action?
-SNetworkAccess=The application has requested permission to establish connections to {0}. Do you want to allow this action?
-SNoAssociatedCertificate=
-SUnverified=(unverified)
-SAlwaysTrustPublisher=Always trust content from this publisher
-SHttpsUnverified=The website's HTTPS certificate cannot be verified.
-SNotAllSignedSummary=Only parts of this application code are signed.
-SNotAllSignedDetail=This application contains both signed and unsigned code. While signed code is safe if you trust the provider, unsigned code may imply code outside of the trusted provider's control.
-SNotAllSignedQuestion=Do you wish to proceed and run this application anyway?
-SAuthenticationPrompt=The {0} server at {1} is requesting authentication. It says "{2}"
-SJNLPFileIsNotSigned=This application contains a digital signature in which the launching JNLP file is not signed.
-
-# Security - used for the More Information dialog
-SBadKeyUsage=Resources contain entries whose signer certificate's KeyUsage extension doesn't allow code signing.
-SBadExtendedKeyUsage=Resources contain entries whose signer certificate's ExtendedKeyUsage extension doesn't allow code signing.
-SBadNetscapeCertType=Resources contain entries whose signer certificate's NetscapeCertType extension doesn't allow code signing.
-SHasExpiredCert=The digital signature has expired.
-SHasExpiringCert=Resources contain entries whose signer certificate will expire within six months.
-SNotYetValidCert=Resources contain entries whose signer certificate is not yet valid.
-SUntrustedCertificate=The digital signature was generated with an untrusted certificate.
-STrustedCertificate=The digital signature was generated with a trusted certificate.
-SCNMisMatch=The expected hostname for this certificate is: "{0}" The address being connected to is: "{1}"
-SRunWithoutRestrictions=This application will be run without the security restrictions normally provided by java.
-SCertificateDetails=Certificate Details
-
-# Security - certificate information
-SIssuer=Issuer
-SSerial=Serial
-SMD5Fingerprint=MD5 Fingerprint
-SSHA1Fingerprint=SHA1 Fingerprint
-SSignature=Signature
-SSignatureAlgorithm=Signature Algorithm
-SSubject=Subject
-SValidity=Validity
-
-# Certificate Viewer
-CVCertificateViewer=Certificates
-CVCertificateType=Certificate Type
-CVDetails=Details
-CVExport=Export
-CVExportPasswordMessage=Enter password to protect key file:
-CVImport=Import
-CVImportPasswordMessage=Enter password to access file:
-CVIssuedBy=Issued By
-CVIssuedTo=Issued To
-CVPasswordTitle=Authentication Required
-CVRemove=Remove
-CVRemoveConfirmMessage=Are you sure you want to remove the selected certificate?
-CVRemoveConfirmTitle=Confirmation - Remove Certificate?
-CVUser=User
-CVSystem=System
-
-#KeyStores: see KeyStores.java
-KS=KeyStore
-KSCerts=Trusted Certificates
-KSJsseCerts=Trusted JSSE Certificates
-KSCaCerts=Trusted Root CA Certificates
-KSJsseCaCerts=Trusted JSSE Root CA Certificates,
-KSClientCerts=Client Authentication Certificates
-
-# Deployment Configuration messages
-DCIncorrectValue=Property "{0}" has incorrect value "{1}". Possible values {2}.
-DCInternal=Internal error: {0}
-DCSourceInternal=
-DCUnknownSettingWithName=Property "{0}" is unknown.
-
-# Value Validator messages. Messages should follow "Possible values ..."
-VVPossibleValues=Possible values {0}
-VVPossibleBooleanValues=are {0} or {1}
-VVPossibleFileValues=include the absolute location of a file - it must begin with a /
-VVPossibleRangedIntegerValues=are in range {0} to {1} (inclusive)
-VVPossibleUrlValues=include any valid url (eg http://icedtea.classpath.org/hg/)
-
-# Control Panel - Main
-CPMainDescriptionShort=Configure IcedTea-Web
-CPMainDescriptionLong=Configure how the browser plugin (IcedTeaNPPlugin) and javaws (NetX) work
-
-# Control Panel - Tab Descriptions
-CPAboutDescription=View version information about Icedtea Control Panel.
-CPNetworkSettingsDescription=Configure network settings, including how IcedTea-Web connects to the internet and whether to use any proxies.
-CPTempInternetFilesDescription=Java stores application data for faster execution the next time you run it.
-CPJRESettingsDescription=View and manage Java Runtime Environment versions and settings for Java applications and applets.
-CPCertificatesDescription=Use certificates to positively identify yourself, certifications, authorities, and plublishers.
-CPSecurityDescription=Use this to configure security settings.
-CPDebuggingDescription=Enable options here to help with debugging
-CPDesktopIntegrationDescription=Set whether or not to allow creation of desktop shortcut.
-CPJVMPluginArguments=Set JVM arguments for plugin.
-
-# Control Panel - Buttons
-CPButAbout=About...
-CPButNetworkSettings=Network Settings...
-CPButSettings=Settings...
-CPButView=View...
-CPButCertificates=Certificates...
-
-# Control Panel - Headers
-CPHead=IcedTea Web Control Panel
-CPHeadAbout=About
-CPHeadNetworkSettings=Network Proxy Settings
-CPHeadTempInternetFiles=Temporary Internet Files
-CPHeadJRESettings=Java Runtime Environment Settings
-CPHeadCertificates=Certificates
-CPHeadDebugging=Debugging Settings
-CPHeadDesktopIntegration=Desktop Integrations
-CPHeadSecurity=Security Settings
-CPHeadJVMSettings=JVM Settings
-
-# Control Panel - Tabs
-CPTabAbout=About IcedTea-Web
-CPTabCache=Cache
-CPTabCertificate=Certificates
-CPTabClassLoader=Class Loaders
-CPTabDebugging=Debugging
-CPTabDesktopIntegration=Desktop Integration
-CPTabNetwork=Network
-CPTabRuntimes=Runtimes
-CPTabSecurity=Security
-CPTabJVMSettings=JVM Settings
-
-# Control Panel - AboutPanel
-CPAboutInfo=This is the control panel for setting deployments.properties. Not all options will take effect until implemented. The use of multiple JREs is currently unsupported.
-
-# Control Panel - AdvancedProxySettings
-APSDialogTitle=Network Settings
-APSServersPanel=Servers
-APSProxyTypeLabel=Type
-APSProxyAddressLabel=Proxy Address
-APSProxyPortLabel=Proxy Port
-APSLabelHTTP=HTTP
-APSLabelSecure=Secure
-APSLabelFTP=FTP
-APSLabelSocks=Socks
-APSSameProxyForAllProtocols=Use the same proxy server for all protocols.
-APSExceptionsLabel=Exceptions
-APSExceptionsDescription=Do not use proxy server for addresses beginning with
-APSExceptionInstruction=Separate each entry with a semicolon.
-
-# Control Panel - DebugginPanel
-DPEnableTracing=Enable tracing
-DPEnableLogging=Enable logging
-DPDisable=Disable
-DPHide=Hide on startup
-DPShow=Show on startup
-DPJavaConsole=Java Console
-
-# Control Panel - DesktopShortcutPanel
-DSPNeverCreate=Never create
-DSPAlwaysAllow=Always allow
-DSPAskUser=Ask user
-DSPAskIfHinted=Ask if hinted
-DSPAlwaysIfHinted=Always if hinted
-
-# Control Panel - NetworkSettingsPanel
-NSDescription-1=Unknown Setting.
-NSDescription0=Use direct connection.
-NSDescription1=Override browser proxy settings.
-NSDescription2=Use automatic proxy configuration script at the specified location.
-NSDescription3=Use proxy settings from your default browser to connect to the internet.
-NSAddress=Address
-NSPort=Port
-NSAdvanced=Advanced
-NSBypassLocal=Bypass proxy server for local addresses
-NSDirectConnection=Direct connection
-NSManualProxy=Manual proxy server
-NSAutoProxy=Automatic proxy configuration script
-NSBrowserProxy=Use browser settings
-NSScriptLocation=Script location
-
-# Control Panel - SecurityGeneralPanel
-SGPAllowUserGrantSigned=Allow users to grant permissions to signed content
-SGPAllowUserGrantUntrust=Allow users to grant permissions to content from an untrusted authority
-SGPUseBrowserKeystore=Use certificates and keys in browser keystore (Unsupported)
-SGPUsePersonalCertOneMatch=Use personal certificate automatically if only one matches server request (Unsupported)
-SGPWarnCertHostMismatch=Warn if site certificate does not match hostname
-SGPShowValid=Show site certificate even if it is valid (Unsupported)
-SGPShowSandboxWarning=Show sandbox warning banner
-SGPAllowUserAcceptJNLPSecurityRequests=Allow user to accept JNLP security requests
-SGPCheckCertRevocationList=Check certificates for revocation using Certificate Revocation Lists (CRLs) (Unsupported)
-SGPEnableOnlineCertValidate=Enable online certificate validation (Unsupported)
-SGPEnableTrustedPublisherList=Enable list of trusted publishers (Unsupported)
-SGPEnableBlacklistRevocation=Enable blacklist revocation check (Unsupported)
-SGPEnableCachingPassword=Enable caching password for authentication (Unsupported)
-SGPUseSSL2=Use SSL 2.0 compatible ClientHello format (Unsupported)
-SGPUseSSL3=Use SSL 3.0 (Unsupported)
-SGPUseTLS1=Use TLS 1.0 (Unsupported)
-
-# Control Panel - TemporaryInternetFilesPanel
-TIFPEnableCache=Keep temporary files on my computer
-TIFPLocation=Location
-TIFPLocationLabel=Select the location where temporary files are kept
-TIFPChange=Change
-TIFPDiskSpace=Disk space
-TIFPCompressionLevel=Select the compression level for JAR files
-TIFPNone=None
-TIFPMax=Max
-TIFPCacheSize=Set the amount of disk space for storing temporary files
-TIFPDeleteFiles=Delete files
-TIFPViewFiles=View files...
-
-# Control Panel - Cache Viewer
-CVCPDialogTitle=Cache Viewer
-CVCPButRefresh=Refresh
-CVCPButDelete=Delete
-CVCPColLastModified=Last Modified
-CVCPColSize=Size (Bytes)
-CVCPColDomain=Domain
-CVCPColType=Type
-CVCPColPath=Path
-CVCPColName=Name
-
-# Control Panel - Misc.
-CPJRESupport=IcedTea-Web currently does not support the use of multiple JREs.
-CPInvalidPort=Invalid port number given.\n[Valid port numbers are 1-65535]
-CPInvalidPortTitle=Error on input.
-
-# command line control panel
-CLNoInfo=No information avaiable (is this a valid option?).
-CLValue=Value: {0}
-CLValueSource=Source: {0}
-CLDescription=Description: {0}
-CLUnknownCommand=Unknown command {0}
-CLUnknownProperty=Unknown property-name "{0}"
-CLWarningUnknownProperty=WARNING: Unknown property name "{0}" - creating new property
-CLNoIssuesFound=No issues found.
-CLIncorrectValue=Property "{0}" has incorrect value "{1}". Possible values {2}.
-CLListDescription=Shows a list of all property names and values that are in use by IcedTea-Web
-CLGetDescription=Shows the value for property-name
-CLSetDescription=Sets the property-name to value if possible. The value is checked for being valid. If the administrator has locked the property, this will have no effect
-CLResetDescription=Resets the value for property-name to it\'s default value
-CLInfoDescription=Shows more information about the given property
-CLCheckDescription=Shows any properties that have been defined but are not recognized by IcedTea Web
-CLHelpDescription=The itweb-settings tool allows a user to modify, view and check configuration. \nTo use the GUI, do not pass any arguments. To use the CLI mode, pass in the approrpiate command and parameters. For help with a particular command, try: {0} command help
-
-# splash screen related
-SPLASHerror = Click here for details. Serious exception occurred.
-SPLASH_ERROR = ERROR
-SPLASHtitle = Title
-SPLASHvendor = Vendor
-SPLASHhomepage = Homepage
-SPLASHdescription = Description
-SPLASHClose= Close
-SPLASHclosewAndCopyException = Close and copy StackTrace to clipboard
-SPLASHexOccured = Sorry, a serious exception occurred...
-SPLASHHome = Home
-SPLASHcantCopyEx = Can not copy exception
-SPLASHnoExRecorded = No exception recorded
-SPLASHmainL1 = For even more information you can visit {0} and follow the steps to obtain information and fill bug
-SPLASHurl = http://icedtea.classpath.org/wiki/IcedTea-Web#Filing_bugs
-SPLASHurlLooks = http://icedtea.classpath.org/wiki/IcedTea-Web
-SPLASHmainL3 = Sorry no more information available, try to launch browser from command line and watch output.
-SPLASHcloseAndCopyShorter = Close and copy to clipboard
-SPLASHmainL4 = We have noticed exception written below, for even more information try to launch browser from command line and watch output
-SPLASHexWas = Exception was:
-SPLASHcfl = Can't follow link to
-SPLASHvendorsInfo = Information from vendor of your application
-SPLASHanotherInfo = Another available info
-SPLASHdefaultHomepage = Unspecified homepage, verify source rather
-SPLASHerrorInInformation = Error during loading of information element, verify source rather
-SPLASHmissingInformation = Information element is missing, verify source rather
+# Default (English) UI messages for netx
+# L=Launcher, B=Boot, P=Parser, C=cache S=security
+#
+# General
+NullParameter=Null parameter
+ButAllow=Allow
+ButBrowse=Browse...
+ButCancel=\ Cancel\
+ButClose=Close
From adomurad at redhat.com Mon Jan 7 09:38:10 2013
From: adomurad at redhat.com (Adam Domurad)
Date: Mon, 07 Jan 2013 12:38:10 -0500
Subject: [rfc][icedtea-web] Fix for PR1198, JSObject passed incorrectly
to Javascript
In-Reply-To: <50EAFB5A.9000104@redhat.com>
References: <50B92039.4070304@redhat.com> <50BCF77F.2020808@redhat.com>
<50E6A438.1010605@redhat.com> <50E70F2D.2070805@redhat.com>
<50EAE14D.5050505@redhat.com> <50EAEE24.2080804@redhat.com>
<50EAFB5A.9000104@redhat.com>
Message-ID: <50EB0802.8030803@redhat.com>
On 01/07/2013 11:44 AM, Jiri Vanek wrote:
> On 01/07/2013 04:47 PM, Adam Domurad wrote:
>> On 01/07/2013 09:53 AM, Jiri Vanek wrote:
>>>> [.. rest snipped..]
>>> Isn't missing updated junit patch here?
>>
>> Sorry, was awaiting your advice -- if you did not like this
>> security-manager-in-constructor change
>> than the unit test would not be valid, a quite different approach
>> would have to be used.
>>
>>>
>>> Thanx for looking into it.
>>> J.
>>>
>>
>>
>> patch attached,
>> -Adam
>>
>> jsfix-unittest2.patch
>>
>>
>> diff --git
>> a/plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java
>> b/plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java
>> new file mode 100644
>> --- /dev/null
>> +++
>> b/plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java
>> @@ -0,0 +1,49 @@
>> +/* JSObjectUnboxPermission.java
>> + Copyright (C) 2012 Red Hat
>> +
>> +This file is part of IcedTea.
>> +
>> +IcedTea is free software; you can redistribute it and/or modify
>> +it under the terms of the GNU General Public License as published by
>> +the Free Software Foundation; either version 2, or (at your option)
>> +any later version.
>> +
>> +IcedTea is distributed in the hope that it will be useful, but
>> +WITHOUT ANY WARRANTY; without even the implied warranty of
>> +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
>> +General Public License for more details.
>> +
>> +You should have received a copy of the GNU General Public License
>> +along with IcedTea; see the file COPYING. If not, write to the
>> +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
>> Boston, MA
>> +02110-1301 USA.
>> +
>> +Linking this library statically or dynamically with other modules is
>> +making a combined work based on this library. Thus, the terms and
>> +conditions of the GNU General Public License cover the whole
>> +combination.
>> +
>> +As a special exception, the copyright holders of this library give you
>> +permission to link this library with independent modules to produce an
>> +executable, regardless of the license terms of these independent
>> +modules, and to copy and distribute the resulting executable under
>> +terms of your choice, provided that you also meet, for each linked
>> +independent module, the terms and conditions of the license of that
>> +module. An independent module is a module which is not derived from
>> +or based on this library. If you modify this library, you may extend
>> +this exception to your version of the library, but you are not
>> +obligated to do so. If you do not wish to do so, delete this
>> +exception statement from your version. */
>> +
>> +package netscape.javascript;
>> +
>> +import java.security.BasicPermission;
>> +
>> +/**
>> + * Permission to access internal reference of JSObject
>> + */
>> +public class JSObjectUnboxPermission extends BasicPermission {
>> + public JSObjectUnboxPermission() {
>> + super("JSObjectUnbox");
>> + }
>> +}
>> diff --git
>> a/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
>> b/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
>> --- a/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
>> +++ b/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
>> @@ -53,7 +53,6 @@ import java.security.Permissions;
>> import java.security.PrivilegedAction;
>> import java.security.ProtectionDomain;
>> import java.util.ArrayList;
>> -import java.util.Arrays;
>> import java.util.Hashtable;
>> import java.util.List;
>> import java.util.Map;
>> @@ -241,16 +240,6 @@ public class PluginAppletSecurityContext
>> public PluginAppletSecurityContext(int identifier) {
>> this.identifier = identifier;
>>
>> - // We need a security manager.. and since there is a good
>> chance that
>> - // an applet will be loaded at some point, we should make it
>> the SM
>> - // that JNLPRuntime will try to install
>> - if (System.getSecurityManager() == null) {
>> - JNLPRuntime.initialize(/* isApplication */false);
>> - JNLPRuntime.setDefaultLaunchHandler(new
>> DefaultLaunchHandler(System.err));
>> - }
>> -
>> - JNLPRuntime.disableExit();
>> -
>> URL u = null;
>> try {
>> u = new URL("file://");
>> diff --git a/plugin/icedteanp/java/sun/applet/PluginMain.java
>> b/plugin/icedteanp/java/sun/applet/PluginMain.java
>> --- a/plugin/icedteanp/java/sun/applet/PluginMain.java
>> +++ b/plugin/icedteanp/java/sun/applet/PluginMain.java
>> @@ -73,6 +73,7 @@ import java.net.ProxySelector;
>> import java.util.Enumeration;
>> import java.util.Properties;
>>
>> +import net.sourceforge.jnlp.DefaultLaunchHandler;
>> import net.sourceforge.jnlp.config.DeploymentConfiguration;
>> import net.sourceforge.jnlp.runtime.JNLPRuntime;
>> import net.sourceforge.jnlp.security.JNLPAuthenticator;
>> @@ -106,6 +107,15 @@ public class PluginMain {
>> // must be called before JNLPRuntime.initialize()
>> JNLPRuntime.setRedirectStreams(redirectStreams);
>>
>> + // We need a security manager for
>> PluginAppletSecurityContext,
>> + // so we ensure it is initialized
>> + if (System.getSecurityManager() == null) {
>> + JNLPRuntime.initialize(/* isApplication */false);
>> + JNLPRuntime.setDefaultLaunchHandler(new
>> DefaultLaunchHandler(System.err));
>> + }
>> +
>> + JNLPRuntime.disableExit();
>> +
>> PluginAppletSecurityContext sc = new
>> PluginAppletSecurityContext(0);
>> sc.prePopulateLCClasses();
>
> Well, I'm still not comfortable with this change.
> I'm not sure which security parts can be affected:-/ I really would
> like to know Jana's opinion here.
> Do you mind to move it to separate method?
I have attached a patch that is more refactoring-proof. It is based on
bypassing installation via package-private constructor. Note there is no
security risk if this is 'bypassed' once it has already occurred.
> [.. snip ..]
>>
>
Thanks,
-Adam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jsfix-unittest3.patch
Type: text/x-patch
Size: 9812 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130107/125da2d5/jsfix-unittest3.patch
From adomurad at redhat.com Mon Jan 7 11:00:03 2013
From: adomurad at redhat.com (Adam Domurad)
Date: Mon, 07 Jan 2013 14:00:03 -0500
Subject: [rfc][icedtea-web] make download indicator more compact
In-Reply-To: <50EADE9F.3000101@redhat.com>
References: <50E5ACDF.7080609@redhat.com> <50E704C5.4060300@redhat.com>
<50EADE9F.3000101@redhat.com>
Message-ID: <50EB1B33.4020605@redhat.com>
On 01/07/2013 09:41 AM, Jiri Vanek wrote:
> On 01/04/2013 05:35 PM, Adam Domurad wrote:
>> On 01/03/2013 11:07 AM, Jiri Vanek wrote:
>>> Hi!
>>>
>>> This patch is adding "show details" to download indicator. For One
>>> jar jnlp files it behaviour is
>>> unaffected. For Multiple jars there is just one progress bar, but
>>> can be shown "old stile"
>>> detailed one via clicking to "Show details". Then can be
>>> minimalised by "hide details". Button is
>>> localised.
>>>
>>> The button is nasty not nice.. Any better idea? but still this is
>>> better then previous approach.
>>>
>>> Looking forward to have this inside!
>>>
>>> Best rigards
>>> J.
>>
>> Thanks for looking into this! I was actually comparing our download
>> indicator to proprietary just
>> yesterday, while staring at multiple jars downloading. The average
>> user does not want to know about
>> the jars being downloaded, in fact I think such information can look
>> scary :-).
>>
>>> diff -r 9549226afa8f
>>> netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java
>>> --- a/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java
>>> Thu Jan 03 09:54:16 2013 +0100
>>> +++ b/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java
>>> Thu Jan 03 17:07:28 2013 +0100
>>> @@ -62,6 +62,7 @@
>>>
>>> /** shared constraint */
>>> static GridBagConstraints vertical;
>>> + static GridBagConstraints verticalNoClean;
>>> static GridBagConstraints verticalIndent;
>>> static {
>>> vertical = new GridBagConstraints();
>>> @@ -70,8 +71,12 @@
>>> vertical.fill = GridBagConstraints.HORIZONTAL;
>>> vertical.anchor = GridBagConstraints.WEST;
>>>
>>> + verticalNoClean = new GridBagConstraints();
>>> + verticalNoClean.weightx = 1.0;
>>> +
>>> verticalIndent = (GridBagConstraints) vertical.clone();
>>> verticalIndent.insets = new Insets(0, 10, 3, 0);
>>> +
>>
>> Nit: These two blank lines (and all the ones added below) have tabs :-)
>>
>>> }
>>>
>>> /**
>>> @@ -114,15 +119,15 @@
>>>
>>> frame.getContentPane().add(result, vertical);
>>> frame.pack();
>>> -
>>> if (!frame.isVisible()) {
>>> - Dimension screenSize =
>>> Toolkit.getDefaultToolkit().getScreenSize();
>>> - Insets insets =
>>> Toolkit.getDefaultToolkit().getScreenInsets(frame.getGraphicsConfiguration());
>>>
>>> - Dimension screen = new Dimension(screenSize.width -
>>> insets.left,
>>> - screenSize.height - insets.top);
>>> - frame.setLocation(screen.width - frame.getWidth(),
>>> - screen.height - frame.getHeight());
>>> + placeFrameToLowerRight();
>>> }
>>> + result.addComponentListener(new ComponentAdapter() {
>>> + @Override
>>> + public void componentResized(ComponentEvent e) {
>>> + placeFrameToLowerRight();
>>> + }
>>> + });
>>>
>>> frame.setVisible(true);
>>>
>>> @@ -131,6 +136,32 @@
>>> }
>>>
>>> /**
>>> + * The insets are calculated differently during first appearance
>>> + * and during another appearance in case of some configurations.
>>> + *
>>> + * So the first value is stored to avoid jumping of window
>>> during later packing
>>> + * of frame.
>>> + *
>>> + * However the second calculation is more correct:(
>>> + *
>>> + * This is affecting only multiple monitors which have
>>> different assets.
>>> + * The underlying issue is that
>>> Toolkit.getDefaultToolkit().getScreenInsets
>>> + * is returning assets for "random" monitor.
>>> + */
>>> + Dimension screen = null;
>>> +
>>> + private void placeFrameToLowerRight() throws HeadlessException {
>>> + if (screen == null) {
>>> + Dimension screenSize =
>>> Toolkit.getDefaultToolkit().getScreenSize();
>>> + Insets insets =
>>> Toolkit.getDefaultToolkit().getScreenInsets(frame.getGraphicsConfiguration());
>>>
>>> + screen = new Dimension(screenSize.width - insets.left,
>>> + screenSize.height - insets.top);
>>> + }
>>> + frame.setLocation(screen.width - frame.getWidth(),
>>> + screen.height - frame.getHeight());
>>> + }
>>> +
>>> + /**
>>> * Remove a download service listener that was obtained by
>>> * calling the getDownloadListener method from the shared
>>> * download info window.
>>> @@ -163,12 +194,26 @@
>>> * Groups the url progress in a panel.
>>> */
>>> static class DownloadPanel extends JPanel implements
>>> DownloadServiceListener {
>>> -
>>> + private static enum States{
>>> + oneJAr, collapsed, detailed;
>>
>> Enums should be all-caps
>>
>>> +
>>> + }
>>> +
>>> + private static final String DETAILS=R("ButShowDetails");
>>> + private static final String HIDE_DETAILS=R("ButHideDetails");
>>> /** the download name */
>>> private String downloadName;
>>>
>>> /** Downloading part: */
>>> private JLabel header = new JLabel();
>>> + /** Show/hide details button: */
>>> + private JButton details = new JButton(DETAILS);
>>> + /** used instead of details button in case of one jar*/
>>> + private JLabel delimiter = new JLabel("");
>>> + /** all already created progress bars*/
>>> + private List progressPanels = new
>>> ArrayList();
>>> + private States state=States.oneJAr;
>>> + private ProgressPanel mainProgressPanel;
>>>
>>> /** list of URLs being downloaded */
>>> private List urls = new ArrayList();
>>> @@ -176,6 +221,7 @@
>>> /** list of ProgressPanels */
>>> private List panels = new
>>> ArrayList();
>>>
>>> +
>>
>> Nit: two blank lines are unnecessary.
>>
>>> /**
>>> * Create a new download panel for with the specified download
>>> * name.
>>> @@ -184,9 +230,35 @@
>>> setLayout(new GridBagLayout());
>>>
>>> this.downloadName = downloadName;
>>> - this.add(header, vertical);
>>> + this.add(header, verticalNoClean);
>>> header.setFont(header.getFont().deriveFont(Font.BOLD));
>>> -
>>> + this.add(delimiter, vertical);
>>> + details.addActionListener(new ActionListener() {
>>> + @Override
>>> + public void actionPerformed(ActionEvent e) {
>>> + if (state == States.detailed) {
>>> + state = States.collapsed;
>>> + details.setText(DETAILS);
>>> + for (ProgressPanel progressPanel :
>>> progressPanels) {
>>> + remove(progressPanel);
>>> + }
>>> + add(mainProgressPanel, verticalIndent);
>>> + synchronized (frameMutex) {
>>> + frame.pack();
>>> + }
>>> + } else {
>>> + state = States.detailed;
>>> + details.setText(HIDE_DETAILS);
>>> + remove(mainProgressPanel);
>>> + for (ProgressPanel progressPanel :
>>> progressPanels) {
>>> + add(progressPanel, verticalIndent);
>>> + }
>>> + synchronized (frameMutex) {
>>> + frame.pack();
>>> + }
>>> + }
>>> + }
>>> + });
>>> setOverallPercent(0);
>>> }
>>>
>>> @@ -196,14 +268,25 @@
>>> protected void addProgressPanel(URL url, String version) {
>>> if (!urls.contains(url)) {
>>> ProgressPanel panel = new ProgressPanel(url, version);
>>> -
>>> - add(panel, verticalIndent);
>>> + if (state != States.collapsed) {
>>> + add(panel, verticalIndent);
>>> + }
>>> + progressPanels.add(panel);
>>> + urls.add(url);
>>> + panels.add(panel);
>>> + if (panels.size() == 2){
>>
>> Small comment here would be good explaining why this 'magic number'
>>
>>> + remove(panels.get(0));
>>> + remove(panels.get(1));
>>> + remove(delimiter);
>>> + add(details,vertical);
>>> + mainProgressPanel=new ProgressPanel();
>>> + add(mainProgressPanel, verticalIndent);
>>> + state=States.collapsed;
>>> + }
>>> synchronized (frameMutex) {
>>> frame.pack();
>>> }
>>>
>>> - urls.add(url);
>>> - panels.add(panel);
>>> }
>>> }
>>>
>>> @@ -219,10 +302,10 @@
>>> addProgressPanel(url, version);
>>>
>>> setOverallPercent(overallPercent);
>>> -
>>> ProgressPanel panel =
>>> panels.get(urls.indexOf(url));
>>> panel.setProgress(readSoFar, total);
>>> panel.repaint();
>>> +
>>> }
>>> };
>>> SwingUtilities.invokeLater(r);
>>> @@ -230,12 +313,28 @@
>>>
>>> /**
>>> * Sets the overall percent completed.
>>> + * should be called via invokeLater
>>> */
>>> public void setOverallPercent(int percent) {
>>> // don't get whole string from resource and sub in
>>> // values because it'll be doing a MessageFormat for
>>> // each update.
>>> header.setText(downloading + " " + downloadName + ": "
>>> + percent + "% " + complete +
>>> ".");
>>> + Container c = header.getParent();
>>> + //we need to adapt nbboth panels and also frame to new
>>> length of header text
>>
>> nbboth > both
>>
>>> + while (c != null) {
>>> + c.invalidate();
>>> + c.validate();
>>> + if (c instanceof Window){
>>> + ((Window) c).pack();
>>> + }
>>> + c=c.getParent();
>>> + }
>>> +
>>> + if (mainProgressPanel != null) {
>>> + mainProgressPanel.setProgress(percent, 100);
>>> + mainProgressPanel.repaint();
>>> + }
>>> }
>>>
>>> /**
>>> @@ -276,12 +375,28 @@
>>>
>>> private long total;
>>> private long readSoFar;
>>> + private Dimension size = new Dimension(80, 15);
>>>
>>> + ProgressPanel() {
>>> + bar.setMinimumSize(size);
>>> + bar.setPreferredSize(size);
>>> + bar.setOpaque(false);
>>> +
>>> + setLayout(new GridBagLayout());
>>> +
>>> + GridBagConstraints gbc = new GridBagConstraints();
>>> + styleGridBagConstraints(gbc);
>>> + add(bar, gbc);
>>> + }
>>> +
>>> ProgressPanel(URL url, String version) {
>>> - JLabel location = new JLabel(" " + url.getHost() + "/"
>>> + url.getFile());
>>> + this(" " + url.getHost() + "/" + url.getFile(),version);
>>> + }
>>> + ProgressPanel(String caption, String version) {
>>> + JLabel location = new JLabel(caption);
>>>
>>> - bar.setMinimumSize(new Dimension(80, 15));
>>> - bar.setPreferredSize(new Dimension(80, 15));
>>> + bar.setMinimumSize(size);
>>> + bar.setPreferredSize(size);
>>> bar.setOpaque(false);
>>>
>>> setLayout(new GridBagLayout());
>>> @@ -291,12 +406,8 @@
>>> gbc.fill = GridBagConstraints.NONE;
>>> gbc.gridwidth = GridBagConstraints.RELATIVE;
>>> add(bar, gbc);
>>> -
>>> - gbc.insets = new Insets(0, 3, 0, 0);
>>> - gbc.weightx = 1.0;
>>> - gbc.fill = GridBagConstraints.HORIZONTAL;
>>> - gbc.gridwidth = GridBagConstraints.REMAINDER;
>>> - gbc.anchor = GridBagConstraints.WEST;
>>> +
>>> + styleGridBagConstraints(gbc);
>>> add(location, gbc);
>>> }
>>>
>>> @@ -325,6 +436,14 @@
>>> g.fillRect(x + 1, y + 1, divide - 1, h - 1);
>>> }
>>> }
>>> +
>>> + private void styleGridBagConstraints(GridBagConstraints gbc) {
>>> + gbc.insets = new Insets(0, 3, 0, 0);
>>> + gbc.weightx = 1.0;
>>> + gbc.fill = GridBagConstraints.HORIZONTAL;
>>> + gbc.gridwidth = GridBagConstraints.REMAINDER;
>>> + gbc.anchor = GridBagConstraints.WEST;
>>> + }
>>> };
>>>
>>> }
>>
>> Code looks OK nits aside.
>
> Thanx for nits. Should be fixed now
>>
>> As for button ... yes it is nasty. IMO maybe we can take different
>> approach here. The people
>> interested in how the individual jars are downloading would mainly be
>> 1. us trying to fix jar
>> loading issues, 2. developers looking into jar loading issues.
>>
>> So what if the ICEDTEAPLUGIN_DEBUG environment variable turned this
>> on/off ? It can be argued it is
>> a bit hard for developers to access, but it isn't any easier to
>> access this information from oracle
>> plugin.
>
> I think I don't like this idea :(
No problem, but can you elaborate why not?
> I have added an attempt to use an icon, And I must say it is much
> better. Btw, I have created this icon.. so no wonders here :) But
> looks quite cool :)
It looks OK :-) The glass part could use some transparency.
There should be a slightly different icon from going from detailed
->compact.
>
>>
>> As well, I would be very happy to see the loading bar integrated with
>> the splash screen (if splash
>> screen is on). I believe this would nicely complement the user
>> friendliness of the splash screen.
>
> You mean to sync progress on progress bar with the one in splash? Or
> also showing the downlaoded resources somehow and show details button
> in splash?
I was thinking always have progress bar on splash, and have detailed
view hide/show the download bars in corner. IMO this is good for now,
except:
1. visual glitches such as http://i.imgur.com/Oveuh.png (with text
flickering from middle to top every frame). As well on dual monitors
expanding/compacting view constantly changed screens for me.
2. A different style button/icon from going detailed->compact.
>
> Sounds reasonable, but definitely as different changeset.
>
>
> Thanx for review an ideas,
> J.
Happy hacking,
-Adam
From ptisnovs at icedtea.classpath.org Tue Jan 8 01:50:37 2013
From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org)
Date: Tue, 08 Jan 2013 09:50:37 +0000
Subject: /hg/rhino-tests: Added new tests for methods GetCanonicalName() ...
Message-ID:
changeset 7f25cbe3c551 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=7f25cbe3c551
author: Pavel Tisnovsky
date: Tue Jan 08 10:53:46 2013 +0100
Added new tests for methods GetCanonicalName() and getAnnotation().
Fixed spelling.
diffstat:
ChangeLog | 6 ++
src/org/RhinoTests/SimpleScriptContextClassTest.java | 44 +++++++++++++++++--
2 files changed, 45 insertions(+), 5 deletions(-)
diffs (110 lines):
diff -r 87019bd63c13 -r 7f25cbe3c551 ChangeLog
--- a/ChangeLog Mon Jan 07 10:57:47 2013 +0100
+++ b/ChangeLog Tue Jan 08 10:53:46 2013 +0100
@@ -1,3 +1,9 @@
+2013-01-08 Pavel Tisnovsky
+
+ * src/org/RhinoTests/SimpleScriptContextClassTest.java:
+ Added new test for a method GetCanonicalName() getAnnotation().
+ Fixed spelling.
+
2013-01-07 Pavel Tisnovsky
* src/org/RhinoTests/AbstractScriptEngineClassTest.java:
diff -r 87019bd63c13 -r 7f25cbe3c551 src/org/RhinoTests/SimpleScriptContextClassTest.java
--- a/src/org/RhinoTests/SimpleScriptContextClassTest.java Mon Jan 07 10:57:47 2013 +0100
+++ b/src/org/RhinoTests/SimpleScriptContextClassTest.java Tue Jan 08 10:53:46 2013 +0100
@@ -1,7 +1,7 @@
/*
Rhino test framework
- Copyright (C) 2011, 2012 Red Hat
+ Copyright (C) 2011, 2012, 2013 Red Hat
This file is part of IcedTea.
@@ -45,6 +45,7 @@
import java.util.List;
import java.util.Map;
import java.util.HashMap;
+import java.util.TreeMap;
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
@@ -267,6 +268,15 @@
}
/**
+ * Test for method javax.script.SimpleScriptContext.getClass().getCanonicalName()
+ */
+ protected void testGetCanonicalName() {
+ String canonicalName = this.simpleScriptContextClass.getCanonicalName();
+ assertEquals(canonicalName, "javax.script.SimpleScriptContext",
+ "Method javax.script.SimpleScriptContext.getClass().getCanonicalName() returns wrong value " + canonicalName);
+ }
+
+ /**
* Test for method javax.script.SimpleScriptContext.getClass().getSuperclass()
*/
protected void testGetSuperclass() {
@@ -487,7 +497,7 @@
*/
protected void testGetDeclaredMethods() {
// following methods should be declared
- final String[] declaredMethodsThatShouldExists_jdk6 = {
+ final String[] declaredMethodsThatShouldExist_jdk6 = {
"public int javax.script.SimpleScriptContext.getAttributesScope(java.lang.String)",
"public java.io.Reader javax.script.SimpleScriptContext.getReader()",
"public java.io.Writer javax.script.SimpleScriptContext.getErrorWriter()",
@@ -504,7 +514,7 @@
"public void javax.script.SimpleScriptContext.setWriter(java.io.Writer)",
};
- final String[] declaredMethodsThatShouldExists_jdk7 = {
+ final String[] declaredMethodsThatShouldExist_jdk7 = {
"public int javax.script.SimpleScriptContext.getAttributesScope(java.lang.String)",
"public java.io.Reader javax.script.SimpleScriptContext.getReader()",
"public java.io.Writer javax.script.SimpleScriptContext.getErrorWriter()",
@@ -528,9 +538,10 @@
for (Method method : declaredMethods) {
methodsAsString.add(method.toString());
}
- String[] declaredMethodsThatShouldExists = getJavaVersion() < 7 ? declaredMethodsThatShouldExists_jdk6 : declaredMethodsThatShouldExists_jdk7;
+
+ String[] declaredMethodsThatShouldExist = getJavaVersion() < 7 ? declaredMethodsThatShouldExist_jdk6 : declaredMethodsThatShouldExist_jdk7;
// check if all required methods really exists
- for (String methodThatShouldExists : declaredMethodsThatShouldExists) {
+ for (String methodThatShouldExists : declaredMethodsThatShouldExist) {
assertTrue(methodsAsString.contains(methodThatShouldExists),
"declared method " + methodThatShouldExists + " not found");
}
@@ -589,6 +600,29 @@
}
/**
+ * Test for method javax.script.SimpleScriptContext.getClass().getAnnotation()
+ */
+ protected void testGetAnnotation() {
+ Annotation annotation;
+ annotation = this.simpleScriptContextClass.getAnnotation(java.lang.annotation.Annotation.class);
+ assertNull(annotation, "annotation java.lang.annotation.Annotation should not be returned");
+ annotation = this.simpleScriptContextClass.getAnnotation(java.lang.annotation.Documented.class);
+ assertNull(annotation, "annotation java.lang.annotation.Documented should not be returned");
+ annotation = this.simpleScriptContextClass.getAnnotation(java.lang.annotation.Inherited.class);
+ assertNull(annotation, "annotation java.lang.annotation.Inherited should not be returned");
+ annotation = this.simpleScriptContextClass.getAnnotation(java.lang.annotation.Retention.class);
+ assertNull(annotation, "annotation java.lang.annotation.Retention should not be returned");
+ annotation = this.simpleScriptContextClass.getAnnotation(java.lang.annotation.Target.class);
+ assertNull(annotation, "annotation java.lang.annotation.Target should not be returned");
+ annotation = this.simpleScriptContextClass.getAnnotation(java.lang.Deprecated.class);
+ assertNull(annotation, "annotation java.lang.Deprecated should not be returned");
+ annotation = this.simpleScriptContextClass.getAnnotation(java.lang.Override.class);
+ assertNull(annotation, "annotation java.lang.Override should not be returned");
+ annotation = this.simpleScriptContextClass.getAnnotation(java.lang.SuppressWarnings.class);
+ assertNull(annotation, "annotation java.lang.SuppressWarnings should not be returned");
+ }
+
+ /**
* Test for instanceof operator applied to a class javax.script.SimpleScriptContext
*/
@SuppressWarnings("cast")
From ptisnovs at icedtea.classpath.org Tue Jan 8 02:43:17 2013
From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org)
Date: Tue, 08 Jan 2013 10:43:17 +0000
Subject: /hg/gfx-test: Four helper methods used by bitmap-related tests a...
Message-ID:
changeset 7d09ee4ca61e in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=7d09ee4ca61e
author: Pavel Tisnovsky
date: Tue Jan 08 11:46:26 2013 +0100
Four helper methods used by bitmap-related tests added into CommonBitmapOperations.java.
diffstat:
ChangeLog | 7 +
src/org/gfxtest/framework/CommonBitmapOperations.java | 107 +++++++++++++++++-
src/org/gfxtest/framework/ImageFactory.java | 2 +-
3 files changed, 114 insertions(+), 2 deletions(-)
diffs (148 lines):
diff -r f58d79d0af5e -r 7d09ee4ca61e ChangeLog
--- a/ChangeLog Mon Jan 07 11:45:55 2013 +0100
+++ b/ChangeLog Tue Jan 08 11:46:26 2013 +0100
@@ -1,3 +1,10 @@
+2013-01-08 Pavel Tisnovsky
+
+ * src/org/gfxtest/framework/CommonBitmapOperations.java:
+ Four helper methods used by bitmap-related tests added.
+ * src/org/gfxtest/framework/ImageFactory.java:
+ Updated (c) year.
+
2013-01-07 Pavel Tisnovsky
* src/org/gfxtest/framework/ImageFactory.java:
diff -r f58d79d0af5e -r 7d09ee4ca61e src/org/gfxtest/framework/CommonBitmapOperations.java
--- a/src/org/gfxtest/framework/CommonBitmapOperations.java Mon Jan 07 11:45:55 2013 +0100
+++ b/src/org/gfxtest/framework/CommonBitmapOperations.java Tue Jan 08 11:46:26 2013 +0100
@@ -1,7 +1,7 @@
/*
Java gfx-test framework
- Copyright (C) 2010, 2011, 2012 Red Hat
+ Copyright (C) 2010, 2011, 2012, 2013 Red Hat
This file is part of IcedTea.
@@ -1409,4 +1409,109 @@
// BitBlt with custom scaling
return performBitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
}
+
+ /**
+ * Create new buffered image containing horizontal grayscale 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 doBitBltTestWithHorizontalGrayscaleGradientImage(TestImage image, Graphics2D graphics2d, int imageType)
+ {
+ // create new buffered bitmap with given type
+ BufferedImage bufferedImage = ImageFactory.createHorizontalGrayscaleGradientImage(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 grayscale 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 doBitBltTestWithHorizontalGrayscaleGradientImage(TestImage image, Graphics2D graphics2d, int imageType,
+ int width, int height)
+ {
+ // create new buffered bitmap with given type
+ BufferedImage bufferedImage = ImageFactory.createHorizontalGrayscaleGradientImage(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 grayscale 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 doBitBltTestWithVerticalGrayscaleGradientImage(TestImage image, Graphics2D graphics2d, int imageType)
+ {
+ // create new buffered bitmap with given type
+ BufferedImage bufferedImage = ImageFactory.createVerticalGrayscaleGradientImage(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 grayscale 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 doBitBltTestWithVerticalGrayscaleGradientImage(TestImage image, Graphics2D graphics2d, int imageType,
+ int width, int height)
+ {
+ // create new buffered bitmap with given type
+ BufferedImage bufferedImage = ImageFactory.createVerticalGrayscaleGradientImage(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;
+ }
+
}
diff -r f58d79d0af5e -r 7d09ee4ca61e src/org/gfxtest/framework/ImageFactory.java
--- a/src/org/gfxtest/framework/ImageFactory.java Mon Jan 07 11:45:55 2013 +0100
+++ b/src/org/gfxtest/framework/ImageFactory.java Tue Jan 08 11:46:26 2013 +0100
@@ -1,7 +1,7 @@
/*
Java gfx-test framework
- Copyright (C) 2010, 2011, 2012 Red Hat
+ Copyright (C) 2010, 2011, 2012, 2013 Red Hat
This file is part of IcedTea.
From jvanek at redhat.com Tue Jan 8 07:54:05 2013
From: jvanek at redhat.com (Jiri Vanek)
Date: Tue, 08 Jan 2013 16:54:05 +0100
Subject: [rfc][icedtea-web] centre of dialogues to centre of active monitor
Message-ID: <50EC411D.9010702@redhat.com>
All dialogues in ITW are centred into middle of ALL monitors, which is really nasty.
During splashscreen development I have centred into middle of default screen. Well better but not perfect.
That time Omair suggested to centr into middle of active screen - active here is the one where is cursor.
Well I have finally come with something like this:)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: centeringOfDialogs.patch
Type: text/x-patch
Size: 10985 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130108/f21c9c6b/centeringOfDialogs.patch
From jvanek at redhat.com Tue Jan 8 07:58:17 2013
From: jvanek at redhat.com (Jiri Vanek)
Date: Tue, 08 Jan 2013 16:58:17 +0100
Subject: [rfc][icedtea-web] fixinf of desktop icon behaviour
In-Reply-To: <50E46AF4.10702@redhat.com>
References: <50D488DC.4000507@redhat.com> <50D49692.7050007@zafena.se> <50D4B0AD.2030309@redhat.com> <50D8615D.5080708@redhat.com>
<50D8C05C.80501@redhat.com> <50DDD3B8.2080606@redhat.com>
<50E46AF4.10702@redhat.com>
Message-ID: <50EC4219.3000008@redhat.com>
On 01/02/2013 06:14 PM, Jiri Vanek wrote:
> On 12/28/2012 06:15 PM, Adam Domurad wrote:
>> On 12/24/2012 03:51 PM, Jiri Vanek wrote:
>>> On 12/24/2012 03:06 PM, Jiri Vanek wrote:
>>>> On 12/21/2012 07:55 PM, Jiri Vanek wrote:
>>>>> On 12/21/2012 06:04 PM, Xerxes R?nby wrote:
>>>>>> 2012-12-21 17:05, Jiri Vanek skrev:
>>>>>>> Hi! This is fix for http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725 - JNLP
>>>>>>> applications will prompt for creating desktop shortcuts every time they are run
>>>>>>>
>>>>>>> When I have seen Omairs original patch it was too much complicated, So I want at least to try
>>>>>>> this one.
>>>>>>> It is pretty simple. The disadvantage however is:
>>>>>>> + public File getFinalLinuxDesktopIconFile() {
>>>>>>> + return new
>>>>>>> File(System.getProperty("user.home")+"/Desktop/"+getDesktopIconFinalName()+".desktop");
>>>>>>> + }
>>>>>>>
>>>>>>> to be dependent on System.getProperty("user.home")+"/Desktop/" and .desktop suffix.
>>>>>>>
>>>>>>> However .. can it be enough?
>>>>>>>
>>>>>>> The second patch is for testing purposes of this case which I would like to push forward as
>>>>>>> soon as possible.
>>>>>>>
>>>>>>> J.
>>>>>>
>>>>>> This will be broken on non-english systems.
>>>>>>
>>>>>> The name of the Desktop folder gets localized on many distributions.
>>>>>> For example the Desktop folder is called Skrivbord on Swedish user systems.
>>>>>> The configuration of the user desktop folder location is set in the
>>>>>> ~/.config/user-dirs.dirs
>>>>>>
>>>>>> On my system this file contains:
>>>>>> xranby at xranby-ESPRIMO-P7935:~/.config$ cat user-dirs.dirs
>>>>>> # This file is written by xdg-user-dirs-update
>>>>>> # If you want to change or add directories, just edit the line you're
>>>>>> # interested in. All local changes will be retained on the next run
>>>>>> # Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
>>>>>> # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
>>>>>> # absolute path. No other format is supported.
>>>>>> #
>>>>>> XDG_DESKTOP_DIR="$HOME/Skrivbord"
>>>>>> XDG_DOWNLOAD_DIR="$HOME/H?mtningar"
>>>>>> XDG_TEMPLATES_DIR="$HOME/Mallar"
>>>>>> XDG_PUBLICSHARE_DIR="$HOME/Publikt"
>>>>>> XDG_DOCUMENTS_DIR="$HOME/Dokument"
>>>>>> XDG_MUSIC_DIR="$HOME/Musik"
>>>>>> XDG_PICTURES_DIR="$HOME/Bilder"
>>>>>> XDG_VIDEOS_DIR="$HOME/Video"
>>>>>>
>>>>>
>>>>> I see.. This is very valid point and I have hoped to hear something like this.
>>>>> Do you think it is correct to get this information from ~/.config/user-dirs.dirs ?
>>>>> It sound good enough to me to parse it... As it is standartized in freedesktop.org.
>>>>>
>>>>> Thanx for reply,
>>>>>
>>>>> J.
>>>>
>>>> So here is improved version which is parsing fro ~/.config/user-dirs.dirs.
>>>>
>>>> J.
>>>
>>>
>>> This is little bit better and is taking care for all possible variables. Instead all this parsing
>>> and substitutions simple exec of echo $(xdg-user-dir DESKTOP) is possible. And it maybe more
>>> bullet proof. However I would like avoid Sytem.exec wheres possible.
>>>
>>> J.
>>>
>>
>> thanks, comments inline
>>
>>> diff -r a16da8b96a0f netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java
> ...
>>> return iconSize;
>>> }
>>>
>>> + public File getShortcutTmpFile() {
>>> + File shortcutFile = new
>>> File(JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_USER_TMP_DIR) +
>>> File.separator + FileUtils.sanitizeFileName(file.getTitle()) + ".desktop");
>>
>> bit of a mouthful, a temporary variable here for the user directory would be good.
>
> as you wish
>
>>
>>> + return shortcutFile;
>>> + }
>>> +
>>> /**
>>> * Set the icon size to use for the desktop shortcut
>>> *
>>> @@ -148,9 +162,7 @@
>>> * Install this XDesktopEntry into the user's desktop as a launcher
>>> */
>>> private void installDesktopLauncher() {
>>> - File shortcutFile = new File(JNLPRuntime.getConfiguration()
>>> - .getProperty(DeploymentConfiguration.KEY_USER_TMP_DIR)
>>> - + File.separator + FileUtils.sanitizeFileName(file.getTitle()) + ".desktop");
>>> + File shortcutFile = getShortcutTmpFile();
>>> try {
>>>
>>> if (!shortcutFile.getParentFile().isDirectory() &&
>>> !shortcutFile.getParentFile().mkdirs()) {
>>> @@ -234,4 +246,80 @@
>>> }
>>> }
>>>
>>> + public String getDesktopIconFinalName() {
>>
>
> as you wish :)
>
>> I don't understand what is 'final' about it ? Why can it simply not be called the icon name?
>>
>>> + return sanitize(file.getTitle());
>>> + }
>>> +
>>> + public File getFinalLinuxDesktopIconFile() {
>>
>> Similarly I don't understand what makes this the final linux desktop icon file, vs
>> 'getLinuxDesktopIconFile'
>
> similarly O:)
>
>>
>>> + return new File(findFreedesktopOrgDesktopPathCatch() + getDesktopIconFinalName() +
>>> ".desktop");
>>> + }
>>> +
>>> + public static String findFreedesktopOrgDesktopPathCatch() {
>>
>> I'm all for splitting into many small methods, but I don't know how I feel about
>> findFreedesktopOrgDesktopPathCatch, findFreedesktopOrgDesktopPath, getFreedesktopOrgDesktopPathFrom
>> all being public, separate methods. I think just inlining all the logic into one
>> findFreedesktopOrgDesktopPath() method suffices, also the name 'findFreedesktopOrgDesktopPathCatch'
>> says too much about the implementation IMO.
>>
>>> + try {
>>> + return findFreedesktopOrgDesktopPath();
>>> + } catch (Exception ex) {
>>
>> I think catching Exception is (almost) always a bad idea, it can silence even array-out-of-bounds. I
>> think IOException suffices.
>
> I really would like to have this cas safe block. However I have added printStackTrace.
>
>>
>>> + return System.getProperty("user.home") + "/Desktop/";
>>> + }
>>> + }
>>> +
>>> + public static String findFreedesktopOrgDesktopPath() throws IOException {
>>> + File userDirs = new File(System.getProperty("user.home") + "/.config/user-dirs.dirs");
>>> + if (!userDirs.exists()) {
>>> + return System.getProperty("user.home") + "/Desktop/";
>>> + }
>>> + return getFreedesktopOrgDesktopPathFrom(userDirs);
>>> + }
>>> +
>>> + public static String getFreedesktopOrgDesktopPathFrom(File userDirs) throws IOException {
>>> + BufferedReader r = new BufferedReader(new FileReader(userDirs));
>>> + try {
>>> + return getFreedesktopOrgDesktopPathFrom(r);
>>> + } finally {
>>> + r.close();
>>> + }
>>> +
>>> + }
>>> +
>>> + public static final String XDG_DESKTOP_DIR = "XDG_DESKTOP_DIR";
>>> +
>>> + public static String getFreedesktopOrgDesktopPathFrom(BufferedReader r) throws IOException {
>>
>> This is a helper method and shouldn't be public IMO.
>
> As much of this methods as possible have been made private. Except this one :)
> To keep it testable I let it package private.
>>
>>> + while (true) {
>>> + String s = r.readLine();
>>> + if (s == null) {
>>> + throw new IOException("End of user-dirs found, but no " + XDG_DESKTOP_DIR + " key
>>> found");
>>> + }
>>> + s = s.trim();
>>> + if (s.startsWith(XDG_DESKTOP_DIR)) {
>>> + if (!s.contains("=")) {
>>> + throw new IOException(XDG_DESKTOP_DIR + " have no value");
>>
>> s/have/has/
>
> thanks.
>
>>
>>> + }
>>> + String[] ss = s.split("=");
>>
>> rename 'ss' to 'keyvalue' or something, and the reason ss[1] is used will be clearer IMO.
>
> done. To keyAndvalue
>>
>>> + ss[1] = ss[1].trim();
>>> + return evaluateVariables(ss[1]);
>>> + }
>>> + }
>>> + }
>>> +
>>> + private static String evaluateVariables(String orig) {
>>> +
>>> + Set> env = System.getenv().entrySet();
>>> + List> envVariables = new ArrayList> (env);
>>> + Collections.sort(envVariables, new Comparator>(){
>>> +
>>> + @Override
>>> + public int compare(Entry o1, Entry o2) {
>>> + return o2.getKey().length()-o1.getKey().length();
>>> + }
>>> + });
>>> + while (true) {
>>> + String before = orig;
>>> + for (Entry entry : envVariables) {
>>> + orig=orig.replaceAll("\\$"+entry.getKey(), entry.getValue());
>>> + }
>>> + if (before.equals(orig)) {
>>> + return orig;
>>> + }
>>> + }
>>> +
>>> + }
>>> }
>>> diff -r a16da8b96a0f tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java
>>> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
>>> +++ b/tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java Mon Dec 24 21:38:14 2012
>>> +0100
>>> @@ -0,0 +1,59 @@
>>> +/*
>>> + * To change this template, choose Tools | Templates
>>> + * and open the template in the editor.
>>> + */
>>
>> Netbeans user are you ? Anyway this should be gone.
>
> Argh... Added correct header.
>>
>>> +package net.sourceforge.jnlp.util;
>>> +
>>> +import java.io.BufferedReader;
>>> +import java.io.IOException;
>>> +import java.io.StringReader;
>>> +import org.junit.Assert;
>>> +import org.junit.Test;
>>> +
>>> +public class XDesktopEntryTest {
>>> +
>>> + private String des1 = "/my/little/Desktop";
>>> + private String des2name = "Plocha";
>>> + private String des2Res = System.getProperty("user.home") + "/" + des2name;
>>> + private String des2 = "$HOME" + "/" + des2name;
>>> + private String src1 = XDesktopEntry.XDG_DESKTOP_DIR + "=" + des1;
>>> + private String src2 = " " + XDesktopEntry.XDG_DESKTOP_DIR + " = " + des1;
>>> + private String src3 = "#" + XDesktopEntry.XDG_DESKTOP_DIR + " = " + des1;
>>> + private String src4 = XDesktopEntry.XDG_DESKTOP_DIR + "=" + des2;
>>> + private String src5 = " " + XDesktopEntry.XDG_DESKTOP_DIR + " = " + des2;
>>> + private String src6 = "#" + XDesktopEntry.XDG_DESKTOP_DIR + " = " + des2;
>>> +
>>> + @Test
>>> + public void getFreedesktopOrgDesktopPathFromtestSimple() throws IOException {
>>> + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new
>>> StringReader(src1)));
>>> + Assert.assertEquals(s, des1);
>>> + }
>>> +
>>> + @Test
>>> + public void getFreedesktopOrgDesktopPathFromtestSpaced() throws IOException {
>>> + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new
>>> StringReader(src2)));
>>> + Assert.assertEquals(s, des1);
>>> + }
>>> +
>>> + @Test(expected = IOException.class)
>>> + public void getFreedesktopOrgDesktopPathFromtestCommented() throws IOException {
>>> + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new
>>> StringReader(src3)));
>>> + }
>>> +
>>> + @Test
>>> + public void getFreedesktopOrgDesktopPathFromtestSimpleWithHome() throws IOException {
>>> + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new
>>> StringReader(src4)));
>>> + Assert.assertEquals(s, des2Res);
>>> + }
>>> +
>>> + @Test
>>> + public void getFreedesktopOrgDesktopPathFromtestSpacedWithHome() throws IOException {
>>> + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new
>>> StringReader(src5)));
>>> + Assert.assertEquals(s, des2Res);
>>> + }
>>> +
>>> + @Test(expected = IOException.class)
>>> + public void getFreedesktopOrgDesktopPathFromtestCommentedWithHome() throws IOException {
>>> + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new
>>> StringReader(src6)));
>>> + }
>>> +}
>>
>> Test looks OK
>
> of course :)
>
>>
>> Just one additional comment, as Omair pointed out his patch had nice functionality when a desktop
>> icon was deleted (it did not prompt again for desktop icon to be created). It is worth considering.
>
> See the separate sub-thread oook? Especially last record - http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2013-January/021278.html (Unless Omair will somehow negate it.
>
ping?
> Thank you very much for review!
> J.
From jvanek at redhat.com Tue Jan 8 08:06:38 2013
From: jvanek at redhat.com (Jiri Vanek)
Date: Tue, 08 Jan 2013 17:06:38 +0100
Subject: [rfc][icedtea-web] make download indicator more compact
In-Reply-To: <50EB1B33.4020605@redhat.com>
References: <50E5ACDF.7080609@redhat.com> <50E704C5.4060300@redhat.com>
<50EADE9F.3000101@redhat.com> <50EB1B33.4020605@redhat.com>
Message-ID: <50EC440E.2080409@redhat.com>
On 01/07/2013 08:00 PM, Adam Domurad wrote:
> On 01/07/2013 09:41 AM, Jiri Vanek wrote:
>> On 01/04/2013 05:35 PM, Adam Domurad wrote:
>>> On 01/03/2013 11:07 AM, Jiri Vanek wrote:
>>>> Hi!
>>>>
>>>> This patch is adding "show details" to download indicator. For One jar jnlp files it behaviour is
>>>> unaffected. For Multiple jars there is just one progress bar, but can be shown "old stile"
>>>> detailed one via clicking to "Show details". Then can be minimalised by "hide details". Button is
>>>> localised.
>>>>
>>>> The button is nasty not nice.. Any better idea? but still this is better then previous approach.
>>>>
>>>> Looking forward to have this inside!
>>>>
>>>> Best rigards
>>>> J.
>>>
>>> Thanks for looking into this! I was actually comparing our download indicator to proprietary just
>>> yesterday, while staring at multiple jars downloading. The average user does not want to know about
>>> the jars being downloaded, in fact I think such information can look scary :-).
>>>
>>>> diff -r 9549226afa8f netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java
>>>> --- a/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java Thu Jan 03 09:54:16 2013 +0100
>>>> +++ b/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java Thu Jan 03 17:07:28 2013 +0100
>>>> @@ -62,6 +62,7 @@
>>>>
>>>> /** shared constraint */
>>>> static GridBagConstraints vertical;
>>>> + static GridBagConstraints verticalNoClean;
>>>> static GridBagConstraints verticalIndent;
>>>> static {
>>>> vertical = new GridBagConstraints();
>>>> @@ -70,8 +71,12 @@
>>>> vertical.fill = GridBagConstraints.HORIZONTAL;
>>>> vertical.anchor = GridBagConstraints.WEST;
>>>>
>>>> + verticalNoClean = new GridBagConstraints();
>>>> + verticalNoClean.weightx = 1.0;
>>>> +
>>>> verticalIndent = (GridBagConstraints) vertical.clone();
>>>> verticalIndent.insets = new Insets(0, 10, 3, 0);
>>>> +
>>>
>>> Nit: These two blank lines (and all the ones added below) have tabs :-)
>>>
>>>> }
>>>>
>>>> /**
>>>> @@ -114,15 +119,15 @@
>>>>
>>>> frame.getContentPane().add(result, vertical);
>>>> frame.pack();
>>>> -
>>>> if (!frame.isVisible()) {
>>>> - Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
>>>> - Insets insets =
>>>> Toolkit.getDefaultToolkit().getScreenInsets(frame.getGraphicsConfiguration());
>>>> - Dimension screen = new Dimension(screenSize.width - insets.left,
>>>> - screenSize.height - insets.top);
>>>> - frame.setLocation(screen.width - frame.getWidth(),
>>>> - screen.height - frame.getHeight());
>>>> + placeFrameToLowerRight();
>>>> }
>>>> + result.addComponentListener(new ComponentAdapter() {
>>>> + @Override
>>>> + public void componentResized(ComponentEvent e) {
>>>> + placeFrameToLowerRight();
>>>> + }
>>>> + });
>>>>
>>>> frame.setVisible(true);
>>>>
>>>> @@ -131,6 +136,32 @@
>>>> }
>>>>
>>>> /**
>>>> + * The insets are calculated differently during first appearance
>>>> + * and during another appearance in case of some configurations.
>>>> + *
>>>> + * So the first value is stored to avoid jumping of window during later packing
>>>> + * of frame.
>>>> + *
>>>> + * However the second calculation is more correct:(
>>>> + *
>>>> + * This is affecting only multiple monitors which have different assets.
>>>> + * The underlying issue is that Toolkit.getDefaultToolkit().getScreenInsets
>>>> + * is returning assets for "random" monitor.
>>>> + */
>>>> + Dimension screen = null;
>>>> +
>>>> + private void placeFrameToLowerRight() throws HeadlessException {
>>>> + if (screen == null) {
>>>> + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
>>>> + Insets insets =
>>>> Toolkit.getDefaultToolkit().getScreenInsets(frame.getGraphicsConfiguration());
>>>> + screen = new Dimension(screenSize.width - insets.left,
>>>> + screenSize.height - insets.top);
>>>> + }
>>>> + frame.setLocation(screen.width - frame.getWidth(),
>>>> + screen.height - frame.getHeight());
>>>> + }
>>>> +
>>>> + /**
>>>> * Remove a download service listener that was obtained by
>>>> * calling the getDownloadListener method from the shared
>>>> * download info window.
>>>> @@ -163,12 +194,26 @@
>>>> * Groups the url progress in a panel.
>>>> */
>>>> static class DownloadPanel extends JPanel implements DownloadServiceListener {
>>>> -
>>>> + private static enum States{
>>>> + oneJAr, collapsed, detailed;
>>>
>>> Enums should be all-caps
>>>
>>>> +
>>>> + }
>>>> +
>>>> + private static final String DETAILS=R("ButShowDetails");
>>>> + private static final String HIDE_DETAILS=R("ButHideDetails");
>>>> /** the download name */
>>>> private String downloadName;
>>>>
>>>> /** Downloading part: */
>>>> private JLabel header = new JLabel();
>>>> + /** Show/hide details button: */
>>>> + private JButton details = new JButton(DETAILS);
>>>> + /** used instead of details button in case of one jar*/
>>>> + private JLabel delimiter = new JLabel("");
>>>> + /** all already created progress bars*/
>>>> + private List progressPanels = new ArrayList();
>>>> + private States state=States.oneJAr;
>>>> + private ProgressPanel mainProgressPanel;
>>>>
>>>> /** list of URLs being downloaded */
>>>> private List urls = new ArrayList();
>>>> @@ -176,6 +221,7 @@
>>>> /** list of ProgressPanels */
>>>> private List panels = new ArrayList();
>>>>
>>>> +
>>>
>>> Nit: two blank lines are unnecessary.
>>>
>>>> /**
>>>> * Create a new download panel for with the specified download
>>>> * name.
>>>> @@ -184,9 +230,35 @@
>>>> setLayout(new GridBagLayout());
>>>>
>>>> this.downloadName = downloadName;
>>>> - this.add(header, vertical);
>>>> + this.add(header, verticalNoClean);
>>>> header.setFont(header.getFont().deriveFont(Font.BOLD));
>>>> -
>>>> + this.add(delimiter, vertical);
>>>> + details.addActionListener(new ActionListener() {
>>>> + @Override
>>>> + public void actionPerformed(ActionEvent e) {
>>>> + if (state == States.detailed) {
>>>> + state = States.collapsed;
>>>> + details.setText(DETAILS);
>>>> + for (ProgressPanel progressPanel : progressPanels) {
>>>> + remove(progressPanel);
>>>> + }
>>>> + add(mainProgressPanel, verticalIndent);
>>>> + synchronized (frameMutex) {
>>>> + frame.pack();
>>>> + }
>>>> + } else {
>>>> + state = States.detailed;
>>>> + details.setText(HIDE_DETAILS);
>>>> + remove(mainProgressPanel);
>>>> + for (ProgressPanel progressPanel : progressPanels) {
>>>> + add(progressPanel, verticalIndent);
>>>> + }
>>>> + synchronized (frameMutex) {
>>>> + frame.pack();
>>>> + }
>>>> + }
>>>> + }
>>>> + });
>>>> setOverallPercent(0);
>>>> }
>>>>
>>>> @@ -196,14 +268,25 @@
>>>> protected void addProgressPanel(URL url, String version) {
>>>> if (!urls.contains(url)) {
>>>> ProgressPanel panel = new ProgressPanel(url, version);
>>>> -
>>>> - add(panel, verticalIndent);
>>>> + if (state != States.collapsed) {
>>>> + add(panel, verticalIndent);
>>>> + }
>>>> + progressPanels.add(panel);
>>>> + urls.add(url);
>>>> + panels.add(panel);
>>>> + if (panels.size() == 2){
>>>
>>> Small comment here would be good explaining why this 'magic number'
>>>
>>>> + remove(panels.get(0));
>>>> + remove(panels.get(1));
>>>> + remove(delimiter);
>>>> + add(details,vertical);
>>>> + mainProgressPanel=new ProgressPanel();
>>>> + add(mainProgressPanel, verticalIndent);
>>>> + state=States.collapsed;
>>>> + }
>>>> synchronized (frameMutex) {
>>>> frame.pack();
>>>> }
>>>>
>>>> - urls.add(url);
>>>> - panels.add(panel);
>>>> }
>>>> }
>>>>
>>>> @@ -219,10 +302,10 @@
>>>> addProgressPanel(url, version);
>>>>
>>>> setOverallPercent(overallPercent);
>>>> -
>>>> ProgressPanel panel = panels.get(urls.indexOf(url));
>>>> panel.setProgress(readSoFar, total);
>>>> panel.repaint();
>>>> +
>>>> }
>>>> };
>>>> SwingUtilities.invokeLater(r);
>>>> @@ -230,12 +313,28 @@
>>>>
>>>> /**
>>>> * Sets the overall percent completed.
>>>> + * should be called via invokeLater
>>>> */
>>>> public void setOverallPercent(int percent) {
>>>> // don't get whole string from resource and sub in
>>>> // values because it'll be doing a MessageFormat for
>>>> // each update.
>>>> header.setText(downloading + " " + downloadName + ": " + percent + "% " + complete +
>>>> ".");
>>>> + Container c = header.getParent();
>>>> + //we need to adapt nbboth panels and also frame to new length of header text
>>>
>>> nbboth > both
>>>
>>>> + while (c != null) {
>>>> + c.invalidate();
>>>> + c.validate();
>>>> + if (c instanceof Window){
>>>> + ((Window) c).pack();
>>>> + }
>>>> + c=c.getParent();
>>>> + }
>>>> +
>>>> + if (mainProgressPanel != null) {
>>>> + mainProgressPanel.setProgress(percent, 100);
>>>> + mainProgressPanel.repaint();
>>>> + }
>>>> }
>>>>
>>>> /**
>>>> @@ -276,12 +375,28 @@
>>>>
>>>> private long total;
>>>> private long readSoFar;
>>>> + private Dimension size = new Dimension(80, 15);
>>>>
>>>> + ProgressPanel() {
>>>> + bar.setMinimumSize(size);
>>>> + bar.setPreferredSize(size);
>>>> + bar.setOpaque(false);
>>>> +
>>>> + setLayout(new GridBagLayout());
>>>> +
>>>> + GridBagConstraints gbc = new GridBagConstraints();
>>>> + styleGridBagConstraints(gbc);
>>>> + add(bar, gbc);
>>>> + }
>>>> +
>>>> ProgressPanel(URL url, String version) {
>>>> - JLabel location = new JLabel(" " + url.getHost() + "/" + url.getFile());
>>>> + this(" " + url.getHost() + "/" + url.getFile(),version);
>>>> + }
>>>> + ProgressPanel(String caption, String version) {
>>>> + JLabel location = new JLabel(caption);
>>>>
>>>> - bar.setMinimumSize(new Dimension(80, 15));
>>>> - bar.setPreferredSize(new Dimension(80, 15));
>>>> + bar.setMinimumSize(size);
>>>> + bar.setPreferredSize(size);
>>>> bar.setOpaque(false);
>>>>
>>>> setLayout(new GridBagLayout());
>>>> @@ -291,12 +406,8 @@
>>>> gbc.fill = GridBagConstraints.NONE;
>>>> gbc.gridwidth = GridBagConstraints.RELATIVE;
>>>> add(bar, gbc);
>>>> -
>>>> - gbc.insets = new Insets(0, 3, 0, 0);
>>>> - gbc.weightx = 1.0;
>>>> - gbc.fill = GridBagConstraints.HORIZONTAL;
>>>> - gbc.gridwidth = GridBagConstraints.REMAINDER;
>>>> - gbc.anchor = GridBagConstraints.WEST;
>>>> +
>>>> + styleGridBagConstraints(gbc);
>>>> add(location, gbc);
>>>> }
>>>>
>>>> @@ -325,6 +436,14 @@
>>>> g.fillRect(x + 1, y + 1, divide - 1, h - 1);
>>>> }
>>>> }
>>>> +
>>>> + private void styleGridBagConstraints(GridBagConstraints gbc) {
>>>> + gbc.insets = new Insets(0, 3, 0, 0);
>>>> + gbc.weightx = 1.0;
>>>> + gbc.fill = GridBagConstraints.HORIZONTAL;
>>>> + gbc.gridwidth = GridBagConstraints.REMAINDER;
>>>> + gbc.anchor = GridBagConstraints.WEST;
>>>> + }
>>>> };
>>>>
>>>> }
>>>
>>> Code looks OK nits aside.
>>
>> Thanx for nits. Should be fixed now
>>>
>>> As for button ... yes it is nasty. IMO maybe we can take different approach here. The people
>>> interested in how the individual jars are downloading would mainly be 1. us trying to fix jar
>>> loading issues, 2. developers looking into jar loading issues.
>>>
>>> So what if the ICEDTEAPLUGIN_DEBUG environment variable turned this on/off ? It can be argued it is
>>> a bit hard for developers to access, but it isn't any easier to access this information from oracle
>>> plugin.
>>
>> I think I don't like this idea :(
>
> No problem, but can you elaborate why not?
When it took to long to downld application, I'm happy to see whats going on. Maybe I can spot some 3rd party jar to be stuck and then I can ping them. And I definitely do not want to look for environmetn variables.
>
>> I have added an attempt to use an icon, And I must say it is much better. Btw, I have created this icon.. so no wonders here :) But looks quite cool :)
>
> It looks OK :-) The glass part could use some transparency.
blah :)
> There should be a slightly different icon from going from detailed ->compact.
As you wish, however, I do not like the red cross I have added :(
>
>>
>>>
>>> As well, I would be very happy to see the loading bar integrated with the splash screen (if splash
>>> screen is on). I believe this would nicely complement the user friendliness of the splash screen.
>>
>> You mean to sync progress on progress bar with the one in splash? Or also showing the downlaoded resources somehow and show details button in splash?
>
> I was thinking always have progress bar on splash, and have detailed view hide/show the download bars in corner. IMO this is good for now, except:
I agree. It can came in some future.
> 1. visual glitches such as http://i.imgur.com/Oveuh.png (with text flickering from middle to top every frame). As well on dual monitors expanding/compacting view constantly changed screens for me.
Well I was not able to reproduce today :-/
However I have changed the implementation and So I hope that it will behave better in your configuration.
Please note, now this patch is depending on [rfc][icedtea-web] centre of dialogues to centre of active monitor.
Sorry for inconvenience here:(
> 2. A different style button/icon from going detailed->compact.
How different? (in context of this patch/in global)?
yah, happy hacking :)
J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: magnifyGlass-small.png
Type: image/png
Size: 1008 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130108/ee79310d/magnifyGlass-small.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: redCross-small.png
Type: image/png
Size: 930 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130108/ee79310d/redCross-small.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmpactDownloadIndicator.patch
Type: text/x-patch
Size: 12557 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130108/ee79310d/cmpactDownloadIndicator.patch
From bugzilla-daemon at icedtea.classpath.org Tue Jan 8 18:04:51 2013
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Wed, 09 Jan 2013 02:04:51 +0000
Subject: [Bug 1250] New: In Minecraft I set tnt off and the server crashes.
Why?
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1250
Bug ID: 1250
Summary: In Minecraft I set tnt off and the server crashes.
Why?
Classification: Unclassified
Product: IcedTea
Version: unspecified
Hardware: 64-bit
OS: Linux
Status: NEW
Severity: critical
Priority: P3
Component: IcedTea
Assignee: gnu.andrew at redhat.com
Reporter: dylanjefferyryan at gmail.com
CC: unassigned at icedtea.classpath.org
Created attachment 815
--> http://icedtea.classpath.org/bugzilla/attachment.cgi?id=815&action=edit
This is the error log.
--
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/20130109/a17d5134/attachment.html
From ptisnovs at icedtea.classpath.org Wed Jan 9 01:43:53 2013
From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org)
Date: Wed, 09 Jan 2013 09:43:53 +0000
Subject: /hg/rhino-tests: Added three new tests for methods GetCanonicalN...
Message-ID:
changeset 90f140ca1129 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=90f140ca1129
author: Pavel Tisnovsky
date: Wed Jan 09 10:47:01 2013 +0100
Added three new tests for methods GetCanonicalName(), getAnnotation() and getComponentType() into SimpleBindingsClassTest.java.
diffstat:
ChangeLog | 6 +++
src/org/RhinoTests/SimpleBindingsClassTest.java | 43 ++++++++++++++++++++++++-
2 files changed, 48 insertions(+), 1 deletions(-)
diffs (87 lines):
diff -r 7f25cbe3c551 -r 90f140ca1129 ChangeLog
--- a/ChangeLog Tue Jan 08 10:53:46 2013 +0100
+++ b/ChangeLog Wed Jan 09 10:47:01 2013 +0100
@@ -1,3 +1,9 @@
+2013-01-09 Pavel Tisnovsky
+
+ * src/org/RhinoTests/SimpleBindingsClassTest.java:
+ Added three new tests for methods GetCanonicalName(), getAnnotation() and
+ getComponentType().
+
2013-01-08 Pavel Tisnovsky
* src/org/RhinoTests/SimpleScriptContextClassTest.java:
diff -r 7f25cbe3c551 -r 90f140ca1129 src/org/RhinoTests/SimpleBindingsClassTest.java
--- a/src/org/RhinoTests/SimpleBindingsClassTest.java Tue Jan 08 10:53:46 2013 +0100
+++ b/src/org/RhinoTests/SimpleBindingsClassTest.java Wed Jan 09 10:47:01 2013 +0100
@@ -1,7 +1,7 @@
/*
Rhino test framework
- Copyright (C) 2011, 2012 Red Hat
+ Copyright (C) 2011, 2012, 2013 Red Hat
This file is part of IcedTea.
@@ -45,6 +45,7 @@
import java.util.List;
import java.util.Map;
import java.util.HashMap;
+import java.util.TreeMap;
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
@@ -261,6 +262,15 @@
}
/**
+ * Test for method javax.script.SimpleBindings.getClass().getCanonicalName()
+ */
+ protected void testGetCanonicalName() {
+ String canonicalName = this.simpleBindingsClass.getCanonicalName();
+ assertEquals(canonicalName, "javax.script.SimpleBindings",
+ "Method javax.script.SimpleBindings.getClass().getCanonicalName() returns wrong value " + canonicalName);
+ }
+
+ /**
* Test for method javax.script.SimpleBindings.getClass().getSuperclass()
*/
protected void testGetSuperclass() {
@@ -578,6 +588,37 @@
}
/**
+ * Test for method javax.script.SimpleBindings.getClass().getAnnotation()
+ */
+ protected void testGetAnnotation() {
+ Annotation annotation;
+ annotation = this.simpleBindingsClass.getAnnotation(java.lang.annotation.Annotation.class);
+ assertNull(annotation, "annotation java.lang.annotation.Annotation should not be returned");
+ annotation = this.simpleBindingsClass.getAnnotation(java.lang.annotation.Documented.class);
+ assertNull(annotation, "annotation java.lang.annotation.Documented should not be returned");
+ annotation = this.simpleBindingsClass.getAnnotation(java.lang.annotation.Inherited.class);
+ assertNull(annotation, "annotation java.lang.annotation.Inherited should not be returned");
+ annotation = this.simpleBindingsClass.getAnnotation(java.lang.annotation.Retention.class);
+ assertNull(annotation, "annotation java.lang.annotation.Retention should not be returned");
+ annotation = this.simpleBindingsClass.getAnnotation(java.lang.annotation.Target.class);
+ assertNull(annotation, "annotation java.lang.annotation.Target should not be returned");
+ annotation = this.simpleBindingsClass.getAnnotation(java.lang.Deprecated.class);
+ assertNull(annotation, "annotation java.lang.Deprecated should not be returned");
+ annotation = this.simpleBindingsClass.getAnnotation(java.lang.Override.class);
+ assertNull(annotation, "annotation java.lang.Override should not be returned");
+ annotation = this.simpleBindingsClass.getAnnotation(java.lang.SuppressWarnings.class);
+ assertNull(annotation, "annotation java.lang.SuppressWarnings should not be returned");
+ }
+
+ /**
+ * Test for method javax.script.SimpleBindings.getClass().getComponentType()
+ */
+ protected void testGetComponentType() {
+ Class> cls = this.simpleBindingsClass.getComponentType();
+ assertNull(cls, "getComponentType() should returns null");
+ }
+
+ /**
* Test for instanceof operator applied to a class javax.script.SimpleBindings
*/
@SuppressWarnings("cast")
From ptisnovs at icedtea.classpath.org Wed Jan 9 02:07:01 2013
From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org)
Date: Wed, 09 Jan 2013 10:07:01 +0000
Subject: /hg/gfx-test: Added eight new tests to the test suite src/org/gf...
Message-ID:
changeset a243dee26a99 in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=a243dee26a99
author: Pavel Tisnovsky
date: Wed Jan 09 11:10:10 2013 +0100
Added eight new tests to the test suite src/org/gfxtest/testsuites/BitBltUsingBgColor.java.
diffstat:
ChangeLog | 5 +
src/org/gfxtest/testsuites/BitBltUsingBgColor.java | 122 ++++++++++++++++++++-
2 files changed, 126 insertions(+), 1 deletions(-)
diffs (151 lines):
diff -r 7d09ee4ca61e -r a243dee26a99 ChangeLog
--- a/ChangeLog Tue Jan 08 11:46:26 2013 +0100
+++ b/ChangeLog Wed Jan 09 11:10:10 2013 +0100
@@ -1,3 +1,8 @@
+2013-01-09 Pavel Tisnovsky
+
+ * src/org/gfxtest/testsuites/BitBltUsingBgColor.java:
+ Added eight new tests to this test suite.
+
2013-01-08 Pavel Tisnovsky
* src/org/gfxtest/framework/CommonBitmapOperations.java:
diff -r 7d09ee4ca61e -r a243dee26a99 src/org/gfxtest/testsuites/BitBltUsingBgColor.java
--- a/src/org/gfxtest/testsuites/BitBltUsingBgColor.java Tue Jan 08 11:46:26 2013 +0100
+++ b/src/org/gfxtest/testsuites/BitBltUsingBgColor.java Wed Jan 09 11:10:10 2013 +0100
@@ -1,7 +1,7 @@
/*
Java gfx-test framework
- Copyright (C) 2010, 2011, 2012 Red Hat
+ Copyright (C) 2010, 2011, 2012, 2013 Red Hat
This file is part of IcedTea.
@@ -766,6 +766,126 @@
}
/**
+ * Test basic BitBlt operation for empty buffered image with type TYPE_INT_RGB.
+ * 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 testBitBltEmptyBufferedImageTypeIntRGBbackgroundBlack(TestImage image, Graphics2D graphics2d)
+ {
+ return doBitBltEmptyBufferedImageTypeIntRGB(image, graphics2d, Color.black);
+ }
+
+ /**
+ * Test basic BitBlt operation for empty buffered image with type TYPE_INT_RGB.
+ * 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 testBitBltEmptyBufferedImageTypeIntRGBbackgroundBlue(TestImage image, Graphics2D graphics2d)
+ {
+ return doBitBltEmptyBufferedImageTypeIntRGB(image, graphics2d, Color.blue);
+ }
+
+ /**
+ * Test basic BitBlt operation for empty buffered image with type TYPE_INT_RGB.
+ * 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 testBitBltEmptyBufferedImageTypeIntRGBbackgroundGreen(TestImage image, Graphics2D graphics2d)
+ {
+ return doBitBltEmptyBufferedImageTypeIntRGB(image, graphics2d, Color.green);
+ }
+
+ /**
+ * Test basic BitBlt operation for empty buffered image with type TYPE_INT_RGB.
+ * 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 testBitBltEmptyBufferedImageTypeIntRGBbackgroundCyan(TestImage image, Graphics2D graphics2d)
+ {
+ return doBitBltEmptyBufferedImageTypeIntRGB(image, graphics2d, Color.cyan);
+ }
+
+ /**
+ * Test basic BitBlt operation for empty buffered image with type TYPE_INT_RGB.
+ * 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 testBitBltEmptyBufferedImageTypeIntRGBbackgroundRed(TestImage image, Graphics2D graphics2d)
+ {
+ return doBitBltEmptyBufferedImageTypeIntRGB(image, graphics2d, Color.red);
+ }
+
+ /**
+ * Test basic BitBlt operation for empty buffered image with type TYPE_INT_RGB.
+ * 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 testBitBltEmptyBufferedImageTypeIntRGBbackgroundMagenta(TestImage image, Graphics2D graphics2d)
+ {
+ return doBitBltEmptyBufferedImageTypeIntRGB(image, graphics2d, Color.magenta);
+ }
+
+ /**
+ * Test basic BitBlt operation for empty buffered image with type TYPE_INT_RGB.
+ * 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 testBitBltEmptyBufferedImageTypeIntRGBbackgroundYellow(TestImage image, Graphics2D graphics2d)
+ {
+ return doBitBltEmptyBufferedImageTypeIntRGB(image, graphics2d, Color.yellow);
+ }
+
+ /**
+ * Test basic BitBlt operation for empty buffered image with type TYPE_INT_RGB.
+ * 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 testBitBltEmptyBufferedImageTypeIntRGBbackgroundWhite(TestImage image, Graphics2D graphics2d)
+ {
+ return doBitBltEmptyBufferedImageTypeIntRGB(image, graphics2d, Color.white);
+ }
+
+ /**
* Entry point to the test suite.
*
* @param args not used in this case
From jvanek at redhat.com Wed Jan 9 02:30:42 2013
From: jvanek at redhat.com (Jiri Vanek)
Date: Wed, 09 Jan 2013 11:30:42 +0100
Subject: More troubles in icedtea-web javascript date hellpers methods
Message-ID: <50ED46D2.8010208@redhat.com>
Every 31th, last day in mont (not 30,not 28/29) ara failing those two tests:
0141 dateRange
0142 dateRange
Well, with closed eyes it is acceptable, however, since 2013 is constantly failing
0131 dateRange
More investigations on todo list ;(
J.
ps: helpers;)
From adomurad at redhat.com Wed Jan 9 06:42:31 2013
From: adomurad at redhat.com (Adam Domurad)
Date: Wed, 09 Jan 2013 09:42:31 -0500
Subject: [rfc][icedtea-web] fixinf of desktop icon behaviour
In-Reply-To: <50E46AF4.10702@redhat.com>
References: <50D488DC.4000507@redhat.com>
<50D49692.7050007@zafena.se> <50D4B0AD.2030309@redhat.com>
<50D8615D.5080708@redhat.com> <50D8C05C.80501@redhat.com>
<50DDD3B8.2080606@redhat.com> <50E46AF4.10702@redhat.com>
Message-ID: <50ED81D7.4020904@redhat.com>
On 01/02/2013 12:14 PM, Jiri Vanek wrote:
> [..snip..]
>>>
>>
>> thanks, comments inline
>>
>>> diff -r a16da8b96a0f
>>> netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java
> ...
>>> return iconSize;
>>> }
>>>
>>> + public File getShortcutTmpFile() {
>>> + File shortcutFile = new
>>> File(JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_USER_TMP_DIR)
>>> +
>>> File.separator + FileUtils.sanitizeFileName(file.getTitle()) +
>>> ".desktop");
>>
>> bit of a mouthful, a temporary variable here for the user directory
>> would be good.
>
> as you wish
>
>>
>>> + return shortcutFile;
>>> + }
>>> +
>>> /**
>>> * Set the icon size to use for the desktop shortcut
>>> *
>>> @@ -148,9 +162,7 @@
>>> * Install this XDesktopEntry into the user's desktop as a
>>> launcher
>>> */
>>> private void installDesktopLauncher() {
>>> - File shortcutFile = new File(JNLPRuntime.getConfiguration()
>>> - .getProperty(DeploymentConfiguration.KEY_USER_TMP_DIR)
>>> - + File.separator +
>>> FileUtils.sanitizeFileName(file.getTitle()) + ".desktop");
>>> + File shortcutFile = getShortcutTmpFile();
>>> try {
>>>
>>> if (!shortcutFile.getParentFile().isDirectory() &&
>>> !shortcutFile.getParentFile().mkdirs()) {
>>> @@ -234,4 +246,80 @@
>>> }
>>> }
>>>
>>> + public String getDesktopIconFinalName() {
>>
>
> as you wish :)
Thanks.
>
>> I don't understand what is 'final' about it ? Why can it simply not
>> be called the icon name?
>>
>>> + return sanitize(file.getTitle());
>>> + }
>>> +
>>> + public File getFinalLinuxDesktopIconFile() {
>>
>> Similarly I don't understand what makes this the final linux desktop
>> icon file, vs
>> 'getLinuxDesktopIconFile'
>
> similarly O:)
>
>>
>>> + return new File(findFreedesktopOrgDesktopPathCatch() +
>>> getDesktopIconFinalName() +
>>> ".desktop");
>>> + }
>>> +
>>> + public static String findFreedesktopOrgDesktopPathCatch() {
>>
>> I'm all for splitting into many small methods, but I don't know how I
>> feel about
>> findFreedesktopOrgDesktopPathCatch, findFreedesktopOrgDesktopPath,
>> getFreedesktopOrgDesktopPathFrom
>> all being public, separate methods. I think just inlining all the
>> logic into one
>> findFreedesktopOrgDesktopPath() method suffices, also the name
>> 'findFreedesktopOrgDesktopPathCatch'
>> says too much about the implementation IMO.
>>
>>> + try {
>>> + return findFreedesktopOrgDesktopPath();
>>> + } catch (Exception ex) {
>>
>> I think catching Exception is (almost) always a bad idea, it can
>> silence even array-out-of-bounds. I
>> think IOException suffices.
>
> I really would like to have this cas safe block. However I have added
> printStackTrace.
>
>>
>>> + return System.getProperty("user.home") + "/Desktop/";
>>> + }
>>> + }
>>> +
>>> + public static String findFreedesktopOrgDesktopPath() throws
>>> IOException {
>>> + File userDirs = new File(System.getProperty("user.home") +
>>> "/.config/user-dirs.dirs");
>>> + if (!userDirs.exists()) {
>>> + return System.getProperty("user.home") + "/Desktop/";
>>> + }
>>> + return getFreedesktopOrgDesktopPathFrom(userDirs);
>>> + }
>>> +
>>> + public static String getFreedesktopOrgDesktopPathFrom(File
>>> userDirs) throws IOException {
>>> + BufferedReader r = new BufferedReader(new
>>> FileReader(userDirs));
>>> + try {
>>> + return getFreedesktopOrgDesktopPathFrom(r);
>>> + } finally {
>>> + r.close();
>>> + }
>>> +
>>> + }
>>> +
>>> + public static final String XDG_DESKTOP_DIR = "XDG_DESKTOP_DIR";
>>> +
>>> + public static String
>>> getFreedesktopOrgDesktopPathFrom(BufferedReader r) throws IOException {
>>
>> This is a helper method and shouldn't be public IMO.
>
> As much of this methods as possible have been made private. Except
> this one :)
> To keep it testable I let it package private.
Yep.
>>
>>> + while (true) {
>>> + String s = r.readLine();
>>> + if (s == null) {
>>> + throw new IOException("End of user-dirs found, but
>>> no " + XDG_DESKTOP_DIR + " key
>>> found");
>>> + }
>>> + s = s.trim();
>>> + if (s.startsWith(XDG_DESKTOP_DIR)) {
>>> + if (!s.contains("=")) {
>>> + throw new IOException(XDG_DESKTOP_DIR + " have
>>> no value");
>>
>> s/have/has/
>
> thanks.
>
>>
>>> + }
>>> + String[] ss = s.split("=");
>>
>> rename 'ss' to 'keyvalue' or something, and the reason ss[1] is used
>> will be clearer IMO.
>
> done. To keyAndvalue
>>
>>> + ss[1] = ss[1].trim();
>>> + return evaluateVariables(ss[1]);
>>> + }
>>> + }
>>> + }
>>> +
>>> + private static String evaluateVariables(String orig) {
>>> +
>>> + Set> env = System.getenv().entrySet();
>>> + List> envVariables = new
>>> ArrayList> (env);
>>> + Collections.sort(envVariables, new Comparator>> String>>(){
>>> +
>>> + @Override
>>> + public int compare(Entry o1,
>>> Entry o2) {
>>> + return o2.getKey().length()-o1.getKey().length();
>>> + }
>>> + });
>>> + while (true) {
>>> + String before = orig;
>>> + for (Entry entry : envVariables) {
>>> + orig=orig.replaceAll("\\$"+entry.getKey(),
>>> entry.getValue());
>>> + }
>>> + if (before.equals(orig)) {
>>> + return orig;
>>> + }
>>> + }
>>> +
>>> + }
>>> }
>>> diff -r a16da8b96a0f
>>> tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java
>>> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
>>> +++
>>> b/tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java
>>> Mon Dec 24 21:38:14 2012
>>> +0100
>>> @@ -0,0 +1,59 @@
>>> +/*
>>> + * To change this template, choose Tools | Templates
>>> + * and open the template in the editor.
>>> + */
>>
>> Netbeans user are you ? Anyway this should be gone.
>
> Argh... Added correct header.
>> [..snip..]
>
>>
>> Just one additional comment, as Omair pointed out his patch had nice
>> functionality when a desktop
>> icon was deleted (it did not prompt again for desktop icon to be
>> created). It is worth considering.
>
> See the separate sub-thread oook? Especially last record -
> http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2013-January/021278.html
> (Unless Omair will somehow negate it.
Noted. Patch is OK as is.
>
> Thank you very much for review!
> J.
Thanks for update.
> diff -r a16da8b96a0f
> netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java
> --- a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Mon
> Dec 24 13:58:31 2012 +0100
> +++ b/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Wed
> Jan 02 18:13:30 2013 +0100
> @@ -17,6 +17,7 @@
> package net.sourceforge.jnlp.runtime;
>
> import java.awt.Window;
> +import java.io.File;
> import java.net.URL;
> import java.security.AccessControlContext;
> import java.security.AccessController;
> @@ -146,7 +147,14 @@
> private void addMenuAndDesktopEntries() {
> XDesktopEntry entry = new XDesktopEntry(file);
> ShortcutDesc sd = file.getInformation().getShortcut();
> -
> + File possibleDesktopFile = entry.getLinuxDesktopIconFile();
> + if (possibleDesktopFile.exists()) {
> + if (JNLPRuntime.isDebug()) {
> + System.out.println("ApplicationInstance.addMenuAndDesktopEntries():
> file - "
> + + possibleDesktopFile.getAbsolutePath() + "
> already exists. Not proceeding with desktop additions");
> + }
> + return;
> + }
> if (shouldCreateShortcut(sd)) {
> entry.createDesktopShortcut();
> }
> diff -r a16da8b96a0f netx/net/sourceforge/jnlp/util/XDesktopEntry.java
> --- a/netx/net/sourceforge/jnlp/util/XDesktopEntry.java Mon Dec 24
> 13:58:31 2012 +0100
> +++ b/netx/net/sourceforge/jnlp/util/XDesktopEntry.java Wed Jan 02
> 18:13:30 2013 +0100
> @@ -16,16 +16,24 @@
>
> package net.sourceforge.jnlp.util;
>
> +import java.io.BufferedReader;
> import java.io.File;
> import java.io.FileNotFoundException;
> import java.io.FileOutputStream;
> +import java.io.FileReader;
> import java.io.IOException;
> import java.io.OutputStreamWriter;
> import java.io.Reader;
> import java.io.StringReader;
> import java.net.URL;
> import java.nio.charset.Charset;
> +import java.util.ArrayList;
> import java.util.Arrays;
> +import java.util.Collections;
> +import java.util.Comparator;
> +import java.util.List;
> +import java.util.Map.Entry;
> +import java.util.Set;
>
> import net.sourceforge.jnlp.IconDesc;
> import net.sourceforge.jnlp.JNLPFile;
> @@ -48,6 +56,7 @@
>
> public static final String JAVA_ICON_NAME = "java";
>
> +
Nit: extra line
> private JNLPFile file = null;
> private int iconSize = -1;
> private String iconLocation = null;
> @@ -78,7 +87,7 @@
>
> String fileContents = "[Desktop Entry]\n";
> fileContents += "Version=1.0\n";
> - fileContents += "Name=" + sanitize(file.getTitle()) + "\n";
> + fileContents += "Name=" + getDesktopIconName() + "\n";
> fileContents += "GenericName=Java Web Start Application\n";
> fileContents += "Comment=" +
> sanitize(file.getInformation().getDescription()) + "\n";
> fileContents += "Type=Application\n";
> @@ -122,6 +131,12 @@
> return iconSize;
> }
>
> + public File getShortcutTmpFile() {
> + String userTmp =
> JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_USER_TMP_DIR);
> + File shortcutFile = new File(userTmp + File.separator +
> FileUtils.sanitizeFileName(file.getTitle()) + ".desktop");
> + return shortcutFile;
> + }
> +
> /**
> * Set the icon size to use for the desktop shortcut
> *
> @@ -148,9 +163,7 @@
> * Install this XDesktopEntry into the user's desktop as a launcher
> */
> private void installDesktopLauncher() {
> - File shortcutFile = new File(JNLPRuntime.getConfiguration()
> - .getProperty(DeploymentConfiguration.KEY_USER_TMP_DIR)
> - + File.separator +
> FileUtils.sanitizeFileName(file.getTitle()) + ".desktop");
> + File shortcutFile = getShortcutTmpFile();
> try {
>
> if (!shortcutFile.getParentFile().isDirectory() &&
> !shortcutFile.getParentFile().mkdirs()) {
> @@ -234,4 +247,81 @@
> }
> }
>
> + public String getDesktopIconName() {
> + return sanitize(file.getTitle());
> + }
> +
> + public File getLinuxDesktopIconFile() {
> + return new File(findFreedesktopOrgDesktopPathCatch() +
> getDesktopIconName() + ".desktop");
> + }
> +
> + private static String findFreedesktopOrgDesktopPathCatch() {
> + try {
> + return findFreedesktopOrgDesktopPath();
> + } catch (Exception ex) {
> + ex.printStackTrace();
OK, fair enough. (catching Exception still evil IMO)
> + return System.getProperty("user.home") + "/Desktop/";
> + }
> + }
> +
> + private static String findFreedesktopOrgDesktopPath() throws
> IOException {
> + File userDirs = new File(System.getProperty("user.home") +
> "/.config/user-dirs.dirs");
> + if (!userDirs.exists()) {
> + return System.getProperty("user.home") + "/Desktop/";
> + }
> + return getFreedesktopOrgDesktopPathFrom(userDirs);
> + }
> +
> + private static String getFreedesktopOrgDesktopPathFrom(File
> userDirs) throws IOException {
> + BufferedReader r = new BufferedReader(new FileReader(userDirs));
> + try {
> + return getFreedesktopOrgDesktopPathFrom(r);
> + } finally {
> + r.close();
> + }
> +
> + }
> +
> + static final String XDG_DESKTOP_DIR = "XDG_DESKTOP_DIR";
> +
> + static String getFreedesktopOrgDesktopPathFrom(BufferedReader r)
> throws IOException {
> + while (true) {
> + String s = r.readLine();
> + if (s == null) {
> + throw new IOException("End of user-dirs found, but no
> " + XDG_DESKTOP_DIR + " key found");
> + }
> + s = s.trim();
> + if (s.startsWith(XDG_DESKTOP_DIR)) {
> + if (!s.contains("=")) {
> + throw new IOException(XDG_DESKTOP_DIR + " has no
> value");
> + }
> + String[] keyAndValue = s.split("=");
> + keyAndValue[1] = keyAndValue[1].trim();
> + return evaluateLinuxVariables(keyAndValue[1]);
> + }
> + }
> + }
> +
> + private static String evaluateLinuxVariables(String orig) {
> +
> + Set> env = System.getenv().entrySet();
> + List> envVariables = new
> ArrayList> (env);
> + Collections.sort(envVariables, new Comparator String>>(){
> +
> + @Override
> + public int compare(Entry o1,
> Entry o2) {
> + return o2.getKey().length()-o1.getKey().length();
> + }
> + });
> + while (true) {
> + String before = orig;
> + for (Entry entry : envVariables) {
> + orig=orig.replaceAll("\\$"+entry.getKey(),
> entry.getValue());
> + }
> + if (before.equals(orig)) {
> + return orig;
> + }
> + }
> +
> + }
> }
> diff -r a16da8b96a0f
> tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java
> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
> +++ b/tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java
> Wed Jan 02 18:13:30 2013 +0100
> @@ -0,0 +1,91 @@
> +/*
> +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.
> +*/
> +package net.sourceforge.jnlp.util;
> +
> +import java.io.BufferedReader;
> +import java.io.IOException;
> +import java.io.StringReader;
> +import org.junit.Assert;
> +import org.junit.Test;
> +
> +public class XDesktopEntryTest {
> +
> + private String des1 = "/my/little/Desktop";
> + private String des2name = "Plocha";
> + private String des2Res = System.getProperty("user.home") + "/" +
> des2name;
> + private String des2 = "$HOME" + "/" + des2name;
> + private String src1 = XDesktopEntry.XDG_DESKTOP_DIR + "=" + des1;
> + private String src2 = " " + XDesktopEntry.XDG_DESKTOP_DIR + " =
> " + des1;
> + private String src3 = "#" + XDesktopEntry.XDG_DESKTOP_DIR + " = "
> + des1;
> + private String src4 = XDesktopEntry.XDG_DESKTOP_DIR + "=" + des2;
> + private String src5 = " " + XDesktopEntry.XDG_DESKTOP_DIR + " =
> " + des2;
> + private String src6 = "#" + XDesktopEntry.XDG_DESKTOP_DIR + " = "
> + des2;
> +
> + @Test
> + public void getFreedesktopOrgDesktopPathFromtestSimple() throws
> IOException {
> + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new
> BufferedReader(new StringReader(src1)));
> + Assert.assertEquals(s, des1);
> + }
> +
> + @Test
> + public void getFreedesktopOrgDesktopPathFromtestSpaced() throws
> IOException {
> + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new
> BufferedReader(new StringReader(src2)));
> + Assert.assertEquals(s, des1);
> + }
> +
> + @Test(expected = IOException.class)
> + public void getFreedesktopOrgDesktopPathFromtestCommented()
> throws IOException {
> + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new
> BufferedReader(new StringReader(src3)));
> + }
> +
> + @Test
> + public void getFreedesktopOrgDesktopPathFromtestSimpleWithHome()
> throws IOException {
> + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new
> BufferedReader(new StringReader(src4)));
> + Assert.assertEquals(s, des2Res);
> + }
> +
> + @Test
> + public void getFreedesktopOrgDesktopPathFromtestSpacedWithHome()
> throws IOException {
> + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new
> BufferedReader(new StringReader(src5)));
> + Assert.assertEquals(s, des2Res);
> + }
> +
> + @Test(expected = IOException.class)
> + public void
> getFreedesktopOrgDesktopPathFromtestCommentedWithHome() throws
> IOException {
> + String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new
> BufferedReader(new StringReader(src6)));
> + }
> +}
OK for HEAD, thanks for the solution.
-Adam
From ptisnovs at redhat.com Wed Jan 9 09:18:05 2013
From: ptisnovs at redhat.com (Pavel Tisnovsky)
Date: Wed, 9 Jan 2013 12:18:05 -0500 (EST)
Subject: Fwd: [rfc][icedtea-web] synchronised logger
In-Reply-To: <50CF2EB0.7060503@redhat.com>
Message-ID: <762863752.2091710.1357751885463.JavaMail.root@redhat.com>
Hi Jiri,
this change looks ok to me. Please push into HEAD.
Cheers,
Pavel
----- Jiri Vanek wrote:
> Hi!
>
> For obvious reasons, The logger must be synchronised, otherwise, when some (or even similar) java
> is hanging in time of hook execution, then flush is not correct due to ConcurrentModification
> exception and so lost.
>
> Because of killing in testing this happens.
>
> J.
>
>
From jvanek at icedtea.classpath.org Wed Jan 9 09:46:13 2013
From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org)
Date: Wed, 09 Jan 2013 17:46:13 +0000
Subject: /hg/icedtea-web: Logging methods made synchronized
Message-ID:
changeset d95b456959e5 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=d95b456959e5
author: Jiri Vanek
date: Wed Jan 09 18:32:08 2013 +0100
Logging methods made synchronized
diffstat:
ChangeLog | 8 +++
tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java | 23 ++++++---
2 files changed, 22 insertions(+), 9 deletions(-)
diffs (98 lines):
diff -r 02981a272327 -r d95b456959e5 ChangeLog
--- a/ChangeLog Mon Jan 07 11:47:32 2013 -0500
+++ b/ChangeLog Wed Jan 09 18:32:08 2013 +0100
@@ -1,3 +1,11 @@
+2013-01-09 Jiri Vanek
+
+ Logging methods made synchronized
+ * tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java:
+ (processLogs) (getDefaultLoggingBottleneck) (writeXmlLog) (addToXmlLog)
+ (modifyMethodWithForBrowser) (setLoggedBrowser) (logIntoPlaintextLog)
+ made synchronised
+
2013-01-07 Deepak Bhole
* netx/net/sourceforge/jnlp/resources/Messages.properties: Converted to
diff -r 02981a272327 -r d95b456959e5 tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java
--- a/tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java Mon Jan 07 11:47:32 2013 -0500
+++ b/tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java Wed Jan 09 18:32:08 2013 +0100
@@ -45,6 +45,7 @@
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.lang.reflect.Method;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
@@ -80,10 +81,10 @@
* map of classes, each have map of methods, each have errorlist, outLIst, and allList (allist contains also not std or err messages)
* class.testMethod.logs
*/
- final Map> processLogs = new HashMap>(100);
+ final Map> processLogs = Collections.synchronizedMap(new HashMap>(1000));
private boolean added = false;
- public static LoggingBottleneck getDefaultLoggingBottleneck() {
+ synchronized public static LoggingBottleneck getDefaultLoggingBottleneck() {
if (loggingBottleneck == null) {
loggingBottleneck = new LoggingBottleneck();
}
@@ -101,11 +102,15 @@
}
}
- void writeXmlLog() throws FileNotFoundException, IOException {
+ synchronized void writeXmlLog() throws FileNotFoundException, IOException {
writeXmlLog(DEFAULT_LOG_FILE);
}
- void writeXmlLog(File f) throws FileNotFoundException, IOException {
+ synchronized void writeXmlLog(File f) throws FileNotFoundException, IOException {
+ writeXmlLog(f, Collections.unmodifiableMap(processLogs));
+ }
+
+ synchronized static void writeXmlLog(File f, Map> processLogs) throws FileNotFoundException, IOException {
Writer w = new OutputStreamWriter(new FileOutputStream(f));
Set>> classes = processLogs.entrySet();
w.write("<" + LOGS_ELEMENT + ">");
@@ -127,7 +132,7 @@
w.close();
}
- void addToXmlLog(String message, boolean printToOut, boolean printToErr, StackTraceElement ste) {
+ synchronized void addToXmlLog(String message, boolean printToOut, boolean printToErr, StackTraceElement ste) {
Map classLog = processLogs.get(ste.getClassName());
if (classLog == null) {
classLog = new HashMap(50);
@@ -157,7 +162,7 @@
methodLog.add(printToErr, printToOut, message);
}
- public String modifyMethodWithForBrowser(String methodBrowseredName, String className) {
+ synchronized public String modifyMethodWithForBrowser(String methodBrowseredName, String className) {
try {
Class clazz = Class.forName(className);
/*
@@ -180,11 +185,11 @@
return methodBrowseredName;
}
- public void setLoggedBrowser(String loggedBrowser) {
+ synchronized public void setLoggedBrowser(String loggedBrowser) {
this.loggedBrowser = loggedBrowser;
}
- public void logIntoPlaintextLog(String message, boolean printToOut, boolean printToErr) {
+ synchronized public void logIntoPlaintextLog(String message, boolean printToOut, boolean printToErr) {
try {
if (printToOut) {
LoggingBottleneck.getDefaultLoggingBottleneck().stdout(message);
@@ -216,7 +221,7 @@
DEFAULT_STDLOGS_WRITER.flush();
}
- public static String clearChars(String ss) {
+ synchronized public static String clearChars(String ss) {
StringBuilder s = new StringBuilder(ss);
for (int i = 0; i < s.length(); i++) {
char q = s.charAt(i);
From adomurad at redhat.com Wed Jan 9 10:53:25 2013
From: adomurad at redhat.com (Adam Domurad)
Date: Wed, 09 Jan 2013 13:53:25 -0500
Subject: [rfc][icedtea-web] centre of dialogues to centre of active monitor
In-Reply-To: <50EC411D.9010702@redhat.com>
References: <50EC411D.9010702@redhat.com>
Message-ID: <50EDBCA5.7020003@redhat.com>
On 01/08/2013 10:54 AM, Jiri Vanek wrote:
> All dialogues in ITW are centred into middle of ALL monitors, which is
> really nasty.
> During splashscreen development I have centred into middle of default
> screen. Well better but not perfect.
> That time Omair suggested to centr into middle of active screen -
> active here is the one where is cursor.
> Well I have finally come with something like this:)
>
>
This looks OK to me, although I still get the dialog pop-ups flashing on
the wrong screen sometimes, before appearing on the correct one.
Comments on impl class:
> +public class ScreenFinder {
> +
> + public static GraphicsDevice getCurrentScreen() {
> + Point p = MouseInfo.getPointerInfo().getLocation();
> + return getScreenOnCoords(p);
> +
> + }
> + public static Rectangle getCurrentScreenSizeWithoutBounds() {
> + Point p = MouseInfo.getPointerInfo().getLocation();
> + return getScreenOnCoordsWithutBounds(p);
> +
> + }
> +
> + public static void centerWindowsToCurrentScreen(Window w) {
> + Rectangle bounds = getCurrentScreenSizeWithoutBounds();
> + w.setLocation(bounds.x + (bounds.width - w.getWidth())/2,
> + bounds.y + (bounds.height - w.getHeight())/2);
> +
> + }
> +
> + public static GraphicsDevice getScreenOnCoords(Point point) {
> + GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment();
> + GraphicsDevice[] devices = e.getScreenDevices();
> + GraphicsDevice result = null;
> + //now get the configuration(s) for each device
> + for (GraphicsDevice device : devices) {
> + //GraphicsConfiguration[] configurations = device.getConfigurations();
> + //or?
If you've settled on default device, I'd prefer to just simply use it.
> + GraphicsConfiguration[] configurations = new GraphicsConfiguration[]{device.getDefaultConfiguration()};
> + for (GraphicsConfiguration config : configurations) {
> + Rectangle gcBounds = config.getBounds();
> + if (gcBounds.contains(point)) {
> + result = device;
> + }
> + }
> + }
> + if (result == null) {
> + //not found, get the default display
> + result = e.getDefaultScreenDevice();
> + }
> + return result;
> + }
> +
> + public static Rectangle getScreenOnCoordsWithutBounds(Point p) {
> + GraphicsDevice device = getScreenOnCoords(p);
> + Rectangle screenSize = device.getDefaultConfiguration().getBounds();
> + Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(device.getDefaultConfiguration());
> + return new Rectangle((int)screenSize.getX()+insets.left, (int)screenSize.getY()+insets.top, (int)screenSize.getWidth()-insets.left, (int)screenSize.getHeight()-insets.bottom);
I'd prefer 4 temporary variables for these coordinates.
> + }
> +
> +
> +}
OK to push otherwise, though.
Thanks,
-Adam
From adomurad at redhat.com Wed Jan 9 11:08:14 2013
From: adomurad at redhat.com (Adam Domurad)
Date: Wed, 09 Jan 2013 14:08:14 -0500
Subject: [rfc][icedtea-web] centre of dialogues to centre of active monitor
In-Reply-To: <50EDBCA5.7020003@redhat.com>
References: <50EC411D.9010702@redhat.com> <50EDBCA5.7020003@redhat.com>
Message-ID: <50EDC01E.5000103@redhat.com>
On 01/09/2013 01:53 PM, Adam Domurad wrote:
> On 01/08/2013 10:54 AM, Jiri Vanek wrote:
>> All dialogues in ITW are centred into middle of ALL monitors, which
>> is really nasty.
>> During splashscreen development I have centred into middle of default
>> screen. Well better but not perfect.
>> That time Omair suggested to centr into middle of active screen -
>> active here is the one where is cursor.
>> Well I have finally come with something like this:)
>>
>>
> This looks OK to me, although I still get the dialog pop-ups flashing
> on the wrong screen sometimes, before appearing on the correct one.
>
> Comments on impl class:
>> +public class ScreenFinder {
>> +
>> + public static GraphicsDevice getCurrentScreen() {
>> + Point p = MouseInfo.getPointerInfo().getLocation();
>> + return getScreenOnCoords(p);
>> +
>> + }
>> + public static Rectangle getCurrentScreenSizeWithoutBounds() {
>> + Point p = MouseInfo.getPointerInfo().getLocation();
>> + return getScreenOnCoordsWithutBounds(p);
>> +
>> + }
>> +
>> + public static void centerWindowsToCurrentScreen(Window w) {
>> + Rectangle bounds = getCurrentScreenSizeWithoutBounds();
>> + w.setLocation(bounds.x + (bounds.width - w.getWidth())/2,
>> + bounds.y + (bounds.height - w.getHeight())/2);
>> +
>> + }
>> +
>> + public static GraphicsDevice getScreenOnCoords(Point point) {
>> + GraphicsEnvironment e =
>> GraphicsEnvironment.getLocalGraphicsEnvironment();
>> + GraphicsDevice[] devices = e.getScreenDevices();
>> + GraphicsDevice result = null;
>> + //now get the configuration(s) for each device
>> + for (GraphicsDevice device : devices) {
>> + //GraphicsConfiguration[] configurations =
>> device.getConfigurations();
>> + //or?
>
> If you've settled on default device, I'd prefer to just simply use it.
>
>> + GraphicsConfiguration[] configurations = new
>> GraphicsConfiguration[]{device.getDefaultConfiguration()};
>> + for (GraphicsConfiguration config : configurations) {
>> + Rectangle gcBounds = config.getBounds();
>> + if (gcBounds.contains(point)) {
>> + result = device;
>> + }
>> + }
>> + }
>> + if (result == null) {
>> + //not found, get the default display
>> + result = e.getDefaultScreenDevice();
>> + }
>> + return result;
>> + }
>> +
>> + public static Rectangle getScreenOnCoordsWithutBounds(Point p) {
>> + GraphicsDevice device = getScreenOnCoords(p);
>> + Rectangle screenSize =
>> device.getDefaultConfiguration().getBounds();
>> + Insets insets =
>> Toolkit.getDefaultToolkit().getScreenInsets(device.getDefaultConfiguration());
>> + return new Rectangle((int)screenSize.getX()+insets.left,
>> (int)screenSize.getY()+insets.top,
>> (int)screenSize.getWidth()-insets.left,
>> (int)screenSize.getHeight()-insets.bottom);
>
> I'd prefer 4 temporary variables for these coordinates.
>
>> + }
>> +
>> +
>> +}
>
> OK to push otherwise, though.
>
> Thanks,
> -Adam
Hmm actually as well, the "Fatal: Launch Error: " shows up for me on
wrong monitor.
-Adam
From adomurad at redhat.com Wed Jan 9 11:45:39 2013
From: adomurad at redhat.com (Adam Domurad)
Date: Wed, 09 Jan 2013 14:45:39 -0500
Subject: [rfc][icedtea-web] make download indicator more compact
In-Reply-To: <50EC440E.2080409@redhat.com>
References: <50E5ACDF.7080609@redhat.com> <50E704C5.4060300@redhat.com>
<50EADE9F.3000101@redhat.com> <50EB1B33.4020605@redhat.com>
<50EC440E.2080409@redhat.com>
Message-ID: <50EDC8E3.8060505@redhat.com>
On 01/08/2013 11:06 AM, Jiri Vanek wrote:
> On 01/07/2013 08:00 PM, Adam Domurad wrote:
>> On 01/07/2013 09:41 AM, Jiri Vanek wrote:
>>> On 01/04/2013 05:35 PM, Adam Domurad wrote:
>>>> On 01/03/2013 11:07 AM, Jiri Vanek wrote:
>>>>> Hi!
>>>>>
>>>>> This patch is adding "show details" to download indicator. For One
>>>>> jar jnlp files it behaviour is
>>>>> unaffected. For Multiple jars there is just one progress bar, but
>>>>> can be shown "old stile"
>>>>> detailed one via clicking to "Show details". Then can be
>>>>> minimalised by "hide details". Button is
>>>>> localised.
>>>>>
>>>>> The button is nasty not nice.. Any better idea? but still this is
>>>>> better then previous approach.
>>>>>
>>>>> Looking forward to have this inside!
>>>>>
>>>>> Best rigards
>>>>> J.
>>>>
>>>> Thanks for looking into this! I was actually comparing our download
>>>> indicator to proprietary just
>>>> yesterday, while staring at multiple jars downloading. The average
>>>> user does not want to know about
>>>> the jars being downloaded, in fact I think such information can
>>>> look scary :-).
>>>>
>>>>> diff -r 9549226afa8f
>>>>> netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java
>>>>> ---
>>>>> a/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java
>>>>> Thu Jan 03 09:54:16 2013 +0100
>>>>> +++
>>>>> b/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java
>>>>> Thu Jan 03 17:07:28 2013 +0100
>>>>> @@ -62,6 +62,7 @@
>>>>>
>>>>> /** shared constraint */
>>>>> static GridBagConstraints vertical;
>>>>> + static GridBagConstraints verticalNoClean;
>>>>> static GridBagConstraints verticalIndent;
>>>>> static {
>>>>> vertical = new GridBagConstraints();
>>>>> @@ -70,8 +71,12 @@
>>>>> vertical.fill = GridBagConstraints.HORIZONTAL;
>>>>> vertical.anchor = GridBagConstraints.WEST;
>>>>>
>>>>> + verticalNoClean = new GridBagConstraints();
>>>>> + verticalNoClean.weightx = 1.0;
>>>>> +
>>>>> verticalIndent = (GridBagConstraints) vertical.clone();
>>>>> verticalIndent.insets = new Insets(0, 10, 3, 0);
>>>>> +
>>>>
>>>> Nit: These two blank lines (and all the ones added below) have tabs
>>>> :-)
>>>>
>>>>> }
>>>>>
>>>>> /**
>>>>> @@ -114,15 +119,15 @@
>>>>>
>>>>> frame.getContentPane().add(result, vertical);
>>>>> frame.pack();
>>>>> -
>>>>> if (!frame.isVisible()) {
>>>>> - Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
>>>>> - Insets insets =
>>>>> Toolkit.getDefaultToolkit().getScreenInsets(frame.getGraphicsConfiguration());
>>>>>
>>>>> - Dimension screen = new Dimension(screenSize.width - insets.left,
>>>>> - screenSize.height - insets.top);
>>>>> - frame.setLocation(screen.width - frame.getWidth(),
>>>>> - screen.height - frame.getHeight());
>>>>> + placeFrameToLowerRight();
>>>>> }
>>>>> + result.addComponentListener(new ComponentAdapter() {
>>>>> + @Override
>>>>> + public void componentResized(ComponentEvent e) {
>>>>> + placeFrameToLowerRight();
>>>>> + }
>>>>> + });
>>>>>
>>>>> frame.setVisible(true);
>>>>>
>>>>> @@ -131,6 +136,32 @@
>>>>> }
>>>>>
>>>>> /**
>>>>> + * The insets are calculated differently during first appearance
>>>>> + * and during another appearance in case of some configurations.
>>>>> + *
>>>>> + * So the first value is stored to avoid jumping of window during
>>>>> later packing
>>>>> + * of frame.
>>>>> + *
>>>>> + * However the second calculation is more correct:(
>>>>> + *
>>>>> + * This is affecting only multiple monitors which have different
>>>>> assets.
>>>>> + * The underlying issue is that
>>>>> Toolkit.getDefaultToolkit().getScreenInsets
>>>>> + * is returning assets for "random" monitor.
>>>>> + */
>>>>> + Dimension screen = null;
>>>>> +
>>>>> + private void placeFrameToLowerRight() throws HeadlessException {
>>>>> + if (screen == null) {
>>>>> + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
>>>>> + Insets insets =
>>>>> Toolkit.getDefaultToolkit().getScreenInsets(frame.getGraphicsConfiguration());
>>>>>
>>>>> + screen = new Dimension(screenSize.width - insets.left,
>>>>> + screenSize.height - insets.top);
>>>>> + }
>>>>> + frame.setLocation(screen.width - frame.getWidth(),
>>>>> + screen.height - frame.getHeight());
>>>>> + }
>>>>> +
>>>>> + /**
>>>>> * Remove a download service listener that was obtained by
>>>>> * calling the getDownloadListener method from the shared
>>>>> * download info window.
>>>>> @@ -163,12 +194,26 @@
>>>>> * Groups the url progress in a panel.
>>>>> */
>>>>> static class DownloadPanel extends JPanel implements
>>>>> DownloadServiceListener {
>>>>> -
>>>>> + private static enum States{
>>>>> + oneJAr, collapsed, detailed;
>>>>
>>>> Enums should be all-caps
>>>>
>>>>> +
>>>>> + }
>>>>> +
>>>>> + private static final String DETAILS=R("ButShowDetails");
>>>>> + private static final String HIDE_DETAILS=R("ButHideDetails");
>>>>> /** the download name */
>>>>> private String downloadName;
>>>>>
>>>>> /** Downloading part: */
>>>>> private JLabel header = new JLabel();
>>>>> + /** Show/hide details button: */
>>>>> + private JButton details = new JButton(DETAILS);
>>>>> + /** used instead of details button in case of one jar*/
>>>>> + private JLabel delimiter = new JLabel("");
>>>>> + /** all already created progress bars*/
>>>>> + private List progressPanels = new
>>>>> ArrayList();
>>>>> + private States state=States.oneJAr;
>>>>> + private ProgressPanel mainProgressPanel;
>>>>>
>>>>> /** list of URLs being downloaded */
>>>>> private List urls = new ArrayList();
>>>>> @@ -176,6 +221,7 @@
>>>>> /** list of ProgressPanels */
>>>>> private List panels = new ArrayList();
>>>>>
>>>>> +
>>>>
>>>> Nit: two blank lines are unnecessary.
>>>>
>>>>> /**
>>>>> * Create a new download panel for with the specified download
>>>>> * name.
>>>>> @@ -184,9 +230,35 @@
>>>>> setLayout(new GridBagLayout());
>>>>>
>>>>> this.downloadName = downloadName;
>>>>> - this.add(header, vertical);
>>>>> + this.add(header, verticalNoClean);
>>>>> header.setFont(header.getFont().deriveFont(Font.BOLD));
>>>>> -
>>>>> + this.add(delimiter, vertical);
>>>>> + details.addActionListener(new ActionListener() {
>>>>> + @Override
>>>>> + public void actionPerformed(ActionEvent e) {
>>>>> + if (state == States.detailed) {
>>>>> + state = States.collapsed;
>>>>> + details.setText(DETAILS);
>>>>> + for (ProgressPanel progressPanel : progressPanels) {
>>>>> + remove(progressPanel);
>>>>> + }
>>>>> + add(mainProgressPanel, verticalIndent);
>>>>> + synchronized (frameMutex) {
>>>>> + frame.pack();
>>>>> + }
>>>>> + } else {
>>>>> + state = States.detailed;
>>>>> + details.setText(HIDE_DETAILS);
>>>>> + remove(mainProgressPanel);
>>>>> + for (ProgressPanel progressPanel : progressPanels) {
>>>>> + add(progressPanel, verticalIndent);
>>>>> + }
>>>>> + synchronized (frameMutex) {
>>>>> + frame.pack();
>>>>> + }
>>>>> + }
>>>>> + }
>>>>> + });
>>>>> setOverallPercent(0);
>>>>> }
>>>>>
>>>>> @@ -196,14 +268,25 @@
>>>>> protected void addProgressPanel(URL url, String version) {
>>>>> if (!urls.contains(url)) {
>>>>> ProgressPanel panel = new ProgressPanel(url, version);
>>>>> -
>>>>> - add(panel, verticalIndent);
>>>>> + if (state != States.collapsed) {
>>>>> + add(panel, verticalIndent);
>>>>> + }
>>>>> + progressPanels.add(panel);
>>>>> + urls.add(url);
>>>>> + panels.add(panel);
>>>>> + if (panels.size() == 2){
>>>>
>>>> Small comment here would be good explaining why this 'magic number'
>>>>
>>>>> + remove(panels.get(0));
>>>>> + remove(panels.get(1));
>>>>> + remove(delimiter);
>>>>> + add(details,vertical);
>>>>> + mainProgressPanel=new ProgressPanel();
>>>>> + add(mainProgressPanel, verticalIndent);
>>>>> + state=States.collapsed;
>>>>> + }
>>>>> synchronized (frameMutex) {
>>>>> frame.pack();
>>>>> }
>>>>>
>>>>> - urls.add(url);
>>>>> - panels.add(panel);
>>>>> }
>>>>> }
>>>>>
>>>>> @@ -219,10 +302,10 @@
>>>>> addProgressPanel(url, version);
>>>>>
>>>>> setOverallPercent(overallPercent);
>>>>> -
>>>>> ProgressPanel panel = panels.get(urls.indexOf(url));
>>>>> panel.setProgress(readSoFar, total);
>>>>> panel.repaint();
>>>>> +
>>>>> }
>>>>> };
>>>>> SwingUtilities.invokeLater(r);
>>>>> @@ -230,12 +313,28 @@
>>>>>
>>>>> /**
>>>>> * Sets the overall percent completed.
>>>>> + * should be called via invokeLater
>>>>> */
>>>>> public void setOverallPercent(int percent) {
>>>>> // don't get whole string from resource and sub in
>>>>> // values because it'll be doing a MessageFormat for
>>>>> // each update.
>>>>> header.setText(downloading + " " + downloadName + ": " + percent +
>>>>> "% " + complete +
>>>>> ".");
>>>>> + Container c = header.getParent();
>>>>> + //we need to adapt nbboth panels and also frame to new length of
>>>>> header text
>>>>
>>>> nbboth > both
>>>>
>>>>> + while (c != null) {
>>>>> + c.invalidate();
>>>>> + c.validate();
>>>>> + if (c instanceof Window){
>>>>> + ((Window) c).pack();
>>>>> + }
>>>>> + c=c.getParent();
>>>>> + }
>>>>> +
>>>>> + if (mainProgressPanel != null) {
>>>>> + mainProgressPanel.setProgress(percent, 100);
>>>>> + mainProgressPanel.repaint();
>>>>> + }
>>>>> }
>>>>>
>>>>> /**
>>>>> @@ -276,12 +375,28 @@
>>>>>
>>>>> private long total;
>>>>> private long readSoFar;
>>>>> + private Dimension size = new Dimension(80, 15);
>>>>>
>>>>> + ProgressPanel() {
>>>>> + bar.setMinimumSize(size);
>>>>> + bar.setPreferredSize(size);
>>>>> + bar.setOpaque(false);
>>>>> +
>>>>> + setLayout(new GridBagLayout());
>>>>> +
>>>>> + GridBagConstraints gbc = new GridBagConstraints();
>>>>> + styleGridBagConstraints(gbc);
>>>>> + add(bar, gbc);
>>>>> + }
>>>>> +
>>>>> ProgressPanel(URL url, String version) {
>>>>> - JLabel location = new JLabel(" " + url.getHost() + "/" +
>>>>> url.getFile());
>>>>> + this(" " + url.getHost() + "/" + url.getFile(),version);
>>>>> + }
>>>>> + ProgressPanel(String caption, String version) {
>>>>> + JLabel location = new JLabel(caption);
>>>>>
>>>>> - bar.setMinimumSize(new Dimension(80, 15));
>>>>> - bar.setPreferredSize(new Dimension(80, 15));
>>>>> + bar.setMinimumSize(size);
>>>>> + bar.setPreferredSize(size);
>>>>> bar.setOpaque(false);
>>>>>
>>>>> setLayout(new GridBagLayout());
>>>>> @@ -291,12 +406,8 @@
>>>>> gbc.fill = GridBagConstraints.NONE;
>>>>> gbc.gridwidth = GridBagConstraints.RELATIVE;
>>>>> add(bar, gbc);
>>>>> -
>>>>> - gbc.insets = new Insets(0, 3, 0, 0);
>>>>> - gbc.weightx = 1.0;
>>>>> - gbc.fill = GridBagConstraints.HORIZONTAL;
>>>>> - gbc.gridwidth = GridBagConstraints.REMAINDER;
>>>>> - gbc.anchor = GridBagConstraints.WEST;
>>>>> +
>>>>> + styleGridBagConstraints(gbc);
>>>>> add(location, gbc);
>>>>> }
>>>>>
>>>>> @@ -325,6 +436,14 @@
>>>>> g.fillRect(x + 1, y + 1, divide - 1, h - 1);
>>>>> }
>>>>> }
>>>>> +
>>>>> + private void styleGridBagConstraints(GridBagConstraints gbc) {
>>>>> + gbc.insets = new Insets(0, 3, 0, 0);
>>>>> + gbc.weightx = 1.0;
>>>>> + gbc.fill = GridBagConstraints.HORIZONTAL;
>>>>> + gbc.gridwidth = GridBagConstraints.REMAINDER;
>>>>> + gbc.anchor = GridBagConstraints.WEST;
>>>>> + }
>>>>> };
>>>>>
>>>>> }
>>>>
>>>> Code looks OK nits aside.
>>>
>>> Thanx for nits. Should be fixed now
>>>>
>>>> As for button ... yes it is nasty. IMO maybe we can take different
>>>> approach here. The people
>>>> interested in how the individual jars are downloading would mainly
>>>> be 1. us trying to fix jar
>>>> loading issues, 2. developers looking into jar loading issues.
>>>>
>>>> So what if the ICEDTEAPLUGIN_DEBUG environment variable turned this
>>>> on/off ? It can be argued it is
>>>> a bit hard for developers to access, but it isn't any easier to
>>>> access this information from oracle
>>>> plugin.
>>>
>>> I think I don't like this idea :(
>>
>> No problem, but can you elaborate why not?
>
> When it took to long to downld application, I'm happy to see whats
> going on. Maybe I can spot some 3rd party jar to be stuck and then I
> can ping them. And I definitely do not want to look for environmetn
> variables.
>>
>>> I have added an attempt to use an icon, And I must say it is much
>>> better. Btw, I have created this icon.. so no wonders here :) But
>>> looks quite cool :)
>>
>> It looks OK :-) The glass part could use some transparency.
> blah :)
>
>> There should be a slightly different icon from going from detailed
>> ->compact.
> As you wish, however, I do not like the red cross I have added :(
>
>>
>>>
>>>>
>>>> As well, I would be very happy to see the loading bar integrated
>>>> with the splash screen (if splash
>>>> screen is on). I believe this would nicely complement the user
>>>> friendliness of the splash screen.
>>>
>>> You mean to sync progress on progress bar with the one in splash? Or
>>> also showing the downlaoded resources somehow and show details
>>> button in splash?
>>
>> I was thinking always have progress bar on splash, and have detailed
>> view hide/show the download bars in corner. IMO this is good for now,
>> except:
> I agree. It can came in some future.
>
>> 1. visual glitches such as http://i.imgur.com/Oveuh.png (with text
>> flickering from middle to top every frame). As well on dual monitors
>> expanding/compacting view constantly changed screens for me.
> Well I was not able to reproduce today :-/
> However I have changed the implementation and So I hope that it will
> behave better in your configuration.
>
> Please note, now this patch is depending on [rfc][icedtea-web] centre
> of dialogues to centre of active monitor.
> Sorry for inconvenience here:(
>
>> 2. A different style button/icon from going detailed->compact.
>
> How different? (in context of this patch/in global)?
Just a different icon, like you added.
patch:
> diff -r 02981a272327
> netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java
> --- a/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java
> Mon Jan 07 11:47:32 2013 -0500
> +++ b/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java
> Tue Jan 08 15:26:23 2013 +0100
> @@ -29,6 +29,7 @@
>
> import net.sourceforge.jnlp.runtime.*;
> import net.sourceforge.jnlp.util.ImageResources;
> +import net.sourceforge.jnlp.util.ScreenFinder;
>
> /**
> * Show the progress of downloads.
> @@ -62,6 +63,7 @@
>
> /** shared constraint */
> static GridBagConstraints vertical;
> + static GridBagConstraints verticalNoClean;
> static GridBagConstraints verticalIndent;
> static {
> vertical = new GridBagConstraints();
> @@ -70,6 +72,9 @@
> vertical.fill = GridBagConstraints.HORIZONTAL;
> vertical.anchor = GridBagConstraints.WEST;
>
> + verticalNoClean = new GridBagConstraints();
> + verticalNoClean.weightx = 1.0;
> +
> verticalIndent = (GridBagConstraints) vertical.clone();
> verticalIndent.insets = new Insets(0, 10, 3, 0);
> }
> @@ -101,9 +106,7 @@
>
> synchronized (frameMutex) {
> if (frame == null) {
> - frame = new JFrame(downloading + "...");
> - frame.setIconImages(ImageResources.INSTANCE.getApplicationImages());
> - frame.getContentPane().setLayout(new GridBagLayout());
> + frame=createDownloadIndicatorFrame(true);
> }
>
> if (resources != null) {
> @@ -114,15 +117,13 @@
>
> frame.getContentPane().add(result, vertical);
> frame.pack();
> -
> - if (!frame.isVisible()) {
> - Dimension screenSize =
> Toolkit.getDefaultToolkit().getScreenSize();
> - Insets insets =
> Toolkit.getDefaultToolkit().getScreenInsets(frame.getGraphicsConfiguration());
> - Dimension screen = new Dimension(screenSize.width -
> insets.left,
> - screenSize.height - insets.top);
> - frame.setLocation(screen.width - frame.getWidth(),
> - screen.height - frame.getHeight());
> - }
> + placeFrameToLowerRight();
> + result.addComponentListener(new ComponentAdapter() {
> + @Override
> + public void componentResized(ComponentEvent e) {
> + placeFrameToLowerRight();
> + }
> + });
>
> frame.setVisible(true);
>
> @@ -130,6 +131,23 @@
> }
> }
>
> + public static JFrame createDownloadIndicatorFrame(boolean
> undecorated) throws HeadlessException {
> + JFrame f = new JFrame(downloading + "...");
> + f.setUndecorated(undecorated);
> + f.setIconImages(ImageResources.INSTANCE.getApplicationImages());
> + f.getContentPane().setLayout(new GridBagLayout());
> + return f;
> + }
> +
> + /**
> + * This places indicator to lower rigt corner of active monitor.
s/rigt/right/
> + */
> + private static void placeFrameToLowerRight() throws
> HeadlessException {
> + Rectangle bounds =
> ScreenFinder.getCurrentScreenSizeWithoutBounds();
> + frame.setLocation(bounds.width+bounds.x - frame.getWidth(),
> + bounds.height+bounds.y - frame.getHeight());
> + }
> +
> /**
> * Remove a download service listener that was obtained by
> * calling the getDownloadListener method from the shared
> @@ -163,13 +181,31 @@
> * Groups the url progress in a panel.
> */
> static class DownloadPanel extends JPanel implements
> DownloadServiceListener {
> + private final DownloadPanel self;
>
> + private static enum States{
> + ONE_JAR, COLLAPSED, DETAILED;
> + }
> +
> + private static final String DETAILS=R("ButShowDetails");
> + private static final String HIDE_DETAILS=R("ButHideDetails");
> /** the download name */
> private String downloadName;
> -
> /** Downloading part: */
> private JLabel header = new JLabel();
> -
> + /** Show/hide detailsButton button: */
> + private final JButton detailsButton;
> + private static final URL magnifyGlassUrl =
> ClassLoader.getSystemResource("net/sourceforge/jnlp/resources/magnifyGlass-small.png");
> + private static final URL redCrossUrl =
> ClassLoader.getSystemResource("net/sourceforge/jnlp/resources/redCross-small.png");
> + private static final Icon magnifyGlassIcon = new
> ImageIcon(magnifyGlassUrl);
> + private static final Icon redCrossIcon = new
> ImageIcon(redCrossUrl);
> + /** used instead of detailsButton button in case of one jar*/
> + private JLabel delimiter = new JLabel("");
> + /** all already created progress bars*/
> + private List progressPanels = new
> ArrayList();
> + private States state=States.ONE_JAR;
> + private ProgressPanel mainProgressPanel;
> +
> /** list of URLs being downloaded */
> private List urls = new ArrayList();
>
> @@ -181,12 +217,52 @@
> * name.
> */
> protected DownloadPanel(String downloadName) {
> + self = this;
> setLayout(new GridBagLayout());
> + this.downloadName = downloadName;
> + this.add(header, verticalNoClean);
> + header.setFont(header.getFont().deriveFont(Font.BOLD));
> + this.add(delimiter, vertical);
> + detailsButton = new JButton(magnifyGlassIcon);
> + int w = magnifyGlassIcon.getIconWidth();
> + int h = magnifyGlassIcon.getIconHeight();
> + detailsButton.setPreferredSize(new Dimension(w + 2, h + 2));
> + detailsButton.addActionListener(new ActionListener() {
> + @Override
> + public void actionPerformed(ActionEvent e) {
> + if (state == States.DETAILED) {
> + state = States.COLLAPSED;
> + detailsButton.setToolTipText(DETAILS);
> + detailsButton.setIcon(magnifyGlassIcon);
> + for (ProgressPanel progressPanel :
> progressPanels) {
> + remove(progressPanel);
> + }
> + add(mainProgressPanel, verticalIndent);
> + recreateFrame(true);
> + } else {
> + state = States.DETAILED;
> + detailsButton.setToolTipText(HIDE_DETAILS);
> + detailsButton.setIcon(redCrossIcon);
> + remove(mainProgressPanel);
> + for (ProgressPanel progressPanel :
> progressPanels) {
> + add(progressPanel, verticalIndent);
> + }
> + recreateFrame(false);
> + }
> + }
>
> - this.downloadName = downloadName;
> - this.add(header, vertical);
> - header.setFont(header.getFont().deriveFont(Font.BOLD));
> -
> + public void recreateFrame(boolean undecorated) throws
> HeadlessException {
> + JFrame oldFrame = frame;
> + frame = createDownloadIndicatorFrame(undecorated);
> + frame.getContentPane().add(self, vertical);
> + synchronized (frameMutex) {
> + frame.pack();
> + placeFrameToLowerRight();
> + }
> + frame.setVisible(true);
> + oldFrame.dispose();
> + }
> + });
> setOverallPercent(0);
> }
>
> @@ -196,14 +272,31 @@
> protected void addProgressPanel(URL url, String version) {
> if (!urls.contains(url)) {
> ProgressPanel panel = new ProgressPanel(url, version);
> -
> - add(panel, verticalIndent);
> + if (state != States.COLLAPSED) {
> + add(panel, verticalIndent);
> + }
> + progressPanels.add(panel);
> + urls.add(url);
> + panels.add(panel);
> + //download indicator does not know about added jars
> + //When just one is added then it behaves as was
> costumed (and no show detail button)
Sorry, I do not understand this last sentence (at least not the way its
worded).
> + //when secoond one is added, then it already knows
> that there will
s/secoond/second/
> + //be two or more jars, so it swap to collapsed state
> in count of two.
> + //no later, no sooner
> + if (panels.size() == 2){
> + remove(panels.get(0));
> + remove(panels.get(1));
> + remove(delimiter);
> + add(detailsButton,vertical);
> + mainProgressPanel=new ProgressPanel();
> + add(mainProgressPanel, verticalIndent);
> + state=States.COLLAPSED;
> + }
> synchronized (frameMutex) {
> frame.pack();
> + placeFrameToLowerRight();
> }
>
> - urls.add(url);
> - panels.add(panel);
> }
> }
>
> @@ -219,10 +312,10 @@
> addProgressPanel(url, version);
>
> setOverallPercent(overallPercent);
> -
> ProgressPanel panel = panels.get(urls.indexOf(url));
> panel.setProgress(readSoFar, total);
> panel.repaint();
> +
> }
> };
> SwingUtilities.invokeLater(r);
> @@ -230,12 +323,27 @@
>
> /**
> * Sets the overall percent completed.
> + * should be called via invokeLater
> */
> public void setOverallPercent(int percent) {
> // don't get whole string from resource and sub in
> // values because it'll be doing a MessageFormat for
> // each update.
> header.setText(downloading + " " + downloadName + ": " +
> percent + "% " + complete + ".");
> + Container c = header.getParent();
> + //we need to adapt both panels and also frame to new
> length of header text
> + while (c != null) {
> + c.invalidate();
> + c.validate();
> + if (c instanceof Window){
> + ((Window) c).pack();
> + }
> + c=c.getParent();
> + }
> + if (mainProgressPanel != null) {
> + mainProgressPanel.setProgress(percent, 100);
> + mainProgressPanel.repaint();
> + }
> }
>
> /**
> @@ -276,12 +384,28 @@
>
> private long total;
> private long readSoFar;
> + private Dimension size = new Dimension(80, 15);
>
> + ProgressPanel() {
> + bar.setMinimumSize(size);
> + bar.setPreferredSize(size);
> + bar.setOpaque(false);
> +
> + setLayout(new GridBagLayout());
> +
> + GridBagConstraints gbc = new GridBagConstraints();
> + styleGridBagConstraints(gbc);
> + add(bar, gbc);
> + }
> +
> ProgressPanel(URL url, String version) {
> - JLabel location = new JLabel(" " + url.getHost() + "/" +
> url.getFile());
> + this(" " + url.getHost() + "/" + url.getFile(),version);
> + }
> + ProgressPanel(String caption, String version) {
> + JLabel location = new JLabel(caption);
>
> - bar.setMinimumSize(new Dimension(80, 15));
> - bar.setPreferredSize(new Dimension(80, 15));
> + bar.setMinimumSize(size);
> + bar.setPreferredSize(size);
> bar.setOpaque(false);
>
> setLayout(new GridBagLayout());
> @@ -291,12 +415,8 @@
> gbc.fill = GridBagConstraints.NONE;
> gbc.gridwidth = GridBagConstraints.RELATIVE;
> add(bar, gbc);
> -
> - gbc.insets = new Insets(0, 3, 0, 0);
> - gbc.weightx = 1.0;
> - gbc.fill = GridBagConstraints.HORIZONTAL;
> - gbc.gridwidth = GridBagConstraints.REMAINDER;
> - gbc.anchor = GridBagConstraints.WEST;
> +
> + styleGridBagConstraints(gbc);
> add(location, gbc);
> }
>
> @@ -325,6 +445,14 @@
> g.fillRect(x + 1, y + 1, divide - 1, h - 1);
> }
> }
> +
> + private void styleGridBagConstraints(GridBagConstraints gbc) {
> + gbc.insets = new Insets(0, 3, 0, 0);
> + gbc.weightx = 1.0;
> + gbc.fill = GridBagConstraints.HORIZONTAL;
> + gbc.gridwidth = GridBagConstraints.REMAINDER;
> + gbc.anchor = GridBagConstraints.WEST;
> + }
> };
>
> }
Attached are two alternate icons. They are from here
http://opengameart.org/content/forum-controls and are in the public domain.
The magnifying glass can go compact->detailed, and the left&up arrow can
go detailed->compact. Maybe get rid of the surrounding buttons as well
(or make them more subtle) ?
happy hacking
-Adam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arrow-small.png
Type: image/png
Size: 423 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130109/0be38fcb/arrow-small.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: magnify-small.png
Type: image/png
Size: 754 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130109/0be38fcb/magnify-small.png
From adomurad at redhat.com Wed Jan 9 12:05:24 2013
From: adomurad at redhat.com (Adam Domurad)
Date: Wed, 09 Jan 2013 15:05:24 -0500
Subject: [rfc][icedtea-web] Rewrite of MethodOverloadResolver
In-Reply-To: <50CB8F6E.8060207@redhat.com>
References: <50CB8F6E.8060207@redhat.com>
Message-ID: <50EDCD84.1030104@redhat.com>
On 12/14/2012 03:43 PM, Adam Domurad wrote:
> Thought I'd do a simple patch to turn the test code embedded in
> MethodOverloadResolver into a a proper unit test ... unfortunately, my
> small look into this class lead me to find many subtle bugs -- and
> coincidentally decide to do it properly. Lots of corner cases covered,
> and it could probably use unit tests even still, but its a major
> improvement and I'm a bit tired of looking at it so I'm posting it.
>
> Some broken things I uncovered included improper overloading order,
> method/argument situations that would error-out if they ever occurred
> (but were valid), and the fact that the JSObject used throughout the
> class was actually a dummy value used at the bottom of the class. The
> code was also made a lot cleaner in the process, in the interest of
> 'doing it right' while fixing it.
> ChangeLog:
> 2012-12-14 Adam Domurad
>
> Rewrite of MethodOverloadResolver with detailed unittests.
> * plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java:
> Rewritten to reduce duplicated code, fix very subtle bugs in
> never-tested codepaths, obey spec properly. Introduced new helper
> types
> where Object[] arrays with special-meaning positions were passed
> around.
> * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java:
> Updated to work with newly introduced types / refactored overload
> resolver.
> * tests/netx/unit/sun/applet/MethodOverloadResolverTest.java:
> In-depth
> unit tests of hairy details of method overloading in JS<->Java.
>
>
Ping?
-Adam
From ptisnovs at icedtea.classpath.org Thu Jan 10 00:29:40 2013
From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org)
Date: Thu, 10 Jan 2013 08:29:40 +0000
Subject: /hg/rhino-tests: Added three new tests for methods GetCanonicalN...
Message-ID:
changeset 7df6314535c9 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=7df6314535c9
author: Pavel Tisnovsky
date: Thu Jan 10 09:32:48 2013 +0100
Added three new tests for methods GetCanonicalName(), getConstructor() and
getDeclaredConstructor() into RhinoTests/BindingsClassTest.java.
diffstat:
ChangeLog | 6 ++
src/org/RhinoTests/BindingsClassTest.java | 72 ++++++++++++++++++++++++++++++-
2 files changed, 77 insertions(+), 1 deletions(-)
diffs (116 lines):
diff -r 90f140ca1129 -r 7df6314535c9 ChangeLog
--- a/ChangeLog Wed Jan 09 10:47:01 2013 +0100
+++ b/ChangeLog Thu Jan 10 09:32:48 2013 +0100
@@ -1,3 +1,9 @@
+2013-01-10 Pavel Tisnovsky
+
+ * src/org/RhinoTests/BindingsClassTest.java:
+ Added three new tests for methods GetCanonicalName(), getConstructor() and
+ getDeclaredConstructor().
+
2013-01-09 Pavel Tisnovsky
* src/org/RhinoTests/SimpleBindingsClassTest.java:
diff -r 90f140ca1129 -r 7df6314535c9 src/org/RhinoTests/BindingsClassTest.java
--- a/src/org/RhinoTests/BindingsClassTest.java Wed Jan 09 10:47:01 2013 +0100
+++ b/src/org/RhinoTests/BindingsClassTest.java Thu Jan 10 09:32:48 2013 +0100
@@ -1,7 +1,7 @@
/*
Rhino test framework
- Copyright (C) 2011, 2012 Red Hat
+ Copyright (C) 2011, 2012, 2013 Red Hat
This file is part of IcedTea.
@@ -45,6 +45,7 @@
import java.util.List;
import java.util.Map;
import java.util.HashMap;
+import java.util.TreeMap;
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
@@ -261,6 +262,15 @@
}
/**
+ * Test for method javax.script.Bindings.getClass().getCanonicalName()
+ */
+ protected void testGetCanonicalName() {
+ String canonicalName = this.bindingsClass.getCanonicalName();
+ assertEquals(canonicalName, "javax.script.Bindings",
+ "Method javax.script.Bindings.getClass().getCanonicalName() returns wrong value " + canonicalName);
+ }
+
+ /**
* Test for method javax.script.Bindings.getClass().getSuperclass()
*/
protected void testGetSuperclass() {
@@ -314,6 +324,66 @@
}
/**
+ * Test for method javax.script.Bindings.getClass().getConstructor()
+ */
+ protected void testGetConstructor() {
+ // following constructors should exist
+ Map constructorsThatShouldExist_jdk6 = new TreeMap();
+
+ Map constructorsThatShouldExist_jdk7 = new TreeMap();
+
+ Map constructorsThatShouldExist = getJavaVersion() < 7 ? constructorsThatShouldExist_jdk6 : constructorsThatShouldExist_jdk7;
+
+ // check if all required constructors really exist
+ for (Map.Entry constructorThatShouldExists : constructorsThatShouldExist.entrySet()) {
+ try {
+ Constructor constructor = this.bindingsClass.getConstructor(constructorThatShouldExists.getValue());
+ assertNotNull(constructor,
+ "constructor " + constructorThatShouldExists.getKey() + " not found");
+ String constructorName = constructor.getName();
+ assertNotNull(constructorName,
+ "constructor " + constructorThatShouldExists.getKey() + " does not have name assigned");
+ assertTrue(constructorName.equals(constructorThatShouldExists.getKey()),
+ "constructor " + constructorThatShouldExists.getKey() + " not found");
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ throw new AssertionError(e.getMessage());
+ }
+ }
+ }
+
+ /**
+ * Test for method javax.script.Bindings.getClass().getDeclaredConstructor()
+ */
+ protected void testGetDeclaredConstructor() {
+ // following constructors should exist
+ Map constructorsThatShouldExist_jdk6 = new TreeMap();
+
+ Map constructorsThatShouldExist_jdk7 = new TreeMap();
+
+ Map constructorsThatShouldExist = getJavaVersion() < 7 ? constructorsThatShouldExist_jdk6 : constructorsThatShouldExist_jdk7;
+
+ // check if all required constructors really exist
+ for (Map.Entry constructorThatShouldExists : constructorsThatShouldExist.entrySet()) {
+ try {
+ Constructor constructor = this.bindingsClass.getDeclaredConstructor(constructorThatShouldExists.getValue());
+ assertNotNull(constructor,
+ "constructor " + constructorThatShouldExists.getKey() + " not found");
+ String constructorName = constructor.getName();
+ assertNotNull(constructorName,
+ "constructor " + constructorThatShouldExists.getKey() + " does not have name assigned");
+ assertTrue(constructorName.equals(constructorThatShouldExists.getKey()),
+ "constructor " + constructorThatShouldExists.getKey() + " not found");
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ throw new AssertionError(e.getMessage());
+ }
+ }
+ }
+
+ /**
* Test for method javax.script.Bindings.getClass().getFields()
*/
protected void testGetFields() {
From jvanek at redhat.com Thu Jan 10 00:31:01 2013
From: jvanek at redhat.com (Jiri Vanek)
Date: Thu, 10 Jan 2013 09:31:01 +0100
Subject: [rfc][icedtea-web] centre of dialogues to centre of active monitor
In-Reply-To: <50EDC01E.5000103@redhat.com>
References: <50EC411D.9010702@redhat.com> <50EDBCA5.7020003@redhat.com>
<50EDC01E.5000103@redhat.com>
Message-ID: <50EE7C45.7080101@redhat.com>
On 01/09/2013 08:08 PM, Adam Domurad wrote:
> On 01/09/2013 01:53 PM, Adam Domurad wrote:
>> On 01/08/2013 10:54 AM, Jiri Vanek wrote:
>>> All dialogues in ITW are centred into middle of ALL monitors, which is really nasty.
>>> During splashscreen development I have centred into middle of default screen. Well better but not
>>> perfect.
>>> That time Omair suggested to centr into middle of active screen - active here is the one where is
>>> cursor.
>>> Well I have finally come with something like this:)
>>>
>>>
>> This looks OK to me, although I still get the dialog pop-ups flashing on the wrong screen
>> sometimes, before appearing on the correct one.
>>
>> Comments on impl class:
>>> +public class ScreenFinder {
>>> +
>>> + public static GraphicsDevice getCurrentScreen() {
>>> + Point p = MouseInfo.getPointerInfo().getLocation();
>>> + return getScreenOnCoords(p);
>>> +
>>> + }
>>> + public static Rectangle getCurrentScreenSizeWithoutBounds() {
>>> + Point p = MouseInfo.getPointerInfo().getLocation();
>>> + return getScreenOnCoordsWithutBounds(p);
>>> +
>>> + }
>>> +
>>> + public static void centerWindowsToCurrentScreen(Window w) {
>>> + Rectangle bounds = getCurrentScreenSizeWithoutBounds();
>>> + w.setLocation(bounds.x + (bounds.width - w.getWidth())/2,
>>> + bounds.y + (bounds.height - w.getHeight())/2);
>>> +
>>> + }
>>> +
>>> + public static GraphicsDevice getScreenOnCoords(Point point) {
>>> + GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment();
>>> + GraphicsDevice[] devices = e.getScreenDevices();
>>> + GraphicsDevice result = null;
>>> + //now get the configuration(s) for each device
>>> + for (GraphicsDevice device : devices) {
>>> + //GraphicsConfiguration[] configurations = device.getConfigurations();
>>> + //or?
>>
>> If you've settled on default device, I'd prefer to just simply use it.
>>
>>> + GraphicsConfiguration[] configurations = new
>>> GraphicsConfiguration[]{device.getDefaultConfiguration()};
>>> + for (GraphicsConfiguration config : configurations) {
>>> + Rectangle gcBounds = config.getBounds();
>>> + if (gcBounds.contains(point)) {
>>> + result = device;
>>> + }
>>> + }
>>> + }
>>> + if (result == null) {
>>> + //not found, get the default display
>>> + result = e.getDefaultScreenDevice();
>>> + }
>>> + return result;
>>> + }
>>> +
>>> + public static Rectangle getScreenOnCoordsWithutBounds(Point p) {
>>> + GraphicsDevice device = getScreenOnCoords(p);
>>> + Rectangle screenSize = device.getDefaultConfiguration().getBounds();
>>> + Insets insets =
>>> Toolkit.getDefaultToolkit().getScreenInsets(device.getDefaultConfiguration());
>>> + return new Rectangle((int)screenSize.getX()+insets.left,
>>> (int)screenSize.getY()+insets.top, (int)screenSize.getWidth()-insets.left,
>>> (int)screenSize.getHeight()-insets.bottom);
>>
>> I'd prefer 4 temporary variables for these coordinates.
>>
>>> + }
>>> +
>>> +
>>> +}
>>
>> OK to push otherwise, though.
>>
>> Thanks,
>> -Adam
>
> Hmm actually as well, the "Fatal: Launch Error: " shows up for me on wrong monitor.
Yap, that is true. There are(were) three types of dialogues in icedtea web.
Classical dialogues centerd by internal java implementation. Imho nothing we should touch. (but yes,
they can confuse usser by waiting on different screen).
I guess those dialogues are centred to middle of default screen.
Our dialogues, which were centred into middle of all screens. Nasty, fixed by above patch.
Our dialogues, however centred to somewhere else. Those should be probably found and fixed too.
Waiting with push to future IRC discussion.
Thanx, J.
From ptisnovs at icedtea.classpath.org Thu Jan 10 00:54:56 2013
From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org)
Date: Thu, 10 Jan 2013 08:54:56 +0000
Subject: /hg/gfx-test: Added four helper methods used to create test imag...
Message-ID:
changeset 96a64caaddec in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=96a64caaddec
author: Pavel Tisnovsky
date: Thu Jan 10 09:57:59 2013 +0100
Added four helper methods used to create test images into ImageFactory.java.
diffstat:
ChangeLog | 5 +
src/org/gfxtest/framework/ImageFactory.java | 166 ++++++++++++++++++++++++++++
2 files changed, 171 insertions(+), 0 deletions(-)
diffs (186 lines):
diff -r a243dee26a99 -r 96a64caaddec ChangeLog
--- a/ChangeLog Wed Jan 09 11:10:10 2013 +0100
+++ b/ChangeLog Thu Jan 10 09:57:59 2013 +0100
@@ -1,3 +1,8 @@
+2013-01-10 Pavel Tisnovsky
+
+ * src/org/gfxtest/framework/ImageFactory.java:
+ Added four helper methods used to create test images.
+
2013-01-09 Pavel Tisnovsky
* src/org/gfxtest/testsuites/BitBltUsingBgColor.java:
diff -r a243dee26a99 -r 96a64caaddec src/org/gfxtest/framework/ImageFactory.java
--- a/src/org/gfxtest/framework/ImageFactory.java Wed Jan 09 11:10:10 2013 +0100
+++ b/src/org/gfxtest/framework/ImageFactory.java Thu Jan 10 09:57:59 2013 +0100
@@ -733,4 +733,170 @@
// return buffered image containing computed color pattern
return image;
}
+
+ /**
+ * Create image containing red 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 createHorizontalRedGradientImage(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);
+ // 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 red 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 createVerticalRedGradientImage(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);
+ image.setRGB(x, y, color);
+ }
+ }
+
+ // return buffered image containing computed color pattern
+ return image;
+ }
+
+ /**
+ * Create image containing red to blue 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 createHorizontalRedToBlueGradientImage(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 invrgb = 255 - rgb;
+ int color = (0xff << 24) | (rgb << 16) | invrgb;
+ // 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 red to blue 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 createVerticalRedToBlueGradientImage(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 invrgb = 255 - rgb;
+ int color = (0xff << 24) | (rgb << 16) | invrgb;
+ image.setRGB(x, y, color);
+ }
+ }
+
+ // return buffered image containing computed color pattern
+ return image;
+ }
}
From jvanek at icedtea.classpath.org Thu Jan 10 04:18:16 2013
From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org)
Date: Thu, 10 Jan 2013 12:18:16 +0000
Subject: /hg/icedtea-web: First part of fix of recreating desktop icon
Message-ID:
changeset 1b86028e546b in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=1b86028e546b
author: Jiri Vanek
date: Thu Jan 10 13:18:45 2013 +0100
First part of fix of recreating desktop icon
Another fix can be addition of buttons like always/never
diffstat:
ChangeLog | 20 +
NEWS | 1 +
netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java | 10 +-
netx/net/sourceforge/jnlp/util/XDesktopEntry.java | 119 ++++++-
tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java | 188 ++++++++++
5 files changed, 333 insertions(+), 5 deletions(-)
diffs (423 lines):
diff -r d95b456959e5 -r 1b86028e546b ChangeLog
--- a/ChangeLog Wed Jan 09 18:32:08 2013 +0100
+++ b/ChangeLog Thu Jan 10 13:18:45 2013 +0100
@@ -1,3 +1,23 @@
+2013-01-09 Jiri Vanek
+
+ First part of fix of recreating desktop icon
+ * NEWS: mentioned PR725
+ * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java:
+ (addMenuAndDesktopEntries)added check for already existing icon
+ * netx/net/sourceforge/jnlp/util/XDesktopEntry.java: Added methods for
+ digging the already existing icon from system
+ (getShortcutTmpFile) tmpfile fo generating the desktop icon
+ (getDesktopIconName) for getting filename from application title
+ (findFreedesktopOrgDesktopPathCatch) public method to find final desktop file
+ (findFreedesktopOrgDesktopPath) to get into ~/.config/user-dirs.dirs
+ (getFreedesktopOrgDesktopPathFrom) to find XDG_DESKTOP_DIR value
+ (filterQuotes) to handle simple quotations
+ (evaluateLinuxVariables) to handle possible variables in XDG_DESKTOP_DIR
+ value
+ * tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java:
+ New tests focused on parsing of desktop location from stream (variables
+ and quotations)
+
2013-01-09 Jiri Vanek
Logging methods made synchronized
diff -r d95b456959e5 -r 1b86028e546b NEWS
--- a/NEWS Wed Jan 09 18:32:08 2013 +0100
+++ b/NEWS Thu Jan 10 13:18:45 2013 +0100
@@ -16,6 +16,7 @@
- CVE-2012-3423, RH841345: Incorrect handling of not 0-terminated strings
* NetX
- PR1027: DownloadService is not supported by IcedTea-Web
+ - PR725: JNLP applications will prompt for creating desktop shortcuts every time they are run
* Plugin
- PR1106: Buffer overflow in plugin table-
- PR1166: Embedded JNLP File is not supported in applet tag
diff -r d95b456959e5 -r 1b86028e546b netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java
--- a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Wed Jan 09 18:32:08 2013 +0100
+++ b/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java Thu Jan 10 13:18:45 2013 +0100
@@ -17,6 +17,7 @@
package net.sourceforge.jnlp.runtime;
import java.awt.Window;
+import java.io.File;
import java.net.URL;
import java.security.AccessControlContext;
import java.security.AccessController;
@@ -146,7 +147,14 @@
private void addMenuAndDesktopEntries() {
XDesktopEntry entry = new XDesktopEntry(file);
ShortcutDesc sd = file.getInformation().getShortcut();
-
+ File possibleDesktopFile = entry.getLinuxDesktopIconFile();
+ if (possibleDesktopFile.exists()) {
+ if (JNLPRuntime.isDebug()) {
+ System.out.println("ApplicationInstance.addMenuAndDesktopEntries(): file - "
+ + possibleDesktopFile.getAbsolutePath() + " already exists. Not proceeding with desktop additions");
+ }
+ return;
+ }
if (shouldCreateShortcut(sd)) {
entry.createDesktopShortcut();
}
diff -r d95b456959e5 -r 1b86028e546b netx/net/sourceforge/jnlp/util/XDesktopEntry.java
--- a/netx/net/sourceforge/jnlp/util/XDesktopEntry.java Wed Jan 09 18:32:08 2013 +0100
+++ b/netx/net/sourceforge/jnlp/util/XDesktopEntry.java Thu Jan 10 13:18:45 2013 +0100
@@ -16,16 +16,25 @@
package net.sourceforge.jnlp.util;
+import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
+import java.io.FileReader;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.StringReader;
import java.net.URL;
import java.nio.charset.Charset;
+import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
import net.sourceforge.jnlp.IconDesc;
import net.sourceforge.jnlp.JNLPFile;
@@ -78,7 +87,7 @@
String fileContents = "[Desktop Entry]\n";
fileContents += "Version=1.0\n";
- fileContents += "Name=" + sanitize(file.getTitle()) + "\n";
+ fileContents += "Name=" + getDesktopIconName() + "\n";
fileContents += "GenericName=Java Web Start Application\n";
fileContents += "Comment=" + sanitize(file.getInformation().getDescription()) + "\n";
fileContents += "Type=Application\n";
@@ -122,6 +131,12 @@
return iconSize;
}
+ public File getShortcutTmpFile() {
+ String userTmp = JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_USER_TMP_DIR);
+ File shortcutFile = new File(userTmp + File.separator + FileUtils.sanitizeFileName(file.getTitle()) + ".desktop");
+ return shortcutFile;
+ }
+
/**
* Set the icon size to use for the desktop shortcut
*
@@ -148,9 +163,7 @@
* Install this XDesktopEntry into the user's desktop as a launcher
*/
private void installDesktopLauncher() {
- File shortcutFile = new File(JNLPRuntime.getConfiguration()
- .getProperty(DeploymentConfiguration.KEY_USER_TMP_DIR)
- + File.separator + FileUtils.sanitizeFileName(file.getTitle()) + ".desktop");
+ File shortcutFile = getShortcutTmpFile();
try {
if (!shortcutFile.getParentFile().isDirectory() && !shortcutFile.getParentFile().mkdirs()) {
@@ -234,4 +247,102 @@
}
}
+ public String getDesktopIconName() {
+ return sanitize(file.getTitle());
+ }
+
+ public File getLinuxDesktopIconFile() {
+ return new File(findFreedesktopOrgDesktopPathCatch() + "/" + getDesktopIconName() + ".desktop");
+ }
+
+ private static String findFreedesktopOrgDesktopPathCatch() {
+ try {
+ return findFreedesktopOrgDesktopPath();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ return System.getProperty("user.home") + "/Desktop/";
+ }
+ }
+
+ /**
+ * Instead of having all this parsing of user-dirs.dirs and replacing
+ * variables we can execute `echo $(xdg-user-dir DESKTOP)` and it will do
+ * all the job in case approaches below become failing
+ *
+ * @return variables (if declared) and quotation marks (unless escaped) free
+ * path
+ * @throws IOException if no file do not exists or key with desktop do not
+ * exists
+ */
+ private static String findFreedesktopOrgDesktopPath() throws IOException {
+ File userDirs = new File(System.getProperty("user.home") + "/.config/user-dirs.dirs");
+ if (!userDirs.exists()) {
+ return System.getProperty("user.home") + "/Desktop/";
+ }
+ return getFreedesktopOrgDesktopPathFrom(userDirs);
+ }
+
+ private static String getFreedesktopOrgDesktopPathFrom(File userDirs) throws IOException {
+ BufferedReader r = new BufferedReader(new FileReader(userDirs));
+ try {
+ return getFreedesktopOrgDesktopPathFrom(r);
+ } finally {
+ r.close();
+ }
+
+ }
+ static final String XDG_DESKTOP_DIR = "XDG_DESKTOP_DIR";
+
+ static String getFreedesktopOrgDesktopPathFrom(BufferedReader r) throws IOException {
+ while (true) {
+ String s = r.readLine();
+ if (s == null) {
+ throw new IOException("End of user-dirs found, but no " + XDG_DESKTOP_DIR + " key found");
+ }
+ s = s.trim();
+ if (s.startsWith(XDG_DESKTOP_DIR)) {
+ if (!s.contains("=")) {
+ throw new IOException(XDG_DESKTOP_DIR + " has no value");
+ }
+ String[] keyAndValue = s.split("=");
+ keyAndValue[1] = keyAndValue[1].trim();
+ String filteredQuotes = filterQuotes(keyAndValue[1]);
+ return evaluateLinuxVariables(filteredQuotes);
+ }
+ }
+ }
+ private static final String MIC = "MAGIC_QUOTIN_ITW_CONSTANT_FOR_DUMMIES";
+
+ private static String filterQuotes(String string) {
+ //get rid of " but not of
+ String s = string.replaceAll("\\\\\"", MIC);
+ s = s.replaceAll("\"", "");
+ s = s.replaceAll(MIC, "\\\"");
+ return s;
+ }
+
+ private static String evaluateLinuxVariables(String orig) {
+ return evaluateLinuxVariables(orig, System.getenv());
+ }
+
+ private static String evaluateLinuxVariables(String orig, Map variables) {
+ Set> env = variables.entrySet();
+ List> envVariables = new ArrayList>(env);
+ Collections.sort(envVariables, new Comparator>() {
+ @Override
+ public int compare(Entry o1, Entry o2) {
+ return o2.getKey().length() - o1.getKey().length();
+ }
+ });
+ while (true) {
+ String before = orig;
+ for (Entry entry : envVariables) {
+ orig = orig.replaceAll("\\$" + entry.getKey(), entry.getValue());
+ }
+ if (before.equals(orig)) {
+ return orig;
+ }
+ }
+
+ }
}
diff -r d95b456959e5 -r 1b86028e546b tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java Thu Jan 10 13:18:45 2013 +0100
@@ -0,0 +1,188 @@
+/*
+ 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.
+ */
+package net.sourceforge.jnlp.util;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.StringReader;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import net.sourceforge.jnlp.ServerAccess;
+import net.sourceforge.jnlp.annotations.KnownToFail;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class XDesktopEntryTest {
+
+ private static final String des1 = "/my/little/Desktop";
+ private static final String des2name = "Plocha";
+ private static final String des2Res = System.getProperty("user.home") + "/" + des2name;
+ private static final String HOME = "HOME";
+ private static final String des2 = "$" + HOME + "/" + des2name;
+ private static final String des7 = "\"$" + HOME + "/" + des2name + "\"";
+ private static final String des7res = System.getProperty("user.home") + "/" + des2name;
+ private static final String des8 = "\\\"$" + HOME + "/" + des2name + "\\\"";
+ private static final String des8res = "\"" + System.getProperty("user.home") + "/" + des2name + "\"";
+ private static final String des9 = "\"$" + HOME + "/\\\"" + des2name + "\\\"\"";
+ private static final String des9res = System.getProperty("user.home") + "/\"" + des2name + "\"";
+ private static final String src1 = XDesktopEntry.XDG_DESKTOP_DIR + "=" + des1;
+ private static final String src2 = " " + XDesktopEntry.XDG_DESKTOP_DIR + " = " + des1;
+ private static final String src3 = "#" + XDesktopEntry.XDG_DESKTOP_DIR + " = " + des1;
+ private static final String src4 = XDesktopEntry.XDG_DESKTOP_DIR + "=" + des2;
+ private static final String src5 = " " + XDesktopEntry.XDG_DESKTOP_DIR + " = " + des2;
+ private static final String src6 = "#" + XDesktopEntry.XDG_DESKTOP_DIR + " = " + des2;
+ private static final String src7 = XDesktopEntry.XDG_DESKTOP_DIR + " = " + des7;
+ private static final String src8 = XDesktopEntry.XDG_DESKTOP_DIR + " = " + des8;
+ private static final String src9 = XDesktopEntry.XDG_DESKTOP_DIR + " = " + des9;
+ private static Map backupedEnv;
+
+ @BeforeClass
+ public static void ensureHomeVaribale() throws NoSuchFieldException, IllegalAccessException, IllegalArgumentException, ClassNotFoundException {
+ ServerAccess.logOutputReprint("Environment");
+ envToString();
+ Map env = System.getenv();
+ if (env.containsKey(HOME)) {
+ backupedEnv = null;
+ } else {
+ backupedEnv = env;
+ Map m = new HashMap(env);
+ m.put(HOME, System.getProperty("user.home"));
+ fakeEnvironment(m);
+ ServerAccess.logOutputReprint("Hacked environment");
+ envToString();
+ }
+ }
+
+ @AfterClass
+ public static void restoreHomeVaribale() throws NoSuchFieldException, IllegalAccessException, IllegalArgumentException, ClassNotFoundException {
+ Map env = System.getenv();
+ if (backupedEnv != null) {
+ fakeEnvironment(backupedEnv);
+ ServerAccess.logOutputReprint("Restored environment");
+ envToString();
+ }
+ }
+
+ private static void fakeEnvironment(Map m) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException, ClassNotFoundException {
+ Class> processEnvironmentClass = Class.forName("java.lang.ProcessEnvironment");
+ Field env = processEnvironmentClass.getDeclaredField("theUnmodifiableEnvironment");
+ env.setAccessible(true);
+ // remove final modifier from field
+ Field modifiersField = Field.class.getDeclaredField("modifiers");
+ modifiersField.setAccessible(true);
+ modifiersField.setInt(env, env.getModifiers() & ~Modifier.FINAL);
+ env.set(null, m);
+ }
+
+ @Test
+ @KnownToFail
+ public void testHomeVariable() {
+ Assert.assertTrue("Variable home must be in environment of this run, is not", System.getenv().containsKey(HOME));
+ Assert.assertNull("Variable home should be declared before test run, but was not and so is faked. This should be ok and is thrown just for record. See output of ensureHomeVaribale and restoreHomeVaribale", backupedEnv);
+ }
+
+ @Test
+ public void getFreedesktopOrgDesktopPathFromtestSimple() throws IOException {
+ String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new StringReader(src1)));
+ Assert.assertEquals(s, des1);
+ }
+
+ @Test
+ public void getFreedesktopOrgDesktopPathFromtestSpaced() throws IOException {
+ String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new StringReader(src2)));
+ Assert.assertEquals(s, des1);
+ }
+
+ @Test(expected = IOException.class)
+ public void getFreedesktopOrgDesktopPathFromtestCommented() throws IOException {
+ String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new StringReader(src3)));
+ }
+
+ @Test
+ public void getFreedesktopOrgDesktopPathFromtestSimpleWithHome() throws IOException {
+ String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new StringReader(src4)));
+ Assert.assertEquals(s, des2Res);
+ }
+
+ @Test
+ public void getFreedesktopOrgDesktopPathFromtestSpacedWithHome() throws IOException {
+ String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new StringReader(src5)));
+ Assert.assertEquals(s, des2Res);
+ }
+
+ @Test
+ public void getFreedesktopOrgDesktopPathFromtestSpacedWithHomeAndQuotes() throws IOException {
+ String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new StringReader(src7)));
+ Assert.assertEquals(s, des7res);
+ }
+
+ @Test
+ public void getFreedesktopOrgDesktopPathFromtestSpacedWithHomeAndEscapedQuotes() throws IOException {
+ String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new StringReader(src8)));
+ Assert.assertEquals(s, des8res);
+ }
+ @Test
+ public void getFreedesktopOrgDesktopPathFromtestSpacedWithHomeAndMixedQuotes() throws IOException {
+ String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new StringReader(src9)));
+ Assert.assertEquals(s, des9res);
+ }
+
+ @Test(expected = IOException.class)
+ public void getFreedesktopOrgDesktopPathFromtestCommentedWithHome() throws IOException {
+ String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new StringReader(src6)));
+ }
+
+ private static void envToString() {
+ mapToString(System.getenv());
+ }
+
+ private static void mapToString(Map variables) {
+ Set> env = variables.entrySet();
+ for (Map.Entry entry : env) {
+ ServerAccess.logOutputReprint(entry.getKey() + " = " + entry.getValue());
+ }
+ }
+}
\ No newline at end of file
From jvanek at redhat.com Thu Jan 10 04:27:19 2013
From: jvanek at redhat.com (Jiri Vanek)
Date: Thu, 10 Jan 2013 13:27:19 +0100
Subject: [rfc][icedtea-web] Fix for PR1198, JSObject passed incorrectly
to Javascript
In-Reply-To: <50EB0802.8030803@redhat.com>
References: <50B92039.4070304@redhat.com> <50BCF77F.2020808@redhat.com>
<50E6A438.1010605@redhat.com> <50E70F2D.2070805@redhat.com>
<50EAE14D.5050505@redhat.com> <50EAEE24.2080804@redhat.com>
<50EAFB5A.9000104@redhat.com> <50EB0802.8030803@redhat.com>
Message-ID: <50EEB3A7.1010401@redhat.com>
Well I'm ok with current implementation and testing. Lets wait for Jana's final word. She promissed
to check today evening/yesterday.
J.
From jvanek at redhat.com Thu Jan 10 06:33:00 2013
From: jvanek at redhat.com (Jiri Vanek)
Date: Thu, 10 Jan 2013 15:33:00 +0100
Subject: [rfc][icedtea-web] make download indicator more compact
In-Reply-To: <50EDC8E3.8060505@redhat.com>
References: <50E5ACDF.7080609@redhat.com> <50E704C5.4060300@redhat.com>
<50EADE9F.3000101@redhat.com> <50EB1B33.4020605@redhat.com>
<50EC440E.2080409@redhat.com> <50EDC8E3.8060505@redhat.com>
Message-ID: <50EED11C.8060504@redhat.com>
On 01/09/2013 08:45 PM, Adam Domurad wrote:
> On 01/08/2013 11:06 AM, Jiri Vanek wrote:
>> On 01/07/2013 08:00 PM, Adam Domurad wrote:
>>> On 01/07/2013 09:41 AM, Jiri Vanek wrote:
>>>> On 01/04/2013 05:35 PM, Adam Domurad wrote:
>>>>> On 01/03/2013 11:07 AM, Jiri Vanek wrote:
>>>>>> Hi!
>>>>>>
>>>>>> This patch is adding "show details" to download indicator. For One jar jnlp files it behaviour is
>>>>>> unaffected. For Multiple jars there is just one progress bar, but can be shown "old stile"
>>>>>> detailed one via clicking to "Show details". Then can be minimalised by "hide details". Button is
>>>>>> localised.
>>>>>>
>>>>>> The button is nasty not nice.. Any better idea? but still this is better then previous approach.
>>>>>>
>>>>>> Looking forward to have this inside!
>>>>>>
>>>>>> Best rigards
>>>>>> J.
>>>>>
>>>>> Thanks for looking into this! I was actually comparing our download indicator to proprietary just
>>>>> yesterday, while staring at multiple jars downloading. The average user does not want to know
>>>>> about
>>>>> the jars being downloaded, in fact I think such information can look scary :-).
>>>>>
>>>>>> diff -r 9549226afa8f netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java
>>>>>> --- a/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java Thu Jan 03 09:54:16 2013
>>>>>> +0100
>>>>>> +++ b/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java Thu Jan 03 17:07:28 2013
>>>>>> +0100
>>>>>> @@ -62,6 +62,7 @@
>>>>>>
>>>>>> /** shared constraint */
>>>>>> static GridBagConstraints vertical;
>>>>>> + static GridBagConstraints verticalNoClean;
>>>>>> static GridBagConstraints verticalIndent;
>>>>>> static {
>>>>>> vertical = new GridBagConstraints();
>>>>>> @@ -70,8 +71,12 @@
>>>>>> vertical.fill = GridBagConstraints.HORIZONTAL;
>>>>>> vertical.anchor = GridBagConstraints.WEST;
>>>>>>
>>>>>> + verticalNoClean = new GridBagConstraints();
>>>>>> + verticalNoClean.weightx = 1.0;
>>>>>> +
>>>>>> verticalIndent = (GridBagConstraints) vertical.clone();
>>>>>> verticalIndent.insets = new Insets(0, 10, 3, 0);
>>>>>> +
>>>>>
>>>>> Nit: These two blank lines (and all the ones added below) have tabs :-)
>>>>>
>>>>>> }
>>>>>>
>>>>>> /**
>>>>>> @@ -114,15 +119,15 @@
>>>>>>
>>>>>> frame.getContentPane().add(result, vertical);
>>>>>> frame.pack();
>>>>>> -
>>>>>> if (!frame.isVisible()) {
>>>>>> - Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
>>>>>> - Insets insets =
>>>>>> Toolkit.getDefaultToolkit().getScreenInsets(frame.getGraphicsConfiguration());
>>>>>> - Dimension screen = new Dimension(screenSize.width - insets.left,
>>>>>> - screenSize.height - insets.top);
>>>>>> - frame.setLocation(screen.width - frame.getWidth(),
>>>>>> - screen.height - frame.getHeight());
>>>>>> + placeFrameToLowerRight();
>>>>>> }
>>>>>> + result.addComponentListener(new ComponentAdapter() {
>>>>>> + @Override
>>>>>> + public void componentResized(ComponentEvent e) {
>>>>>> + placeFrameToLowerRight();
>>>>>> + }
>>>>>> + });
>>>>>>
>>>>>> frame.setVisible(true);
>>>>>>
>>>>>> @@ -131,6 +136,32 @@
>>>>>> }
>>>>>>
>>>>>> /**
>>>>>> + * The insets are calculated differently during first appearance
>>>>>> + * and during another appearance in case of some configurations.
>>>>>> + *
>>>>>> + * So the first value is stored to avoid jumping of window during later packing
>>>>>> + * of frame.
>>>>>> + *
>>>>>> + * However the second calculation is more correct:(
>>>>>> + *
>>>>>> + * This is affecting only multiple monitors which have different assets.
>>>>>> + * The underlying issue is that Toolkit.getDefaultToolkit().getScreenInsets
>>>>>> + * is returning assets for "random" monitor.
>>>>>> + */
>>>>>> + Dimension screen = null;
>>>>>> +
>>>>>> + private void placeFrameToLowerRight() throws HeadlessException {
>>>>>> + if (screen == null) {
>>>>>> + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
>>>>>> + Insets insets =
>>>>>> Toolkit.getDefaultToolkit().getScreenInsets(frame.getGraphicsConfiguration());
>>>>>> + screen = new Dimension(screenSize.width - insets.left,
>>>>>> + screenSize.height - insets.top);
>>>>>> + }
>>>>>> + frame.setLocation(screen.width - frame.getWidth(),
>>>>>> + screen.height - frame.getHeight());
>>>>>> + }
>>>>>> +
>>>>>> + /**
>>>>>> * Remove a download service listener that was obtained by
>>>>>> * calling the getDownloadListener method from the shared
>>>>>> * download info window.
>>>>>> @@ -163,12 +194,26 @@
>>>>>> * Groups the url progress in a panel.
>>>>>> */
>>>>>> static class DownloadPanel extends JPanel implements DownloadServiceListener {
>>>>>> -
>>>>>> + private static enum States{
>>>>>> + oneJAr, collapsed, detailed;
>>>>>
>>>>> Enums should be all-caps
>>>>>
>>>>>> +
>>>>>> + }
>>>>>> +
>>>>>> + private static final String DETAILS=R("ButShowDetails");
>>>>>> + private static final String HIDE_DETAILS=R("ButHideDetails");
>>>>>> /** the download name */
>>>>>> private String downloadName;
>>>>>>
>>>>>> /** Downloading part: */
>>>>>> private JLabel header = new JLabel();
>>>>>> + /** Show/hide details button: */
>>>>>> + private JButton details = new JButton(DETAILS);
>>>>>> + /** used instead of details button in case of one jar*/
>>>>>> + private JLabel delimiter = new JLabel("");
>>>>>> + /** all already created progress bars*/
>>>>>> + private List progressPanels = new ArrayList();
>>>>>> + private States state=States.oneJAr;
>>>>>> + private ProgressPanel mainProgressPanel;
>>>>>>
>>>>>> /** list of URLs being downloaded */
>>>>>> private List urls = new ArrayList();
>>>>>> @@ -176,6 +221,7 @@
>>>>>> /** list of ProgressPanels */
>>>>>> private List panels = new ArrayList();
>>>>>>
>>>>>> +
>>>>>
>>>>> Nit: two blank lines are unnecessary.
>>>>>
>>>>>> /**
>>>>>> * Create a new download panel for with the specified download
>>>>>> * name.
>>>>>> @@ -184,9 +230,35 @@
>>>>>> setLayout(new GridBagLayout());
>>>>>>
>>>>>> this.downloadName = downloadName;
>>>>>> - this.add(header, vertical);
>>>>>> + this.add(header, verticalNoClean);
>>>>>> header.setFont(header.getFont().deriveFont(Font.BOLD));
>>>>>> -
>>>>>> + this.add(delimiter, vertical);
>>>>>> + details.addActionListener(new ActionListener() {
>>>>>> + @Override
>>>>>> + public void actionPerformed(ActionEvent e) {
>>>>>> + if (state == States.detailed) {
>>>>>> + state = States.collapsed;
>>>>>> + details.setText(DETAILS);
>>>>>> + for (ProgressPanel progressPanel : progressPanels) {
>>>>>> + remove(progressPanel);
>>>>>> + }
>>>>>> + add(mainProgressPanel, verticalIndent);
>>>>>> + synchronized (frameMutex) {
>>>>>> + frame.pack();
>>>>>> + }
>>>>>> + } else {
>>>>>> + state = States.detailed;
>>>>>> + details.setText(HIDE_DETAILS);
>>>>>> + remove(mainProgressPanel);
>>>>>> + for (ProgressPanel progressPanel : progressPanels) {
>>>>>> + add(progressPanel, verticalIndent);
>>>>>> + }
>>>>>> + synchronized (frameMutex) {
>>>>>> + frame.pack();
>>>>>> + }
>>>>>> + }
>>>>>> + }
>>>>>> + });
>>>>>> setOverallPercent(0);
>>>>>> }
>>>>>>
>>>>>> @@ -196,14 +268,25 @@
>>>>>> protected void addProgressPanel(URL url, String version) {
>>>>>> if (!urls.contains(url)) {
>>>>>> ProgressPanel panel = new ProgressPanel(url, version);
>>>>>> -
>>>>>> - add(panel, verticalIndent);
>>>>>> + if (state != States.collapsed) {
>>>>>> + add(panel, verticalIndent);
>>>>>> + }
>>>>>> + progressPanels.add(panel);
>>>>>> + urls.add(url);
>>>>>> + panels.add(panel);
>>>>>> + if (panels.size() == 2){
>>>>>
>>>>> Small comment here would be good explaining why this 'magic number'
>>>>>
>>>>>> + remove(panels.get(0));
>>>>>> + remove(panels.get(1));
>>>>>> + remove(delimiter);
>>>>>> + add(details,vertical);
>>>>>> + mainProgressPanel=new ProgressPanel();
>>>>>> + add(mainProgressPanel, verticalIndent);
>>>>>> + state=States.collapsed;
>>>>>> + }
>>>>>> synchronized (frameMutex) {
>>>>>> frame.pack();
>>>>>> }
>>>>>>
>>>>>> - urls.add(url);
>>>>>> - panels.add(panel);
>>>>>> }
>>>>>> }
>>>>>>
>>>>>> @@ -219,10 +302,10 @@
>>>>>> addProgressPanel(url, version);
>>>>>>
>>>>>> setOverallPercent(overallPercent);
>>>>>> -
>>>>>> ProgressPanel panel = panels.get(urls.indexOf(url));
>>>>>> panel.setProgress(readSoFar, total);
>>>>>> panel.repaint();
>>>>>> +
>>>>>> }
>>>>>> };
>>>>>> SwingUtilities.invokeLater(r);
>>>>>> @@ -230,12 +313,28 @@
>>>>>>
>>>>>> /**
>>>>>> * Sets the overall percent completed.
>>>>>> + * should be called via invokeLater
>>>>>> */
>>>>>> public void setOverallPercent(int percent) {
>>>>>> // don't get whole string from resource and sub in
>>>>>> // values because it'll be doing a MessageFormat for
>>>>>> // each update.
>>>>>> header.setText(downloading + " " + downloadName + ": " + percent + "% " + complete +
>>>>>> ".");
>>>>>> + Container c = header.getParent();
>>>>>> + //we need to adapt nbboth panels and also frame to new length of header text
>>>>>
>>>>> nbboth > both
>>>>>
>>>>>> + while (c != null) {
>>>>>> + c.invalidate();
>>>>>> + c.validate();
>>>>>> + if (c instanceof Window){
>>>>>> + ((Window) c).pack();
>>>>>> + }
>>>>>> + c=c.getParent();
>>>>>> + }
>>>>>> +
>>>>>> + if (mainProgressPanel != null) {
>>>>>> + mainProgressPanel.setProgress(percent, 100);
>>>>>> + mainProgressPanel.repaint();
>>>>>> + }
>>>>>> }
>>>>>>
>>>>>> /**
>>>>>> @@ -276,12 +375,28 @@
>>>>>>
>>>>>> private long total;
>>>>>> private long readSoFar;
>>>>>> + private Dimension size = new Dimension(80, 15);
>>>>>>
>>>>>> + ProgressPanel() {
>>>>>> + bar.setMinimumSize(size);
>>>>>> + bar.setPreferredSize(size);
>>>>>> + bar.setOpaque(false);
>>>>>> +
>>>>>> + setLayout(new GridBagLayout());
>>>>>> +
>>>>>> + GridBagConstraints gbc = new GridBagConstraints();
>>>>>> + styleGridBagConstraints(gbc);
>>>>>> + add(bar, gbc);
>>>>>> + }
>>>>>> +
>>>>>> ProgressPanel(URL url, String version) {
>>>>>> - JLabel location = new JLabel(" " + url.getHost() + "/" + url.getFile());
>>>>>> + this(" " + url.getHost() + "/" + url.getFile(),version);
>>>>>> + }
>>>>>> + ProgressPanel(String caption, String version) {
>>>>>> + JLabel location = new JLabel(caption);
>>>>>>
>>>>>> - bar.setMinimumSize(new Dimension(80, 15));
>>>>>> - bar.setPreferredSize(new Dimension(80, 15));
>>>>>> + bar.setMinimumSize(size);
>>>>>> + bar.setPreferredSize(size);
>>>>>> bar.setOpaque(false);
>>>>>>
>>>>>> setLayout(new GridBagLayout());
>>>>>> @@ -291,12 +406,8 @@
>>>>>> gbc.fill = GridBagConstraints.NONE;
>>>>>> gbc.gridwidth = GridBagConstraints.RELATIVE;
>>>>>> add(bar, gbc);
>>>>>> -
>>>>>> - gbc.insets = new Insets(0, 3, 0, 0);
>>>>>> - gbc.weightx = 1.0;
>>>>>> - gbc.fill = GridBagConstraints.HORIZONTAL;
>>>>>> - gbc.gridwidth = GridBagConstraints.REMAINDER;
>>>>>> - gbc.anchor = GridBagConstraints.WEST;
>>>>>> +
>>>>>> + styleGridBagConstraints(gbc);
>>>>>> add(location, gbc);
>>>>>> }
>>>>>>
>>>>>> @@ -325,6 +436,14 @@
>>>>>> g.fillRect(x + 1, y + 1, divide - 1, h - 1);
>>>>>> }
>>>>>> }
>>>>>> +
>>>>>> + private void styleGridBagConstraints(GridBagConstraints gbc) {
>>>>>> + gbc.insets = new Insets(0, 3, 0, 0);
>>>>>> + gbc.weightx = 1.0;
>>>>>> + gbc.fill = GridBagConstraints.HORIZONTAL;
>>>>>> + gbc.gridwidth = GridBagConstraints.REMAINDER;
>>>>>> + gbc.anchor = GridBagConstraints.WEST;
>>>>>> + }
>>>>>> };
>>>>>>
>>>>>> }
>>>>>
>>>>> Code looks OK nits aside.
>>>>
>>>> Thanx for nits. Should be fixed now
>>>>>
>>>>> As for button ... yes it is nasty. IMO maybe we can take different approach here. The people
>>>>> interested in how the individual jars are downloading would mainly be 1. us trying to fix jar
>>>>> loading issues, 2. developers looking into jar loading issues.
>>>>>
>>>>> So what if the ICEDTEAPLUGIN_DEBUG environment variable turned this on/off ? It can be argued
>>>>> it is
>>>>> a bit hard for developers to access, but it isn't any easier to access this information from
>>>>> oracle
>>>>> plugin.
>>>>
>>>> I think I don't like this idea :(
>>>
>>> No problem, but can you elaborate why not?
>>
>> When it took to long to downld application, I'm happy to see whats going on. Maybe I can spot some
>> 3rd party jar to be stuck and then I can ping them. And I definitely do not want to look for
>> environmetn variables.
>>>
>>>> I have added an attempt to use an icon, And I must say it is much better. Btw, I have created
>>>> this icon.. so no wonders here :) But looks quite cool :)
>>>
>>> It looks OK :-) The glass part could use some transparency.
>> blah :)
>>
>>> There should be a slightly different icon from going from detailed ->compact.
>> As you wish, however, I do not like the red cross I have added :(
>>
>>>
>>>>
>>>>>
>>>>> As well, I would be very happy to see the loading bar integrated with the splash screen (if splash
>>>>> screen is on). I believe this would nicely complement the user friendliness of the splash screen.
>>>>
>>>> You mean to sync progress on progress bar with the one in splash? Or also showing the downlaoded
>>>> resources somehow and show details button in splash?
>>>
>>> I was thinking always have progress bar on splash, and have detailed view hide/show the download
>>> bars in corner. IMO this is good for now, except:
>> I agree. It can came in some future.
>>
>>> 1. visual glitches such as http://i.imgur.com/Oveuh.png (with text flickering from middle to top
>>> every frame). As well on dual monitors expanding/compacting view constantly changed screens for me.
>> Well I was not able to reproduce today :-/
>> However I have changed the implementation and So I hope that it will behave better in your
>> configuration.
>>
>> Please note, now this patch is depending on [rfc][icedtea-web] centre of dialogues to centre of
>> active monitor.
>> Sorry for inconvenience here:(
>>
>>> 2. A different style button/icon from going detailed->compact.
>>
>> How different? (in context of this patch/in global)?
>
> Just a different icon, like you added.
>
> patch:
>> diff -r 02981a272327 netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java
>> --- a/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java Mon Jan 07 11:47:32 2013 -0500
>> +++ b/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java Tue Jan 08 15:26:23 2013 +0100
>> @@ -29,6 +29,7 @@
>>
>> import net.sourceforge.jnlp.runtime.*;
>> import net.sourceforge.jnlp.util.ImageResources;
>> +import net.sourceforge.jnlp.util.ScreenFinder;
>>
>> /**
>> * Show the progress of downloads.
>> @@ -62,6 +63,7 @@
>>
>> /** shared constraint */
>> static GridBagConstraints vertical;
>> + static GridBagConstraints verticalNoClean;
>> static GridBagConstraints verticalIndent;
>> static {
>> vertical = new GridBagConstraints();
>> @@ -70,6 +72,9 @@
>> vertical.fill = GridBagConstraints.HORIZONTAL;
>> vertical.anchor = GridBagConstraints.WEST;
>>
>> + verticalNoClean = new GridBagConstraints();
>> + verticalNoClean.weightx = 1.0;
>> +
>> verticalIndent = (GridBagConstraints) vertical.clone();
>> verticalIndent.insets = new Insets(0, 10, 3, 0);
>> }
>> @@ -101,9 +106,7 @@
>>
>> synchronized (frameMutex) {
>> if (frame == null) {
>> - frame = new JFrame(downloading + "...");
>> - frame.setIconImages(ImageResources.INSTANCE.getApplicationImages());
>> - frame.getContentPane().setLayout(new GridBagLayout());
>> + frame=createDownloadIndicatorFrame(true);
>> }
>>
>> if (resources != null) {
>> @@ -114,15 +117,13 @@
>>
>> frame.getContentPane().add(result, vertical);
>> frame.pack();
>> -
>> - if (!frame.isVisible()) {
>> - Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
>> - Insets insets =
>> Toolkit.getDefaultToolkit().getScreenInsets(frame.getGraphicsConfiguration());
>> - Dimension screen = new Dimension(screenSize.width - insets.left,
>> - screenSize.height - insets.top);
>> - frame.setLocation(screen.width - frame.getWidth(),
>> - screen.height - frame.getHeight());
>> - }
>> + placeFrameToLowerRight();
>> + result.addComponentListener(new ComponentAdapter() {
>> + @Override
>> + public void componentResized(ComponentEvent e) {
>> + placeFrameToLowerRight();
>> + }
>> + });
>>
>> frame.setVisible(true);
>>
>> @@ -130,6 +131,23 @@
>> }
>> }
>>
>> + public static JFrame createDownloadIndicatorFrame(boolean undecorated) throws
>> HeadlessException {
>> + JFrame f = new JFrame(downloading + "...");
>> + f.setUndecorated(undecorated);
>> + f.setIconImages(ImageResources.INSTANCE.getApplicationImages());
>> + f.getContentPane().setLayout(new GridBagLayout());
>> + return f;
>> + }
>> +
>> + /**
>> + * This places indicator to lower rigt corner of active monitor.
>
> s/rigt/right/
>
>> + */
>> + private static void placeFrameToLowerRight() throws HeadlessException {
>> + Rectangle bounds = ScreenFinder.getCurrentScreenSizeWithoutBounds();
>> + frame.setLocation(bounds.width+bounds.x - frame.getWidth(),
>> + bounds.height+bounds.y - frame.getHeight());
>> + }
>> +
>> /**
>> * Remove a download service listener that was obtained by
>> * calling the getDownloadListener method from the shared
>> @@ -163,13 +181,31 @@
>> * Groups the url progress in a panel.
>> */
>> static class DownloadPanel extends JPanel implements DownloadServiceListener {
>> + private final DownloadPanel self;
>>
>> + private static enum States{
>> + ONE_JAR, COLLAPSED, DETAILED;
>> + }
>> +
>> + private static final String DETAILS=R("ButShowDetails");
>> + private static final String HIDE_DETAILS=R("ButHideDetails");
>> /** the download name */
>> private String downloadName;
>> -
>> /** Downloading part: */
>> private JLabel header = new JLabel();
>> -
>> + /** Show/hide detailsButton button: */
>> + private final JButton detailsButton;
>> + private static final URL magnifyGlassUrl =
>> ClassLoader.getSystemResource("net/sourceforge/jnlp/resources/magnifyGlass-small.png");
>> + private static final URL redCrossUrl =
>> ClassLoader.getSystemResource("net/sourceforge/jnlp/resources/redCross-small.png");
>> + private static final Icon magnifyGlassIcon = new ImageIcon(magnifyGlassUrl);
>> + private static final Icon redCrossIcon = new ImageIcon(redCrossUrl);
>> + /** used instead of detailsButton button in case of one jar*/
>> + private JLabel delimiter = new JLabel("");
>> + /** all already created progress bars*/
>> + private List progressPanels = new ArrayList();
>> + private States state=States.ONE_JAR;
>> + private ProgressPanel mainProgressPanel;
>> +
>> /** list of URLs being downloaded */
>> private List urls = new ArrayList();
>>
>> @@ -181,12 +217,52 @@
>> * name.
>> */
>> protected DownloadPanel(String downloadName) {
>> + self = this;
>> setLayout(new GridBagLayout());
>> + this.downloadName = downloadName;
>> + this.add(header, verticalNoClean);
>> + header.setFont(header.getFont().deriveFont(Font.BOLD));
>> + this.add(delimiter, vertical);
>> + detailsButton = new JButton(magnifyGlassIcon);
>> + int w = magnifyGlassIcon.getIconWidth();
>> + int h = magnifyGlassIcon.getIconHeight();
>> + detailsButton.setPreferredSize(new Dimension(w + 2, h + 2));
>> + detailsButton.addActionListener(new ActionListener() {
>> + @Override
>> + public void actionPerformed(ActionEvent e) {
>> + if (state == States.DETAILED) {
>> + state = States.COLLAPSED;
>> + detailsButton.setToolTipText(DETAILS);
>> + detailsButton.setIcon(magnifyGlassIcon);
>> + for (ProgressPanel progressPanel : progressPanels) {
>> + remove(progressPanel);
>> + }
>> + add(mainProgressPanel, verticalIndent);
>> + recreateFrame(true);
>> + } else {
>> + state = States.DETAILED;
>> + detailsButton.setToolTipText(HIDE_DETAILS);
>> + detailsButton.setIcon(redCrossIcon);
>> + remove(mainProgressPanel);
>> + for (ProgressPanel progressPanel : progressPanels) {
>> + add(progressPanel, verticalIndent);
>> + }
>> + recreateFrame(false);
>> + }
>> + }
>>
>> - this.downloadName = downloadName;
>> - this.add(header, vertical);
>> - header.setFont(header.getFont().deriveFont(Font.BOLD));
>> -
>> + public void recreateFrame(boolean undecorated) throws HeadlessException {
>> + JFrame oldFrame = frame;
>> + frame = createDownloadIndicatorFrame(undecorated);
>> + frame.getContentPane().add(self, vertical);
>> + synchronized (frameMutex) {
>> + frame.pack();
>> + placeFrameToLowerRight();
>> + }
>> + frame.setVisible(true);
>> + oldFrame.dispose();
>> + }
>> + });
>> setOverallPercent(0);
>> }
>>
>> @@ -196,14 +272,31 @@
>> protected void addProgressPanel(URL url, String version) {
>> if (!urls.contains(url)) {
>> ProgressPanel panel = new ProgressPanel(url, version);
>> -
>> - add(panel, verticalIndent);
>> + if (state != States.COLLAPSED) {
>> + add(panel, verticalIndent);
>> + }
>> + progressPanels.add(panel);
>> + urls.add(url);
>> + panels.add(panel);
>> + //download indicator does not know about added jars
>> + //When just one is added then it behaves as was costumed (and no show detail button)
>
> Sorry, I do not understand this last sentence (at least not the way its worded).
>
>> + //when secoond one is added, then it already knows that there will
>
> s/secoond/second/
>
>> + //be two or more jars, so it swap to collapsed state in count of two.
>> + //no later, no sooner
>> + if (panels.size() == 2){
>> + remove(panels.get(0));
>> + remove(panels.get(1));
>> + remove(delimiter);
>> + add(detailsButton,vertical);
>> + mainProgressPanel=new ProgressPanel();
>> + add(mainProgressPanel, verticalIndent);
>> + state=States.COLLAPSED;
>> + }
>> synchronized (frameMutex) {
>> frame.pack();
>> + placeFrameToLowerRight();
>> }
>>
>> - urls.add(url);
>> - panels.add(panel);
>> }
>> }
>>
>> @@ -219,10 +312,10 @@
>> addProgressPanel(url, version);
>>
>> setOverallPercent(overallPercent);
>> -
>> ProgressPanel panel = panels.get(urls.indexOf(url));
>> panel.setProgress(readSoFar, total);
>> panel.repaint();
>> +
>> }
>> };
>> SwingUtilities.invokeLater(r);
>> @@ -230,12 +323,27 @@
>>
>> /**
>> * Sets the overall percent completed.
>> + * should be called via invokeLater
>> */
>> public void setOverallPercent(int percent) {
>> // don't get whole string from resource and sub in
>> // values because it'll be doing a MessageFormat for
>> // each update.
>> header.setText(downloading + " " + downloadName + ": " + percent + "% " + complete +
>> ".");
>> + Container c = header.getParent();
>> + //we need to adapt both panels and also frame to new length of header text
>> + while (c != null) {
>> + c.invalidate();
>> + c.validate();
>> + if (c instanceof Window){
>> + ((Window) c).pack();
>> + }
>> + c=c.getParent();
>> + }
>> + if (mainProgressPanel != null) {
>> + mainProgressPanel.setProgress(percent, 100);
>> + mainProgressPanel.repaint();
>> + }
>> }
>>
>> /**
>> @@ -276,12 +384,28 @@
>>
>> private long total;
>> private long readSoFar;
>> + private Dimension size = new Dimension(80, 15);
>>
>> + ProgressPanel() {
>> + bar.setMinimumSize(size);
>> + bar.setPreferredSize(size);
>> + bar.setOpaque(false);
>> +
>> + setLayout(new GridBagLayout());
>> +
>> + GridBagConstraints gbc = new GridBagConstraints();
>> + styleGridBagConstraints(gbc);
>> + add(bar, gbc);
>> + }
>> +
>> ProgressPanel(URL url, String version) {
>> - JLabel location = new JLabel(" " + url.getHost() + "/" + url.getFile());
>> + this(" " + url.getHost() + "/" + url.getFile(),version);
>> + }
>> + ProgressPanel(String caption, String version) {
>> + JLabel location = new JLabel(caption);
>>
>> - bar.setMinimumSize(new Dimension(80, 15));
>> - bar.setPreferredSize(new Dimension(80, 15));
>> + bar.setMinimumSize(size);
>> + bar.setPreferredSize(size);
>> bar.setOpaque(false);
>>
>> setLayout(new GridBagLayout());
>> @@ -291,12 +415,8 @@
>> gbc.fill = GridBagConstraints.NONE;
>> gbc.gridwidth = GridBagConstraints.RELATIVE;
>> add(bar, gbc);
>> -
>> - gbc.insets = new Insets(0, 3, 0, 0);
>> - gbc.weightx = 1.0;
>> - gbc.fill = GridBagConstraints.HORIZONTAL;
>> - gbc.gridwidth = GridBagConstraints.REMAINDER;
>> - gbc.anchor = GridBagConstraints.WEST;
>> +
>> + styleGridBagConstraints(gbc);
>> add(location, gbc);
>> }
>>
>> @@ -325,6 +445,14 @@
>> g.fillRect(x + 1, y + 1, divide - 1, h - 1);
>> }
>> }
>> +
>> + private void styleGridBagConstraints(GridBagConstraints gbc) {
>> + gbc.insets = new Insets(0, 3, 0, 0);
>> + gbc.weightx = 1.0;
>> + gbc.fill = GridBagConstraints.HORIZONTAL;
>> + gbc.gridwidth = GridBagConstraints.REMAINDER;
>> + gbc.anchor = GridBagConstraints.WEST;
>> + }
>> };
>>
>> }
>
> Attached are two alternate icons. They are from here http://opengameart.org/content/forum-controls
> and are in the public domain.
ok.. I dont like the aluminium magnify glass :)
I was thinking about some simple + and - also - you can see how it resulted at "*2.png versions" not
nice:(
then I took your arrow idea and I think the result is pretty nice.
What do you think now?
(just note, smaller arrow and bigger arrow are intentional:)
>
> The magnifying glass can go compact->detailed, and the left&up arrow can go detailed->compact. Maybe
> get rid of the surrounding buttons as well (or make them more subtle) ?
What do you mean?
>
Patch with updated names of icons and fixed typos attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: showDownloadDetails.png
Type: image/png
Size: 860 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130110/a5999764/showDownloadDetails.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hideDownloadDetails.png
Type: image/png
Size: 862 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130110/a5999764/hideDownloadDetails.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: magnifyGlass-small2.png
Type: image/png
Size: 1193 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130110/a5999764/magnifyGlass-small2.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: redCross-small2.png
Type: image/png
Size: 1027 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130110/a5999764/redCross-small2.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmpactDownloadIndicator2.patch
Type: text/x-patch
Size: 12564 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130110/a5999764/cmpactDownloadIndicator2.patch
From adomurad at redhat.com Thu Jan 10 07:56:46 2013
From: adomurad at redhat.com (Adam Domurad)
Date: Thu, 10 Jan 2013 10:56:46 -0500
Subject: [rfc][icedtea-web] make download indicator more compact
In-Reply-To: <50EED11C.8060504@redhat.com>
References: <50E5ACDF.7080609@redhat.com> <50E704C5.4060300@redhat.com>
<50EADE9F.3000101@redhat.com> <50EB1B33.4020605@redhat.com>
<50EC440E.2080409@redhat.com> <50EDC8E3.8060505@redhat.com>
<50EED11C.8060504@redhat.com>
Message-ID: <50EEE4BE.5010008@redhat.com>
On 01/10/2013 09:33 AM, Jiri Vanek wrote:
[ .. large snip .. ]
> On 01/09/2013 08:45 PM, Adam Domurad wrote:
>> On 01/08/2013 11:06 AM, Jiri Vanek wrote:
>>> + //When just one is added then it behaves as was
>>> costumed (and no show detail button)
>>
>> Sorry, I do not understand this last sentence (at least not the way
>> its worded).
Ok you explained it on IRC :-) but still needs to be fixed. "When only
one jar is downloaded then its progress is shown, and there is no show
detail button" makes sense to me. (assuming I interpreted correctly, I
haven't seen it with a 1-jar download yet)
>>> + //be two or more jars, so it swap to collapsed
>>> state in count of two.
>>> + //no later, no sooner
>>> + if (panels.size() == 2){
>>> + remove(panels.get(0));
>>> + remove(panels.get(1));
>>> + remove(delimiter);
>>> + add(detailsButton,vertical);
>>> + mainProgressPanel=new ProgressPanel();
>>> + add(mainProgressPanel, verticalIndent);
>>> + state=States.COLLAPSED;
>>> + }
>>> synchronized (frameMutex) {
>>> frame.pack();
>>> + placeFrameToLowerRight();
>>> }
>>>
>>> - urls.add(url);
>>> - panels.add(panel);
>>> }
>>> }
>>>
>>> @@ -219,10 +312,10 @@
>>> addProgressPanel(url, version);
>>>
>>> setOverallPercent(overallPercent);
>>> -
>>> ProgressPanel panel =
>>> panels.get(urls.indexOf(url));
>>> panel.setProgress(readSoFar, total);
>>> panel.repaint();
>>> +
>>> }
>>> };
>>> SwingUtilities.invokeLater(r);
>>> @@ -230,12 +323,27 @@
>>>
>>> /**
>>> * Sets the overall percent completed.
>>> + * should be called via invokeLater
>>> */
>>> public void setOverallPercent(int percent) {
>>> // don't get whole string from resource and sub in
>>> // values because it'll be doing a MessageFormat for
>>> // each update.
>>> header.setText(downloading + " " + downloadName + ": "
>>> + percent + "% " + complete +
>>> ".");
>>> + Container c = header.getParent();
>>> + //we need to adapt both panels and also frame to new
>>> length of header text
>>> + while (c != null) {
>>> + c.invalidate();
>>> + c.validate();
>>> + if (c instanceof Window){
>>> + ((Window) c).pack();
>>> + }
>>> + c=c.getParent();
>>> + }
>>> + if (mainProgressPanel != null) {
>>> + mainProgressPanel.setProgress(percent, 100);
>>> + mainProgressPanel.repaint();
>>> + }
>>> }
>>>
>>> /**
>>> @@ -276,12 +384,28 @@
>>>
>>> private long total;
>>> private long readSoFar;
>>> + private Dimension size = new Dimension(80, 15);
>>>
>>> + ProgressPanel() {
>>> + bar.setMinimumSize(size);
>>> + bar.setPreferredSize(size);
>>> + bar.setOpaque(false);
>>> +
>>> + setLayout(new GridBagLayout());
>>> +
>>> + GridBagConstraints gbc = new GridBagConstraints();
>>> + styleGridBagConstraints(gbc);
>>> + add(bar, gbc);
>>> + }
>>> +
>>> ProgressPanel(URL url, String version) {
>>> - JLabel location = new JLabel(" " + url.getHost() + "/"
>>> + url.getFile());
>>> + this(" " + url.getHost() + "/" + url.getFile(),version);
>>> + }
>>> + ProgressPanel(String caption, String version) {
>>> + JLabel location = new JLabel(caption);
>>>
>>> - bar.setMinimumSize(new Dimension(80, 15));
>>> - bar.setPreferredSize(new Dimension(80, 15));
>>> + bar.setMinimumSize(size);
>>> + bar.setPreferredSize(size);
>>> bar.setOpaque(false);
>>>
>>> setLayout(new GridBagLayout());
>>> @@ -291,12 +415,8 @@
>>> gbc.fill = GridBagConstraints.NONE;
>>> gbc.gridwidth = GridBagConstraints.RELATIVE;
>>> add(bar, gbc);
>>> -
>>> - gbc.insets = new Insets(0, 3, 0, 0);
>>> - gbc.weightx = 1.0;
>>> - gbc.fill = GridBagConstraints.HORIZONTAL;
>>> - gbc.gridwidth = GridBagConstraints.REMAINDER;
>>> - gbc.anchor = GridBagConstraints.WEST;
>>> +
>>> + styleGridBagConstraints(gbc);
>>> add(location, gbc);
>>> }
>>>
>>> @@ -325,6 +445,14 @@
>>> g.fillRect(x + 1, y + 1, divide - 1, h - 1);
>>> }
>>> }
>>> +
>>> + private void styleGridBagConstraints(GridBagConstraints gbc) {
>>> + gbc.insets = new Insets(0, 3, 0, 0);
>>> + gbc.weightx = 1.0;
>>> + gbc.fill = GridBagConstraints.HORIZONTAL;
>>> + gbc.gridwidth = GridBagConstraints.REMAINDER;
>>> + gbc.anchor = GridBagConstraints.WEST;
>>> + }
>>> };
>>>
>>> }
>>
>> Attached are two alternate icons. They are from here
>> http://opengameart.org/content/forum-controls
>> and are in the public domain.
>
> ok.. I dont like the aluminium magnify glass :)
Whatever works :-)
>
> I was thinking about some simple + and - also - you can see how it
> resulted at "*2.png versions" not nice:(
>
> then I took your arrow idea and I think the result is pretty nice.
>
> What do you think now?
It's good now, I like it.
>
> (just note, smaller arrow and bigger arrow are intentional:)
>>
>> The magnifying glass can go compact->detailed, and the left&up arrow
>> can go detailed->compact. Maybe
>> get rid of the surrounding buttons as well (or make them more subtle) ?
>
> What do you mean?
Just having a clickable image seems better to me than having the swing
button.
>>
>
> Patch with updated names of icons and fixed typos attached.
>
It's good now though, please do push! (just fix that one sentence).
-Adam
From bugzilla-daemon at icedtea.classpath.org Thu Jan 10 08:52:21 2013
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Thu, 10 Jan 2013 16:52:21 +0000
Subject: [Bug 1251] New: getResource failures on swing EDT caused by
AppContext having wrong classloader
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1251
Bug ID: 1251
Summary: getResource failures on swing EDT caused by AppContext
having wrong classloader
Classification: Unclassified
Product: IcedTea-Web
Version: hg
Hardware: all
OS: All
Status: NEW
Severity: normal
Priority: P3
Component: NetX (javaws)
Assignee: omajid at redhat.com
Reporter: adomurad at redhat.com
CC: unassigned at icedtea.classpath.org
Probable cause of PR840[1]
This is a regression. During refactoring, the setContextClassLoader seems to
have been dropped from initialization like so:
> Thread.currentThread().setContextClassLoader(jnlpclassloader);
> SunToolkit.createNewAppContext();
Setting the context classloader like this is important for resources loaded
from Swing threads. The AppContext captures the context classloader and
periodically will override the swing thread context classloader. This causes
getResource to return null in swing threads, mysteriously.
[1] http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=840
--
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/20130110/8efc8f1b/attachment.html
From jvanek at icedtea.classpath.org Thu Jan 10 08:56:59 2013
From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org)
Date: Thu, 10 Jan 2013 16:56:59 +0000
Subject: /hg/icedtea-web: All IcedTea-Web dialogues are centered to middl...
Message-ID:
changeset 3e4b40d47487 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=3e4b40d47487
author: Jiri Vanek
date: Thu Jan 10 17:57:19 2013 +0100
All IcedTea-Web dialogues are centered to middle of active screen
Active screen in this context is the one, where the mouse is presented
or default when no mouse presention detected.
Patch is affecteing only IcedTea-Web custom dialogues.
diffstat:
ChangeLog | 14 +
NEWS | 1 +
netx/net/sourceforge/jnlp/JNLPSplashScreen.java | 8 +-
netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsDialog.java | 6 +-
netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java | 6 +-
netx/net/sourceforge/jnlp/security/SecurityDialog.java | 7 +-
netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java | 7 +-
netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java | 3 +-
netx/net/sourceforge/jnlp/util/ScreenFinder.java | 100 ++++++++++
9 files changed, 128 insertions(+), 24 deletions(-)
diffs (281 lines):
diff -r 1b86028e546b -r 3e4b40d47487 ChangeLog
--- a/ChangeLog Thu Jan 10 13:18:45 2013 +0100
+++ b/ChangeLog Thu Jan 10 17:57:19 2013 +0100
@@ -1,3 +1,17 @@
+2013-01-10 Jiri Vanek
+
+ All IcedTea-Web dialogues are centered to middle of active screen
+ * NEWS: mentioned this feature
+ * netx/net/sourceforge/jnlp/JNLPSplashScreen.java:
+ * netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsDialog.java:
+ * netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java:
+ * netx/net/sourceforge/jnlp/security/SecurityDialog.java:
+ * netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java:
+ * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java:
+ Dialogues in above classes made centering to active screen
+ * netx/net/sourceforge/jnlp/util/ScreenFinder.java: New file, utility
+ class which can find active monitor and center dialogue into it.
+
2013-01-09 Jiri Vanek
First part of fix of recreating desktop icon
diff -r 1b86028e546b -r 3e4b40d47487 NEWS
--- a/NEWS Thu Jan 10 13:18:45 2013 +0100
+++ b/NEWS Thu Jan 10 17:57:19 2013 +0100
@@ -11,6 +11,7 @@
New in release 1.4 (2012-XX-XX):
* Added cs_CZ localisation
* Splash screen for javaws and plugin
+* All IcedTea-Web dialogues are centered to middle of active screen
* Security updates
- CVE-2012-3422, RH840592: Potential read from an uninitialized memory location
- CVE-2012-3423, RH841345: Incorrect handling of not 0-terminated strings
diff -r 1b86028e546b -r 3e4b40d47487 netx/net/sourceforge/jnlp/JNLPSplashScreen.java
--- a/netx/net/sourceforge/jnlp/JNLPSplashScreen.java Thu Jan 10 13:18:45 2013 +0100
+++ b/netx/net/sourceforge/jnlp/JNLPSplashScreen.java Thu Jan 10 17:57:19 2013 +0100
@@ -43,6 +43,7 @@
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Insets;
+import java.awt.Rectangle;
import java.io.IOException;
import java.net.URL;
import javax.imageio.ImageIO;
@@ -53,6 +54,7 @@
import net.sourceforge.jnlp.splashscreen.SplashUtils;
import net.sourceforge.jnlp.splashscreen.parts.InformationElement;
import net.sourceforge.jnlp.util.ImageResources;
+import net.sourceforge.jnlp.util.ScreenFinder;
public class JNLPSplashScreen extends JDialog {
@@ -145,11 +147,7 @@
setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
setSize(new Dimension(minimumWidth, minimumHeight));
setPreferredSize(new Dimension(minimumWidth, minimumHeight));
- // Centering to middle of Toolkit.getDefaultToolkit().getScreenSize()
- // centers to the middle of all monitors. Let's center to the middle
- // of the primary monitor instead.
- // TODO center on the 'current' monitor to meet user expectation
- setLocationRelativeTo(null);
+ ScreenFinder.centerWindowsToCurrentScreen(this);
}
@Override
diff -r 1b86028e546b -r 3e4b40d47487 netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsDialog.java
--- a/netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsDialog.java Thu Jan 10 13:18:45 2013 +0100
+++ b/netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsDialog.java Thu Jan 10 17:57:19 2013 +0100
@@ -32,6 +32,7 @@
import net.sourceforge.jnlp.config.DeploymentConfiguration;
import net.sourceforge.jnlp.runtime.Translator;
import net.sourceforge.jnlp.util.ImageResources;
+import net.sourceforge.jnlp.util.ScreenFinder;
/**
* This dialog provides a means for user to edit more of the proxy settings.
@@ -106,10 +107,7 @@
* Center the dialog box.
*/
private void centerDialog() {
- Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
- Dimension dialogSize = getSize();
-
- setLocation((screen.width - dialogSize.width) / 2, (screen.height - dialogSize.height) / 2);
+ ScreenFinder.centerWindowsToCurrentScreen(this);
}
/**
diff -r 1b86028e546b -r 3e4b40d47487 netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java
--- a/netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java Thu Jan 10 13:18:45 2013 +0100
+++ b/netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java Thu Jan 10 17:57:19 2013 +0100
@@ -31,6 +31,7 @@
import net.sourceforge.jnlp.config.DeploymentConfiguration;
import net.sourceforge.jnlp.runtime.Translator;
import net.sourceforge.jnlp.util.ImageResources;
+import net.sourceforge.jnlp.util.ScreenFinder;
/**
* This class will provide a visual way of viewing cache.
@@ -113,9 +114,6 @@
* Center the dialog box.
*/
private void centerDialog() {
- Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
- Dimension dialogSize = getSize();
-
- setLocation((screen.width - dialogSize.width) / 2, (screen.height - dialogSize.height) / 2);
+ ScreenFinder.centerWindowsToCurrentScreen(this);
}
}
diff -r 1b86028e546b -r 3e4b40d47487 netx/net/sourceforge/jnlp/security/SecurityDialog.java
--- a/netx/net/sourceforge/jnlp/security/SecurityDialog.java Thu Jan 10 13:18:45 2013 +0100
+++ b/netx/net/sourceforge/jnlp/security/SecurityDialog.java Thu Jan 10 17:57:19 2013 +0100
@@ -52,6 +52,7 @@
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.List;
+import net.sourceforge.jnlp.util.ScreenFinder;
/**
* Provides methods for showing security warning dialogs for a wide range of
@@ -312,11 +313,7 @@
}
private static void centerDialog(JDialog dialog) {
- Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
- Dimension dialogSize = dialog.getSize();
-
- dialog.setLocation((screen.width - dialogSize.width) / 2,
- (screen.height - dialogSize.height) / 2);
+ ScreenFinder.centerWindowsToCurrentScreen(dialog);
}
private void selectDefaultButton() {
diff -r 1b86028e546b -r 3e4b40d47487 netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java
--- a/netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java Thu Jan 10 13:18:45 2013 +0100
+++ b/netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java Thu Jan 10 17:57:19 2013 +0100
@@ -52,6 +52,7 @@
import net.sourceforge.jnlp.runtime.JNLPRuntime;
import net.sourceforge.jnlp.util.ImageResources;
+import net.sourceforge.jnlp.util.ScreenFinder;
public class CertificateViewer extends JDialog {
@@ -94,11 +95,7 @@
}
private void centerDialog() {
- Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
- Dimension dialogSize = getSize();
-
- setLocation((screen.width - dialogSize.width) / 2,
- (screen.height - dialogSize.height) / 2);
+ ScreenFinder.centerWindowsToCurrentScreen(this);
}
public static void showCertificateViewer() throws Exception {
diff -r 1b86028e546b -r 3e4b40d47487 netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java
--- a/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java Thu Jan 10 13:18:45 2013 +0100
+++ b/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java Thu Jan 10 17:57:19 2013 +0100
@@ -58,6 +58,7 @@
import net.sourceforge.jnlp.splashscreen.parts.BasicComponentSplashScreen;
import net.sourceforge.jnlp.splashscreen.parts.InfoItem;
import net.sourceforge.jnlp.splashscreen.parts.InformationElement;
+import net.sourceforge.jnlp.util.ScreenFinder;
public class BasePainter implements Observer {
@@ -281,7 +282,7 @@
showInfo = false;
}
}
- if (Math.min(h, w) < Toolkit.getDefaultToolkit().getScreenSize().getHeight() / 10) {
+ if (Math.min(h, w) < ScreenFinder.getCurrentScreenSizeWithoutBounds().getHeight() / 10) {
showNiceTexts = false;
} else {
showNiceTexts = true;
diff -r 1b86028e546b -r 3e4b40d47487 netx/net/sourceforge/jnlp/util/ScreenFinder.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/util/ScreenFinder.java Thu Jan 10 17:57:19 2013 +0100
@@ -0,0 +1,100 @@
+/* ScreenFinder.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; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.util;
+
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.Insets;
+import java.awt.MouseInfo;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Toolkit;
+import java.awt.Window;
+
+public class ScreenFinder {
+
+ public static GraphicsDevice getCurrentScreen() {
+ Point p = MouseInfo.getPointerInfo().getLocation();
+ return getScreenOnCoords(p);
+
+ }
+ public static Rectangle getCurrentScreenSizeWithoutBounds() {
+ Point p = MouseInfo.getPointerInfo().getLocation();
+ return getScreenOnCoordsWithutBounds(p);
+
+ }
+
+ public static void centerWindowsToCurrentScreen(Window w) {
+ Rectangle bounds = getCurrentScreenSizeWithoutBounds();
+ w.setLocation(bounds.x + (bounds.width - w.getWidth())/2,
+ bounds.y + (bounds.height - w.getHeight())/2);
+
+ }
+
+ public static GraphicsDevice getScreenOnCoords(Point point) {
+ GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment();
+ GraphicsDevice[] devices = e.getScreenDevices();
+ GraphicsDevice result = null;
+ //now get the configuration(s) for each device
+ for (GraphicsDevice device : devices) {
+ //GraphicsConfiguration[] configurations = device.getConfigurations();
+ //or?
+ GraphicsConfiguration[] configurations = new GraphicsConfiguration[]{device.getDefaultConfiguration()};
+ for (GraphicsConfiguration config : configurations) {
+ Rectangle gcBounds = config.getBounds();
+ if (gcBounds.contains(point)) {
+ result = device;
+ }
+ }
+ }
+ if (result == null) {
+ //not found, get the default display
+ result = e.getDefaultScreenDevice();
+ }
+ return result;
+ }
+
+ public static Rectangle getScreenOnCoordsWithutBounds(Point p) {
+ GraphicsDevice device = getScreenOnCoords(p);
+ Rectangle screenSize = device.getDefaultConfiguration().getBounds();
+ Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(device.getDefaultConfiguration());
+ return new Rectangle((int)screenSize.getX()+insets.left, (int)screenSize.getY()+insets.top, (int)screenSize.getWidth()-insets.left, (int)screenSize.getHeight()-insets.bottom);
+ }
+
+
+}
From bugzilla-daemon at icedtea.classpath.org Thu Jan 10 09:27:02 2013
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Thu, 10 Jan 2013 17:27:02 +0000
Subject: [Bug 725] JNLP applications will prompt for creating desktop
shortcuts every time they are run
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725
JiriVanek changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|omajid at redhat.com |jvanek 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/20130110/237a349e/attachment.html
From bugzilla-daemon at icedtea.classpath.org Thu Jan 10 09:28:55 2013
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Thu, 10 Jan 2013 17:28:55 +0000
Subject: [Bug 725] JNLP applications will prompt for creating desktop
shortcuts every time they are run
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725
JiriVanek changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #9 from JiriVanek ---
by http://icedtea.classpath.org/hg/icedtea-web/rev/1b86028e546b when icon
exists, then user will not be asked again. When he deletes it, he wel be asked
again.
Somefuture work like always/never button can come in future.
--
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/20130110/aa6b75c6/attachment.html
From jvanek at icedtea.classpath.org Thu Jan 10 09:31:21 2013
From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org)
Date: Thu, 10 Jan 2013 17:31:21 +0000
Subject: /hg/icedtea-web: Download indicator made compact for more then o...
Message-ID:
changeset 4118632d3c49 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=4118632d3c49
author: Jiri Vanek
date: Thu Jan 10 18:23:06 2013 +0100
Download indicator made compact for more then one jar
diffstat:
ChangeLog | 14 +
NEWS | 1 +
netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java | 193 ++++++++-
netx/net/sourceforge/jnlp/resources/hideDownloadDetails.png | Bin
netx/net/sourceforge/jnlp/resources/showDownloadDetails.png | Bin
5 files changed, 176 insertions(+), 32 deletions(-)
diffs (353 lines):
diff -r 3e4b40d47487 -r 4118632d3c49 ChangeLog
--- a/ChangeLog Thu Jan 10 17:57:19 2013 +0100
+++ b/ChangeLog Thu Jan 10 18:23:06 2013 +0100
@@ -1,3 +1,17 @@
+2013-01-10 Jiri Vanek
+
+ Download indicator made compact for more then one jar
+ * NEWS: mentioned this feature
+ * netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java:
+ (DownloadPanel) inner class were rewritten to support collapsed/detailed
+ for more then one jar in queue.
+ (frame) window is recreated each time state is changed (preventing errors
+ on some X configurations) and is positioned to lower left corner of
+ active screen.
+ * netx/net/sourceforge/jnlp/resources/hideDownloadDetails.png
+ * adding netx/net/sourceforge/jnlp/resources/showDownloadDetails.pn h
+ Icons for "to collapsed state" and "to detailed state"
+
2013-01-10 Jiri Vanek
All IcedTea-Web dialogues are centered to middle of active screen
diff -r 3e4b40d47487 -r 4118632d3c49 NEWS
--- a/NEWS Thu Jan 10 17:57:19 2013 +0100
+++ b/NEWS Thu Jan 10 18:23:06 2013 +0100
@@ -12,6 +12,7 @@
* Added cs_CZ localisation
* Splash screen for javaws and plugin
* All IcedTea-Web dialogues are centered to middle of active screen
+* Download indicator made compact for more then one jar
* Security updates
- CVE-2012-3422, RH840592: Potential read from an uninitialized memory location
- CVE-2012-3423, RH841345: Incorrect handling of not 0-terminated strings
diff -r 3e4b40d47487 -r 4118632d3c49 netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java
--- a/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java Thu Jan 10 17:57:19 2013 +0100
+++ b/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java Thu Jan 10 18:23:06 2013 +0100
@@ -29,6 +29,7 @@
import net.sourceforge.jnlp.runtime.*;
import net.sourceforge.jnlp.util.ImageResources;
+import net.sourceforge.jnlp.util.ScreenFinder;
/**
* Show the progress of downloads.
@@ -62,6 +63,7 @@
/** shared constraint */
static GridBagConstraints vertical;
+ static GridBagConstraints verticalNoClean;
static GridBagConstraints verticalIndent;
static {
vertical = new GridBagConstraints();
@@ -70,6 +72,9 @@
vertical.fill = GridBagConstraints.HORIZONTAL;
vertical.anchor = GridBagConstraints.WEST;
+ verticalNoClean = new GridBagConstraints();
+ verticalNoClean.weightx = 1.0;
+
verticalIndent = (GridBagConstraints) vertical.clone();
verticalIndent.insets = new Insets(0, 10, 3, 0);
}
@@ -101,9 +106,7 @@
synchronized (frameMutex) {
if (frame == null) {
- frame = new JFrame(downloading + "...");
- frame.setIconImages(ImageResources.INSTANCE.getApplicationImages());
- frame.getContentPane().setLayout(new GridBagLayout());
+ frame=createDownloadIndicatorFrame(true);
}
if (resources != null) {
@@ -114,15 +117,13 @@
frame.getContentPane().add(result, vertical);
frame.pack();
-
- if (!frame.isVisible()) {
- Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
- Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(frame.getGraphicsConfiguration());
- Dimension screen = new Dimension(screenSize.width - insets.left,
- screenSize.height - insets.top);
- frame.setLocation(screen.width - frame.getWidth(),
- screen.height - frame.getHeight());
- }
+ placeFrameToLowerRight();
+ result.addComponentListener(new ComponentAdapter() {
+ @Override
+ public void componentResized(ComponentEvent e) {
+ placeFrameToLowerRight();
+ }
+ });
frame.setVisible(true);
@@ -130,6 +131,23 @@
}
}
+ public static JFrame createDownloadIndicatorFrame(boolean undecorated) throws HeadlessException {
+ JFrame f = new JFrame(downloading + "...");
+ f.setUndecorated(undecorated);
+ f.setIconImages(ImageResources.INSTANCE.getApplicationImages());
+ f.getContentPane().setLayout(new GridBagLayout());
+ return f;
+ }
+
+ /**
+ * This places indicator to lower right corner of active monitor.
+ */
+ private static void placeFrameToLowerRight() throws HeadlessException {
+ Rectangle bounds = ScreenFinder.getCurrentScreenSizeWithoutBounds();
+ frame.setLocation(bounds.width+bounds.x - frame.getWidth(),
+ bounds.height+bounds.y - frame.getHeight());
+ }
+
/**
* Remove a download service listener that was obtained by
* calling the getDownloadListener method from the shared
@@ -163,13 +181,31 @@
* Groups the url progress in a panel.
*/
static class DownloadPanel extends JPanel implements DownloadServiceListener {
+ private final DownloadPanel self;
+ private static enum States{
+ ONE_JAR, COLLAPSED, DETAILED;
+ }
+
+ private static final String DETAILS=R("ButShowDetails");
+ private static final String HIDE_DETAILS=R("ButHideDetails");
/** the download name */
private String downloadName;
-
/** Downloading part: */
private JLabel header = new JLabel();
-
+ /** Show/hide detailsButton button: */
+ private final JButton detailsButton;
+ private static final URL magnifyGlassUrl = ClassLoader.getSystemResource("net/sourceforge/jnlp/resources/showDownloadDetails.png");
+ private static final URL redCrossUrl = ClassLoader.getSystemResource("net/sourceforge/jnlp/resources/hideDownloadDetails.png");
+ private static final Icon magnifyGlassIcon = new ImageIcon(magnifyGlassUrl);
+ private static final Icon redCrossIcon = new ImageIcon(redCrossUrl);
+ /** used instead of detailsButton button in case of one jar*/
+ private JLabel delimiter = new JLabel("");
+ /** all already created progress bars*/
+ private List progressPanels = new ArrayList();
+ private States state=States.ONE_JAR;
+ private ProgressPanel mainProgressPanel;
+
/** list of URLs being downloaded */
private List urls = new ArrayList();
@@ -181,12 +217,52 @@
* name.
*/
protected DownloadPanel(String downloadName) {
+ self = this;
setLayout(new GridBagLayout());
+ this.downloadName = downloadName;
+ this.add(header, verticalNoClean);
+ header.setFont(header.getFont().deriveFont(Font.BOLD));
+ this.add(delimiter, vertical);
+ detailsButton = new JButton(magnifyGlassIcon);
+ int w = magnifyGlassIcon.getIconWidth();
+ int h = magnifyGlassIcon.getIconHeight();
+ detailsButton.setPreferredSize(new Dimension(w + 2, h + 2));
+ detailsButton.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (state == States.DETAILED) {
+ state = States.COLLAPSED;
+ detailsButton.setToolTipText(DETAILS);
+ detailsButton.setIcon(magnifyGlassIcon);
+ for (ProgressPanel progressPanel : progressPanels) {
+ remove(progressPanel);
+ }
+ add(mainProgressPanel, verticalIndent);
+ recreateFrame(true);
+ } else {
+ state = States.DETAILED;
+ detailsButton.setToolTipText(HIDE_DETAILS);
+ detailsButton.setIcon(redCrossIcon);
+ remove(mainProgressPanel);
+ for (ProgressPanel progressPanel : progressPanels) {
+ add(progressPanel, verticalIndent);
+ }
+ recreateFrame(false);
+ }
+ }
- this.downloadName = downloadName;
- this.add(header, vertical);
- header.setFont(header.getFont().deriveFont(Font.BOLD));
-
+ public void recreateFrame(boolean undecorated) throws HeadlessException {
+ JFrame oldFrame = frame;
+ frame = createDownloadIndicatorFrame(undecorated);
+ frame.getContentPane().add(self, vertical);
+ synchronized (frameMutex) {
+ frame.pack();
+ placeFrameToLowerRight();
+ }
+ frame.setVisible(true);
+ oldFrame.dispose();
+ }
+ });
setOverallPercent(0);
}
@@ -196,14 +272,32 @@
protected void addProgressPanel(URL url, String version) {
if (!urls.contains(url)) {
ProgressPanel panel = new ProgressPanel(url, version);
-
- add(panel, verticalIndent);
+ if (state != States.COLLAPSED) {
+ add(panel, verticalIndent);
+ }
+ progressPanels.add(panel);
+ urls.add(url);
+ panels.add(panel);
+ //download indicator does not know about added jars
+ //When only one jar is added to downlaod queue then its progress is
+ //shown, and there is no show detail button.
+ //When second one is added, then it already knows that there will
+ //be two or more jars, so it swap to collapsed state in count of two.
+ //no later, no sooner
+ if (panels.size() == 2){
+ remove(panels.get(0));
+ remove(panels.get(1));
+ remove(delimiter);
+ add(detailsButton,vertical);
+ mainProgressPanel=new ProgressPanel();
+ add(mainProgressPanel, verticalIndent);
+ state=States.COLLAPSED;
+ }
synchronized (frameMutex) {
frame.pack();
+ placeFrameToLowerRight();
}
- urls.add(url);
- panels.add(panel);
}
}
@@ -219,10 +313,10 @@
addProgressPanel(url, version);
setOverallPercent(overallPercent);
-
ProgressPanel panel = panels.get(urls.indexOf(url));
panel.setProgress(readSoFar, total);
panel.repaint();
+
}
};
SwingUtilities.invokeLater(r);
@@ -230,12 +324,27 @@
/**
* Sets the overall percent completed.
+ * should be called via invokeLater
*/
public void setOverallPercent(int percent) {
// don't get whole string from resource and sub in
// values because it'll be doing a MessageFormat for
// each update.
header.setText(downloading + " " + downloadName + ": " + percent + "% " + complete + ".");
+ Container c = header.getParent();
+ //we need to adapt both panels and also frame to new length of header text
+ while (c != null) {
+ c.invalidate();
+ c.validate();
+ if (c instanceof Window){
+ ((Window) c).pack();
+ }
+ c=c.getParent();
+ }
+ if (mainProgressPanel != null) {
+ mainProgressPanel.setProgress(percent, 100);
+ mainProgressPanel.repaint();
+ }
}
/**
@@ -276,12 +385,28 @@
private long total;
private long readSoFar;
+ private Dimension size = new Dimension(80, 15);
+ ProgressPanel() {
+ bar.setMinimumSize(size);
+ bar.setPreferredSize(size);
+ bar.setOpaque(false);
+
+ setLayout(new GridBagLayout());
+
+ GridBagConstraints gbc = new GridBagConstraints();
+ styleGridBagConstraints(gbc);
+ add(bar, gbc);
+ }
+
ProgressPanel(URL url, String version) {
- JLabel location = new JLabel(" " + url.getHost() + "/" + url.getFile());
+ this(" " + url.getHost() + "/" + url.getFile(),version);
+ }
+ ProgressPanel(String caption, String version) {
+ JLabel location = new JLabel(caption);
- bar.setMinimumSize(new Dimension(80, 15));
- bar.setPreferredSize(new Dimension(80, 15));
+ bar.setMinimumSize(size);
+ bar.setPreferredSize(size);
bar.setOpaque(false);
setLayout(new GridBagLayout());
@@ -291,12 +416,8 @@
gbc.fill = GridBagConstraints.NONE;
gbc.gridwidth = GridBagConstraints.RELATIVE;
add(bar, gbc);
-
- gbc.insets = new Insets(0, 3, 0, 0);
- gbc.weightx = 1.0;
- gbc.fill = GridBagConstraints.HORIZONTAL;
- gbc.gridwidth = GridBagConstraints.REMAINDER;
- gbc.anchor = GridBagConstraints.WEST;
+
+ styleGridBagConstraints(gbc);
add(location, gbc);
}
@@ -325,6 +446,14 @@
g.fillRect(x + 1, y + 1, divide - 1, h - 1);
}
}
+
+ private void styleGridBagConstraints(GridBagConstraints gbc) {
+ gbc.insets = new Insets(0, 3, 0, 0);
+ gbc.weightx = 1.0;
+ gbc.fill = GridBagConstraints.HORIZONTAL;
+ gbc.gridwidth = GridBagConstraints.REMAINDER;
+ gbc.anchor = GridBagConstraints.WEST;
+ }
};
}
diff -r 3e4b40d47487 -r 4118632d3c49 netx/net/sourceforge/jnlp/resources/hideDownloadDetails.png
Binary file netx/net/sourceforge/jnlp/resources/hideDownloadDetails.png has changed
diff -r 3e4b40d47487 -r 4118632d3c49 netx/net/sourceforge/jnlp/resources/showDownloadDetails.png
Binary file netx/net/sourceforge/jnlp/resources/showDownloadDetails.png has changed
From bugzilla-daemon at icedtea.classpath.org Thu Jan 10 09:54:44 2013
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Thu, 10 Jan 2013 17:54:44 +0000
Subject: [Bug 725] JNLP applications will prompt for creating desktop
shortcuts every time they are run
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=725
--- Comment #10 from Toni Spets ---
While this fix is a great improvement, it's not "in line" with the official
Oracle JRE Web Start implementation.
It seems the real thing does not reprompt you about the shortcut after the
first dialog even if you remove it. The only way to recreate the icon(s) is to
make sure both (desktop and menu) shortcuts are removed and then use the Cache
Viewer to recreate them.
itweb-settings doesn't seem to have a proper cache viewer at this point so this
commit is better than the original behaviour as it would make it impossible for
the user to recover from a missing icon.
Thank you for fixing this.
--
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/20130110/7be88f9f/attachment.html
From bugzilla-daemon at icedtea.classpath.org Thu Jan 10 10:56:43 2013
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Thu, 10 Jan 2013 18:56:43 +0000
Subject: [Bug 1234] Regression: Interacting with SweetHome3D brings
classloading issue
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1234
Adam Domurad changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|omajid 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/20130110/88b29615/attachment.html
From bugzilla-daemon at icedtea.classpath.org Thu Jan 10 10:57:00 2013
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Thu, 10 Jan 2013 18:57:00 +0000
Subject: [Bug 1251] getResource failures on swing EDT caused by AppContext
having wrong classloader
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1251
Adam Domurad changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|omajid 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/20130110/fd37fbe8/attachment.html
From bugzilla-daemon at icedtea.classpath.org Thu Jan 10 11:00:33 2013
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Thu, 10 Jan 2013 19:00:33 +0000
Subject: [Bug 1251] getResource failures on swing EDT caused by AppContext
having wrong classloader
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1251
--- Comment #1 from Adam Domurad ---
*** Bug 1234 has been marked as a duplicate of this bug. ***
--
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/20130110/4b242647/attachment.html
From bugzilla-daemon at icedtea.classpath.org Thu Jan 10 11:00:33 2013
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Thu, 10 Jan 2013 19:00:33 +0000
Subject: [Bug 1234] Regression: Interacting with SweetHome3D brings
classloading issue
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1234
Adam Domurad changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |DUPLICATE
--- Comment #1 from Adam Domurad ---
Should have added information to this instead of creating
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1251 in hindsight. 1251
causes this bug. Marking this one as duplicate as the other one has more
information.
*** This bug has been marked as a duplicate of bug 1251 ***
--
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/20130110/c718a161/attachment.html
From bugzilla-daemon at icedtea.classpath.org Thu Jan 10 14:12:27 2013
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Thu, 10 Jan 2013 22:12:27 +0000
Subject: [Bug 1252] New: icedtea-web-1.3 on icedtea-2.3.3 with
seamonkey-2.13.2 plugin not detected
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1252
Bug ID: 1252
Summary: icedtea-web-1.3 on icedtea-2.3.3 with seamonkey-2.13.2
plugin not detected
Classification: Unclassified
Product: IcedTea-Web
Version: unspecified
Hardware: all
OS: Linux
Status: NEW
Severity: normal
Priority: P3
Component: Plugin
Assignee: dbhole at redhat.com
Reporter: jzb2 at aexorsyst.com
CC: unassigned at icedtea.classpath.org
--
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/20130110/436b93ab/attachment.html
From bugzilla-daemon at icedtea.classpath.org Thu Jan 10 14:24:39 2013
From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org)
Date: Thu, 10 Jan 2013 22:24:39 +0000
Subject: [Bug 1252] icedtea-web-1.3 on icedtea-2.3.3 with seamonkey-2.13.2
plugin not detected
In-Reply-To:
References:
Message-ID:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1252
--- Comment #1 from John ---
In package icedtea-web-1.3, IcedTeaPlugin.so builds against icetea-2.3.3
(OpenJDK-1.7.9_09) as long as MOZILLA_CFLAGS="-I/usr/include/seamonkey-2.13.2"
and MOZILLA_LIBS="-L/usr/lib/seamonkey-2.13.2" is specified even without
mozilla-*.pc pkgconfig file, but despite trying various plugin names,
locations, symlinks, etc. the plugin is simply not listed on the
Addons-Manager/Plugins tab of seamonkey. Testing on java.com indicates that
java is not enabled in seamonkey. I have gnash/gnash-plugin built and
installed on the same system, and gnash-plugin is listed as a valid plugin (and
works), so some plugins do work with seamonkey and icedtea-2.3.3. Have not
tried others. Don't know, but that's probably irrelevant.
Furthermore, the seamonkey pluginreg.dat file gets this appended to it after
restart after IcedTeaPlugin.so is installed:
[INVALID]
/usr/lib/mozilla/plugins/libjavaplugin.so:$
1357845686000:$
Note that the "libjavaplugin.so" is but a symlink to IcedTeaPlugin.so. I've
tried various names, symlinks, etc. with no difference in behaviour. This is
on a pure 64-bit system (no /usr/lib64), based on BLFS (linuxfromscratch.org).
--
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/20130110/32079703/attachment.html
From helpcrypto at gmail.com Fri Jan 11 01:54:30 2013
From: helpcrypto at gmail.com (helpcrypto helpcrypto)
Date: Fri, 11 Jan 2013 10:54:30 +0100
Subject: [rfc][icedtea-web] Fix for PR1198,
JSObject passed incorrectly to Javascript
In-Reply-To: <50EEB3A7.1010401@redhat.com>
References: <50B92039.4070304@redhat.com> <50BCF77F.2020808@redhat.com>
<50E6A438.1010605@redhat.com> <50E70F2D.2070805@redhat.com>
<50EAE14D.5050505@redhat.com> <50EAEE24.2080804@redhat.com>
<50EAFB5A.9000104@redhat.com> <50EB0802.8030803@redhat.com>
<50EEB3A7.1010401@redhat.com>
Message-ID:
I'm nervous and excited.... :P
On Thu, Jan 10, 2013 at 1:27 PM, Jiri Vanek wrote:
> Well I'm ok with current implementation and testing. Lets wait for Jana's
> final word. She promissed to check today evening/yesterday.
>
> J.
>
From ptisnovs at icedtea.classpath.org Fri Jan 11 02:23:02 2013
From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org)
Date: Fri, 11 Jan 2013 10:23:02 +0000
Subject: /hg/rhino-tests: New tests added methods getConstructor(), getDe...
Message-ID:
changeset eb0943f105e6 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=eb0943f105e6
author: Pavel Tisnovsky
date: Fri Jan 11 11:26:11 2013 +0100
New tests added methods getConstructor(), getDeclaredConstructor()
and getDeclaredFields into src/org/RhinoTests/AbstractScriptEngineClassTest.java.
diffstat:
ChangeLog | 14 +-
src/org/RhinoTests/AbstractScriptEngineClassTest.java | 97 +++++++++++++++++++
2 files changed, 107 insertions(+), 4 deletions(-)
diffs (153 lines):
diff -r 7df6314535c9 -r eb0943f105e6 ChangeLog
--- a/ChangeLog Thu Jan 10 09:32:48 2013 +0100
+++ b/ChangeLog Fri Jan 11 11:26:11 2013 +0100
@@ -1,25 +1,31 @@
+2013-01-11 Pavel Tisnovsky
+
+ * src/org/RhinoTests/AbstractScriptEngineClassTest.java:
+ New tests added methods getConstructor(), getDeclaredConstructor()
+ and getDeclaredFields.
+
2013-01-10 Pavel Tisnovsky
* src/org/RhinoTests/BindingsClassTest.java:
- Added three new tests for methods GetCanonicalName(), getConstructor() and
+ Added three new tests for methods getCanonicalName(), getConstructor() and
getDeclaredConstructor().
2013-01-09 Pavel Tisnovsky
* src/org/RhinoTests/SimpleBindingsClassTest.java:
- Added three new tests for methods GetCanonicalName(), getAnnotation() and
+ Added three new tests for methods getCanonicalName(), getAnnotation() and
getComponentType().
2013-01-08 Pavel Tisnovsky
* src/org/RhinoTests/SimpleScriptContextClassTest.java:
- Added new test for a method GetCanonicalName() getAnnotation().
+ Added new test for a method getCanonicalName() getAnnotation().
Fixed spelling.
2013-01-07 Pavel Tisnovsky