Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-3219

Recursive internationalization labels causes PotentialDeadLockException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.0.2
    • Fix Version/s: 8.0.3
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None
    • gh.sprint.customfield.default.name:
      ZK 8.0.3 S3

      Description

      Reproduce with:

      my.app.label.a= Label A
      my.app.label.a.b= ${my.app.label.a.$}
      my.app.label.a.b.c= ${my.app.label.a.b}
      
      <zk>
      	<div>
      		<vlayout>
      			<label value="${labels.my.app.label.a.$}"/>
      			<label value="${labels.my.app.label.a.b}"/>
      			<label value="${labels.my.app.label.a.b.c}"/>
      		</vlayout>
      	</div>
      </zk>
      

      In ZK 8.0.1 in zk-label.properties if a label targets its own parent value for its value, the value would be a string representation of the label map.
      such as:

      {c=org.zkoss.util.resource.impl.LabelLoaderImpl$ExValue@f60d74, $=org.zkoss.util.resource.impl.LabelLoaderImpl$ExValue@45c68acf}

      In ZK 8.0.2
      If the label is a member of the parent target, the following exception is throw when the result is a loop.

      org.zkoss.lang.PotentialDeadLockException: Wait for itself?
      	at org.zkoss.util.WaitLock.waitUntilUnlock(WaitLock.java:84)
      	at org.zkoss.util.resource.impl.LabelLoaderImpl.loadLabels(LabelLoaderImpl.java:223)
      	at org.zkoss.util.resource.impl.LabelLoaderImpl.getSegmentedLabels(LabelLoaderImpl.java:153)
      	at org.zkoss.util.resource.impl.LabelLoaderImpl.getSegmentedLabels(LabelLoaderImpl.java:143)
      	at org.zkoss.util.resource.impl.LabelLoaderImpl$Resolver.resolveVariable(LabelLoaderImpl.java:442)
      	at org.zkoss.xel.zel.XelELResolver.resolve(XelELResolver.java:123)
      	at org.zkoss.xel.zel.XelELResolver.getValue(XelELResolver.java:100)
      	at org.zkoss.zel.CompositeELResolver.getValue(CompositeELResolver.java:66)
      	at org.zkoss.zel.impl.parser.AstIdentifier.getValue(AstIdentifier.java:83)
      	at org.zkoss.zel.impl.parser.AstValue.getValue(AstValue.java:148)
      	at org.zkoss.zel.impl.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
      	at org.zkoss.xel.zel.ELXelExpression.evaluate(ELXelExpression.java:41)
      	at org.zkoss.util.resource.impl.LabelLoaderImpl$ExValue.getValue(LabelLoaderImpl.java:429)
      	at org.zkoss.util.resource.impl.LabelLoaderImpl.expendValue(LabelLoaderImpl.java:328)
      	at org.zkoss.util.resource.impl.LabelLoaderImpl.toExValue(LabelLoaderImpl.java:315)
      	at org.zkoss.util.resource.impl.LabelLoaderImpl.loadLabels(LabelLoaderImpl.java:274)
      	at org.zkoss.util.resource.impl.LabelLoaderImpl.loadLabels(LabelLoaderImpl.java:281)
      	at org.zkoss.util.resource.impl.LabelLoaderImpl.loadLabels(LabelLoaderImpl.java:281)
      	at org.zkoss.util.resource.impl.LabelLoaderImpl.getLabel(LabelLoaderImpl.java:118)
      	at org.zkoss.util.resource.impl.LabelLoaderImpl.getLabel(LabelLoaderImpl.java:109)
      	at org.zkoss.util.resource.Labels.getLabel(Labels.java:61)
      	at org.zkoss.xel.fn.CommonFns.getLabel(CommonFns.java:134)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.zkoss.zel.impl.parser.AstFunction.getValue(AstFunction.java:192)
      	at org.zkoss.zel.impl.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
      	at org.zkoss.xel.zel.ELXelExpression.evaluate(ELXelExpression.java:41)
      	at org.zkoss.zk.xel.impl.SimpleEvaluator.evaluate(SimpleEvaluator.java:68)
      	at org.zkoss.zk.ui.metainfo.AbstractEvalRef.evaluate(AbstractEvalRef.java:46)
      	at org.zkoss.zk.xel.ExValue.getValue(ExValue.java:111)
      	at org.zkoss.zk.ui.metainfo.Property.getValue(Property.java:138)
      	at org.zkoss.zk.ui.metainfo.Property.assign0(Property.java:234)
      	at org.zkoss.zk.ui.metainfo.Property.assign(Property.java:174)
      	at org.zkoss.zk.ui.metainfo.ComponentInfo.applyProperties(ComponentInfo.java:742)
      	at org.zkoss.zk.ui.impl.AbstractUiFactory.newComponent(AbstractUiFactory.java:132)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                SEFI SEFI
                Reporter:
                MDuchemin MDuchemin
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours
                  3h