[RFC][icedtea-web] PR833 - icedtea-web is failing when cache is corupted.
Deepak Bhole
dbhole at redhat.com
Mon Jan 30 09:19:54 PST 2012
Hi Jiri,
Please see comments below. It is minor stuff:
> diff -r 41f03d932cdf ChangeLog
> --- a/ChangeLog Mon Jan 09 18:45:31 2012 -0500
> +++ b/ChangeLog Tue Jan 24 14:22:58 2012 +0100
> @@ -1,3 +1,31 @@
> +2012-01-24 Jiri Vanek<jvanek at redhat.com>
> +
> + Fix for PR844
> + * netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java: (getLRUSortedEntries)
> + instead of error throwing own LRU exception. Also catches more then
> + NumberFormatException
[ ... ]
The wrapping for ChangeLog is still wrong. I applied the patch and it
shows a mix of spaces and tabs at the start of the lines. Please use an
editor to highlight spaces and tabs and you will see them.
Also, some lines go beyond 80, they should be wrapped.
[ ... ]
> diff -r 41f03d932cdf netx/net/sourceforge/jnlp/cache/LruCacheException.java
> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
> +++ b/netx/net/sourceforge/jnlp/cache/LruCacheException.java Tue Jan 24 14:22:58 2012 +0100
> @@ -0,0 +1,52 @@
> +/* LruCacheException.java -- Thrown when cache is corrupted.
> +Copyright (C) 2010 Red Hat, Inc.
2012 :)
[ ...]
The strings still have some grammatical and spelling errors. Also,
strings don't mention the word "cache" in many cases, so it is hard to
tell what it is referring to ... e.g. "Cleared, reloading.". I have
recommended corrections:
> +CFakeCache=Cache is corrupted, will be faked now.
"Cache is corrupt. Disabling it."
> +CFakedCache=Faked, continuing. It is strongly remanded to run javaws -Xclearcache and rerun your application as soon as possible.
"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 corrupted, will be cleared now.
"Cache is still corrupt. Clearing it."
> +CCleaningUnsuccessful="Clearing was not successful, probably due to another javaws instance running.. Try to shut down all instances of javaws, run javaws -Xclearcache and rerun your jnlp file.
"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=Cleared, reloading.
"Cache cleared. Re-loading."
> +CReloadRestarting=Reload, restarting, it is strongly commanded to run javaws -Xclearcache and rerun your application as soon as possible.
"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=LRU cache was corrupted. Was cleared, but still is corrupted. Try to shut down all instances of javaws, run javaws -Xclearcache and rerun your jnlp file.
>
"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?
> diff -r 41f03d932cdf netx/net/sourceforge/jnlp/util/PropertiesFile.java
> --- a/netx/net/sourceforge/jnlp/util/PropertiesFile.java Mon Jan 09 18:45:31 2012 -0500
> +++ b/netx/net/sourceforge/jnlp/util/PropertiesFile.java Tue Jan 24 14:22:58 2012 +0100
> @@ -134,6 +134,7 @@
> OutputStream s = null;
> try {
> try {
> + file.getParentFile().mkdirs();
> s = new FileOutputStream(file);
> store(s, header);
> } finally {
> diff -r 41f03d932cdf tests/jnlp_tests/signed/CacheReproducer/resources/CacheReproducer1.jnlp
> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
> +++ b/tests/jnlp_tests/signed/CacheReproducer/resources/CacheReproducer1.jnlp Tue Jan 24 14:22:58 2012 +0100
> @@ -0,0 +1,16 @@
> +<?xml version="1.0" encoding="utf-8"?>
> +<jnlp spec="1.0"
> + codebase="./"
> + href="CacheReproducer1.jnlp">
> + <information>
> + <title>just prints out Good simple javaws exapmle using reflection call from CacheReproducer.jar SimpletestSigned1.jar</title>
J should be capitalized, the 'g' in good should not be capital, and
example is spelt incorrectly. Same for other title fields below.
[ ...]
> diff -r 41f03d932cdf tests/jnlp_tests/signed/CacheReproducer/srcs/CacheReproducer.java
> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
> +++ b/tests/jnlp_tests/signed/CacheReproducer/srcs/CacheReproducer.java Tue Jan 24 14:22:58 2012 +0100
> @@ -0,0 +1,47 @@
> +/* CacheReproducer.java
> +Copyright (C) 2011 Red Hat, Inc.
> +
I know it was written in 2011.. but should be 2012 now :) Same with
files below.
[ ... ]
> +
> + private void assertCacheIsNotEmpty() {
> + Assert.assertTrue("icedtea cache " + icedteaCache.getAbsolutePath() + " should exists some any run", icedteaCache.exists());
> + Assert.assertTrue("icedtea cache file " + icedteaCacheFile.getAbsolutePath() + " should exists some any run", icedteaCacheFile.exists());
"exists" => "exist" for both lines above.
[ ... ]
> +
> + private void assertLruExceptionNOTappeared(ProcessResult pr2) {
> + Assert.assertFalse("serr should NOT contains " + lre, pr2.stderr.contains(lre));
> + }
> +
> + private void assertLruExceptionAppeared(ProcessResult pr) {
> + Assert.assertTrue("serr should contains " + lre, pr.stderr.contains(lre));
> + }
> +
"contains" => "contain" in both lines above.
> + Assert.assertTrue("Stderr should contains " + q + ", but did not.", pr.stderr.contains(q));
"contains" => "contain"
[ ... ]
> + }
> + tryToClearcache();
> + Assert.assertFalse("icedtea cache " + icedteaCache.getAbsolutePath() + " should not exists after clearing", icedteaCache.exists());
"exists" => "exist"
[ ... ]
> + String s = "Good simple javaws exapmle";
> + Assert.assertTrue("test stdout should contains " + s + " bud didn't", pr2.stdout.contains(s));
"bud" => "but"
[ ... ]
> +
> + public static void main(String[] args){
> + System.out.println("Good simple javaws exapmle");
"example" is spelt wrong.
Please re-post with above fixes and I will approve.
Thanks!
Deepak
More information about the distro-pkg-dev
mailing list