This fixes the build on my machine. Martijn
On 11/5/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Author: jcompagner > Date: Mon Nov 5 14:41:00 2007 > New Revision: 592171 > > URL: http://svn.apache.org/viewvc?rev=592171&view=rev > Log: > If the package resource was already loaded for the default locale then the > resource reference locale was not set the second time > > Modified: > > wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/image/resource/LocalizedImageResource.java > > wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/form/imagebutton/ImageButtonTest.java > > wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/image/ImageTest.java > > Modified: > wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/image/resource/LocalizedImageResource.java > URL: > http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/image/resource/LocalizedImageResource.java?rev=592171&r1=592170&r2=592171&view=diff > ============================================================================== > --- > wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/image/resource/LocalizedImageResource.java > (original) > +++ > wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/image/resource/LocalizedImageResource.java > Mon Nov 5 14:41:00 2007 > @@ -181,6 +181,11 @@ > > // Then dereference the resource > resource = resourceReference.getResource(); > + > + if (resource instanceof PackageResource) > + { > + > resourceReference.setLocale(((PackageResource)resource).getLocale()); > + } > } > } > > @@ -254,8 +259,8 @@ > Locale l = component.getLocale(); > String s = component.getStyle(); > if (resourceKind == null && > - (!Objects.equal(locale, component.getLocale()) || > !Objects.equal(style, component > - .getStyle()))) > + (!Objects.equal(locale, component.getLocale()) || > !Objects.equal(style, > + component.getStyle()))) > { > // Get new component locale and style > locale = component.getLocale(); > @@ -415,8 +420,7 @@ > if (valueParser.matches()) > { > final String imageReferenceName = > valueParser.getImageReferenceName(); > - final String specification = > Strings.replaceHtmlEscapeNumber(valueParser > - .getSpecification()); > + final String specification = > Strings.replaceHtmlEscapeNumber(valueParser.getSpecification()); > final String factoryName = > valueParser.getFactoryName(); > final Application application = > component.getApplication(); > > @@ -429,8 +433,8 @@ > { > // Resource not available yet, so > create it with factory and > // share via Application > - final Resource imageResource = > getResourceFactory(application, factoryName) > - .newResource(specification, > locale, style); > + final Resource imageResource = > getResourceFactory(application, factoryName).newResource( > + specification, locale, style); > > application.getSharedResources().add(Application.class, imageReferenceName, > locale, style, imageResource); > } > > Modified: > wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/form/imagebutton/ImageButtonTest.java > URL: > http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/form/imagebutton/ImageButtonTest.java?rev=592171&r1=592170&r2=592171&view=diff > ============================================================================== > --- > wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/form/imagebutton/ImageButtonTest.java > (original) > +++ > wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/form/imagebutton/ImageButtonTest.java > Mon Nov 5 14:41:00 2007 > @@ -16,6 +16,8 @@ > */ > package org.apache.wicket.markup.html.form.imagebutton; > > +import java.util.Locale; > + > import org.apache.wicket.WicketTestCase; > > /** > @@ -39,6 +41,8 @@ > */ > public void test_1() throws Exception > { > + Locale.setDefault(new Locale("en", "US")); > + > tester.startPage(Home.class); > > tester.clickLink("goCanadian"); > > Modified: > wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/image/ImageTest.java > URL: > http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/image/ImageTest.java?rev=592171&r1=592170&r2=592171&view=diff > ============================================================================== > --- > wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/image/ImageTest.java > (original) > +++ > wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/image/ImageTest.java > Mon Nov 5 14:41:00 2007 > @@ -16,6 +16,8 @@ > */ > package org.apache.wicket.markup.html.image; > > +import java.util.Locale; > + > import org.apache.wicket.WicketTestCase; > > /** > @@ -39,30 +41,25 @@ > */ > public void test_1() throws Exception > { > + Locale.setDefault(new Locale("en", "US")); > tester.startPage(Home.class); > > tester.clickLink("goCanadian"); > - tester > - > .assertContains("src=\"resources/org.apache.wicket.markup.html.image.Home/Beer_en_CA.gif\""); > + > tester.assertContains("src=\"resources/org.apache.wicket.markup.html.image.Home/Beer_en_CA.gif\""); > > tester.clickLink("goChinese"); > - tester > - > .assertContains("src=\"resources/org.apache.wicket.markup.html.image.Home/Beer_zh_CN.gif\""); > + > tester.assertContains("src=\"resources/org.apache.wicket.markup.html.image.Home/Beer_zh_CN.gif\""); > > tester.clickLink("goDanish"); > - tester > - > .assertContains("src=\"resources/org.apache.wicket.markup.html.image.Home/Beer_da_DK.gif\""); > + > tester.assertContains("src=\"resources/org.apache.wicket.markup.html.image.Home/Beer_da_DK.gif\""); > > tester.clickLink("goDutch"); > - tester > - > .assertContains("src=\"resources/org.apache.wicket.markup.html.image.Home/Beer_nl_NL.gif\""); > + > tester.assertContains("src=\"resources/org.apache.wicket.markup.html.image.Home/Beer_nl_NL.gif\""); > > tester.clickLink("goGerman"); > - tester > - > .assertContains("src=\"resources/org.apache.wicket.markup.html.image.Home/Beer_de_DE.gif\""); > + > tester.assertContains("src=\"resources/org.apache.wicket.markup.html.image.Home/Beer_de_DE.gif\""); > > tester.clickLink("goUS"); > - tester > - > .assertContains("src=\"resources/org.apache.wicket.markup.html.image.Home/Beer.gif\""); > + > tester.assertContains("src=\"resources/org.apache.wicket.markup.html.image.Home/Beer.gif\""); > } > } > > > -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.0-beta4 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta4/