Here is the code that is doing the selection, in
ResolvePermutationDependentValues:
private JExpression propertyValueExpression(JPermutationDependentValue x) {
List<String> propertyValues =
props.getConfigurationProperties().getStrings(x.getRequestedValue());
String propertyValue = propertyValues.isEmpty() ? null :
Joiner.on(",").join(propertyValues);
if (propertyValue != null) {
// It is a configuration property.
return program.getLiteral(x.getSourceInfo(), propertyValue);
}
if (isSoftPermutationProperty(x.getRequestedValue())) {
JMethod method = getOrCreateSoftPropertyMethod(x.getSourceInfo(),
x.getRequestedValue());
return new JMethodCall(x.getSourceInfo(), null, method);
}
propertyValue =
commonPropertyAndBindingInfo.getPropertyValue(x.getRequestedValue());
if (propertyValue != null) {
return program.getLiteral(x.getSourceInfo(), propertyValue);
}
return x.getDefaultValueExpression();
}
I'd set a breakpoint there to see where it's getting its values from, and
why it leads to combinatorial explosion.
My guess is overloading the property "locale".
Here are some places where it is special cased:
@RunsLocal(requiresProperties = {"locale.queryparam", "locale",
"runtime.locales", "locale.cookie"})
public class LocalizableGenerator extends Generator {
sdm Recompiler.java:
if (!binding.isAllowedValue(newValue)) {
String[] allowedValues = binding.getAllowedValues(binding.getRootCondition());
logger.log(TreeLogger.Type.WARN, "property '" + propName +
"' cannot be set to '" + newValue + "'");
logger.log(TreeLogger.Type.INFO, "allowed values: " +
Joiner.on(", ").join(allowedValues));
// See if we can fall back on a reasonable default.
if (allowedValues.length == 1) {
// There is only one possibility, so use it.
newValue = allowedValues[0];
} else if (binding.getName().equals("locale")) {
// TODO: come up with a more general solution. Perhaps fail
// the compile and give the user a way to override the property?
newValue = chooseDefault(binding, "default", "en", "en_US");
} else {
// There is more than one. Continue and possibly compile multiple
permutations.
logger.log(TreeLogger.Type.INFO, "continuing without " + propName +
". Sourcemaps may not work.");
return null;
}
AbstractLocalizableImplCreator (#JavaNames):
SelectionProperty localeProp = context.getPropertyOracle()
.getSelectionProperty(logger, "locale");
String defaultLocale = localeProp.getFallbackValue();
if (defaultLocale.length() > 0) {
genLocale = defaultLocale;
}
Try it with a different property name, I bet your problem goes away.
--
You received this message because you are subscribed to the Google Groups "GWT
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-web-toolkit-contributors/9a957894-b8ba-4641-aa17-b907cbf96f6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.