Giter VIP home page Giter VIP logo

Comments (10)

ren-zhijun-oracle avatar ren-zhijun-oracle commented on September 7, 2024

from mojarra.

ren-zhijun-oracle avatar ren-zhijun-oracle commented on September 7, 2024

@javaserverfaces Commented
Reported by @rlubke

from mojarra.

ren-zhijun-oracle avatar ren-zhijun-oracle commented on September 7, 2024

@javaserverfaces Commented
@rlubke said:
Taking ownership of issue.

from mojarra.

ren-zhijun-oracle avatar ren-zhijun-oracle commented on September 7, 2024

@javaserverfaces Commented
@rlubke said:
Change bundle for proposed fix:

SECTION: Modified Files

M src/com/sun/faces/application/ApplicationImpl.java

  • getDefaultLocale() must return null if not locale has been
    explicitly set.

M src/com/sun/faces/application/ViewHandlerImpl.java

  • Take into account the above that getDefaultLocale() may
    return null.

M src/com/sun/faces/config/ConfigureListener.java

  • Center point of the bug. The logic that set the default locale
    would have only been called if tracing was active...this has
    been adjusted.

M test/com/sun/faces/application/TestApplicationImpl_Config.java

  • Ensure the default locale of en_US

SECTION: Diffs

Index: src/com/sun/faces/application/ApplicationImpl.java

RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/application/ApplicationImpl.java,v
retrieving revision 1.50
diff -u -r1.50 ApplicationImpl.java
— src/com/sun/faces/application/ApplicationImpl.java 10 May 2004 19:55:59
-0000 1.50
+++ src/com/sun/faces/application/ApplicationImpl.java 14 Jul 2004 20:02:39 -0000
@@ -574,16 +574,7 @@

public Locale getDefaultLocale() {

  • Locale result = defaultLocale;
  • synchronized (this) {
  • if (null == defaultLocale) { - result = Locale.getDefault(); - }
  • }
  • if (log.isTraceEnabled()) { - log.trace("get defaultLocale " + result); - }
  • return result;
    • return defaultLocale;
      }

Index: src/com/sun/faces/application/ViewHandlerImpl.java

RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/application/ViewHandlerImpl.java,v
retrieving revision 1.41
diff -u -r1.41 ViewHandlerImpl.java
— src/com/sun/faces/application/ViewHandlerImpl.java 10 May 2004 19:56:00
-0000 1.41
+++ src/com/sun/faces/application/ViewHandlerImpl.java 14 Jul 2004 20:02:40 -0000
@@ -397,6 +397,7 @@
// if it's not in the supported locales,
if (null == result) {
Locale defaultLocale = context.getApplication().getDefaultLocale();

  • if (defaultLocale != null) {
    if ( perf.equals(defaultLocale))

{ // exact match result = defaultLocale; @@ -411,6 +412,7 @@ result = defaultLocale; }

}

  • }
    }

return result;
Index: src/com/sun/faces/config/ConfigureListener.java

RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/config/ConfigureListener.java,v
retrieving revision 1.20
diff -u -r1.20 ConfigureListener.java
— src/com/sun/faces/config/ConfigureListener.java 4 Jun 2004 20:48:01 -0000
1.20
+++ src/com/sun/faces/config/ConfigureListener.java 14 Jul 2004 20:02:41 -0000
@@ -760,12 +760,10 @@
value = config.getDefaultLocale();
if (value != null) {
if (log.isTraceEnabled()) {

  • if (log.isTraceEnabled()) { - log.trace("setDefaultLocale(" + value + ")"); - }
  • application.setDefaultLocale
  • (Util.getLocaleFromString(value));
    • log.trace("setDefaultLocale(" + value + ")");
      }
    • application.setDefaultLocale
    • (Util.getLocaleFromString(value));
      }

values = config.getSupportedLocales();
Index: test/com/sun/faces/application/TestApplicationImpl_Config.java

RCS file:
/cvs/javaserverfaces-sources/jsf-ri/test/com/sun/faces/application/TestApplicationImpl_Config.java,v
retrieving revision 1.34
diff -u -r1.34 TestApplicationImpl_Config.java
— test/com/sun/faces/application/TestApplicationImpl_Config.java 15 Jun
2004 21:03:39 -0000 1.34
+++ test/com/sun/faces/application/TestApplicationImpl_Config.java 14 Jul
2004 20:02:44 -0000
@@ -412,7 +412,7 @@

application.addValidator("Billybob",
"javax.faces.validator.LengthValidator");

  • assertTrue(null != (newTestValidator = (Validator)
    • assertTrue(null != (newTestValidator =
      application.createValidator("Billybob")));
      assertTrue(newTestValidator != testValidator);

@@ -526,8 +526,7 @@

assertNotNull("Can't get default locale from Application",
locale = application.getDefaultLocale());

  • Locale defaultLocale = Locale.getDefault();
  • assertEquals(locale, defaultLocale); +
    assertEquals(Locale.US, locale);

Iterator iter;
int j = 0, len = 0;

from mojarra.

ren-zhijun-oracle avatar ren-zhijun-oracle commented on September 7, 2024

@javaserverfaces Commented
@edburns said:
Looks good, r=edburns

from mojarra.

ren-zhijun-oracle avatar ren-zhijun-oracle commented on September 7, 2024

@javaserverfaces Commented
@rlubke said:
Patch applied. Unit tests pass. Marking as fixed.

from mojarra.

ren-zhijun-oracle avatar ren-zhijun-oracle commented on September 7, 2024

@javaserverfaces Commented
@manfredriem said:
Closing issue out

from mojarra.

ren-zhijun-oracle avatar ren-zhijun-oracle commented on September 7, 2024

@javaserverfaces Commented
Was assigned to rlubke

from mojarra.

ren-zhijun-oracle avatar ren-zhijun-oracle commented on September 7, 2024

@javaserverfaces Commented
This issue was imported from java.net JIRA JAVASERVERFACES-8

from mojarra.

ren-zhijun-oracle avatar ren-zhijun-oracle commented on September 7, 2024

@javaserverfaces Commented
Marked as fixed on Wednesday, April 19th 2006, 5:44:32 am

from mojarra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.