You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by ap...@apache.org on 2006/12/02 22:23:05 UTC
svn commit: r481627 -
/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/UrlDefinitionsFactory.java
Author: apetrelli
Date: Sat Dec 2 13:23:04 2006
New Revision: 481627
URL: http://svn.apache.org/viewvc?view=rev&rev=481627
Log:
Minor changes for performance improvement and method name typos correction.
Modified:
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/UrlDefinitionsFactory.java
Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/UrlDefinitionsFactory.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/UrlDefinitionsFactory.java?view=diff&rev=481627&r1=481626&r2=481627
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/UrlDefinitionsFactory.java (original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/UrlDefinitionsFactory.java Sat Dec 2 13:23:04 2006
@@ -190,20 +190,23 @@
throws DefinitionsFactoryException {
Locale locale = tilesContext.getRequestLocale();
- List<String> postfixes = calculatePostixes(locale);
if (isContextProcessed(tilesContext)) {
return;
- } else {
- processedLocales.add(locale);
+ }
+
+ if (locale == null) {
+ return;
}
+ processedLocales.add(locale);
+ List<String> postfixes = calculatePostfixes(locale);
for (Object source : sources) {
URL url = (URL) source;
String path = url.toExternalForm();
- for (Object postfixe : postfixes) {
- String newPath = concatPostfix(path, (String) postfixe);
+ for (Object postfix : postfixes) {
+ String newPath = concatPostfix(path, (String) postfix);
try {
URL newUrl = new URL(newPath);
URLConnection connection = newUrl.openConnection();
@@ -292,14 +295,14 @@
}
/**
- * Calculate the postixes along the search path from the base bundle to the
+ * Calculate the postfixes along the search path from the base bundle to the
* bundle specified by baseName and locale.
* Method copied from java.util.ResourceBundle
*
* @param locale the locale
* @return a list of
*/
- protected static List<String> calculatePostixes(Locale locale) {
+ protected static List<String> calculatePostfixes(Locale locale) {
final List<String> result = new ArrayList<String>();
final String language = locale.getLanguage();
final int languageLength = language.length();