Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-70416

Sorting on Page Properties Report macro may trigger an exception

XMLWordPrintable

      Issue Summary

      Sometimes a Page Properties Report macro throws an exception while sorting. There is a Comparator that is violating its general contract which most likely means it isn't upholding transitivity when sorting the page properties.

      Steps to Reproduce

      The exact values needed to reproduce are still unknown, and will likely need to be reverse-engineered by looking at the Comparator class. The best method as of now is as follows:

      1. Create many pages with page properties with at least one column that has primarily datetime objects. Label all the pages.
      2. Use the page properties report macro and report on the pages, be sure to use the macro configuration options and set to sort by your column that contains mostly dates.

      Expected Results

      No issue with sorting.

      Actual Results

      Error on page:

      Error rendering macro 'detailssummary' : Comparison method violates its general contract!

      The below exception is thrown:

      java.lang.IllegalArgumentException: Comparison method violates its general contract!
      java.util.TimSort.mergeLo(TimSort.java:777)
      java.util.TimSort.mergeAt(TimSort.java:514)
      java.util.TimSort.mergeCollapse(TimSort.java:441)
      java.util.TimSort.sort(TimSort.java:245)
      java.util.Arrays.sort(Arrays.java:1512)
      java.util.ArrayList.sort(ArrayList.java:1462)
      java.util.Collections.sort(Collections.java:177)
      com.atlassian.confluence.extra.masterdetail.DetailsSummaryBuilder.getPaginatedDetailLines(DetailsSummaryBuilder.java:227)
      com.atlassian.confluence.extra.masterdetail.DetailsSummaryMacro.getPaginatedDetailLines(DetailsSummaryMacro.java:234)
      com.atlassian.confluence.extra.masterdetail.DetailsSummaryMacro.buildTemplateModel(DetailsSummaryMacro.java:188)
      com.atlassian.confluence.extra.masterdetail.DetailsSummaryMacro.executeToStream(DetailsSummaryMacro.java:145)
      sun.reflect.GeneratedMethodAccessor3256.invoke(Unknown Source)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      java.lang.reflect.Method.invoke(Method.java:498)
      com.atlassian.confluence.macro.xhtml.XhtmlMacroManager$ResourceAwareMacroInvocationHandler.invoke(XhtmlMacroManager.java:201)
      com.sun.proxy.$Proxy3069.executeToStream(Unknown Source)
      com.atlassian.confluence.content.render.xhtml.view.macro.ViewMacroMarshaller.executeMacro(ViewMacroMarshaller.java:228)
      com.atlassian.confluence.content.render.xhtml.view.macro.ViewMacroMarshaller.marshalInternal(ViewMacroMarshaller.java:155)
      com.atlassian.confluence.content.render.xhtml.view.macro.ViewMacroMarshaller.lambda$marshal$0(ViewMacroMarshaller.java:114)
      com.atlassian.confluence.impl.content.render.xhtml.analytics.MetricsCollectingMarshaller.marshal(MetricsCollectingMarshaller.java:50)
      com.atlassian.confluence.content.render.xhtml.view.macro.ViewMacroMarshaller.marshal(ViewMacroMarshaller.java:119)
      com.atlassian.confluence.content.render.xhtml.view.macro.ViewMacroMarshaller.marshal(ViewMacroMarshaller.java:53)
      com.atlassian.confluence.content.render.xhtml.DefaultXhtmlContent.convertMacroDefinitionToView(DefaultXhtmlContent.java:157)
      sun.reflect.GeneratedMethodAccessor3268.invoke(Unknown Source)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      java.lang.reflect.Method.invoke(Method.java:498)
      com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
      com.sun.proxy.$Proxy704.convertMacroDefinitionToView(Unknown Source)
      sun.reflect.GeneratedMethodAccessor3268.invoke(Unknown Source)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      java.lang.reflect.Method.invoke(Method.java:498)
      org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
      org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
      org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)
      org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor$1.run(ServiceTCCLInterceptor.java:61)
      org.eclipse.gemini.blueprint.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:130)
      org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokePrivileged(ServiceTCCLInterceptor.java:58)
      org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:50)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)
      org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
      com.sun.proxy.$Proxy1631.convertMacroDefinitionToView(Unknown Source)
      com.atlassian.confluence.tinymceplugin.rest.MacroResource.lambda$generatePreview$0(MacroResource.java:266)
      

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

            Unassigned Unassigned
            evanlare Eric Van Lare (Inactive)
            Votes:
            4 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: