Pentaho Analysis - Mondrian
  1. Pentaho Analysis - Mondrian
  2. MONDRIAN-434

Small negative numbers cause exceptions w 2-section format

    Details

      Description

      Test (added but commented out to Format.java):

      checkFormat(null, new Double(-0.001), "0.##;(0.##)");

      Exception:

      java.lang.ArrayIndexOutOfBoundsException: 2
       at mondrian.util.Format$AlternateFormat.format(Format.java:346)
       at mondrian.util.Format.format(Format.java:2046)
       at mondrian.util.Format.format(Format.java:2034)
       at mondrian.util.FormatTest.checkFormat(FormatTest.java:330)
       at mondrian.util.FormatTest.testSmallNegativeNumbers(FormatTest.java:192)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at junit.framework.TestCase.runTest(TestCase.java:154)
       at junit.framework.TestCase.runBare(TestCase.java:127)
       at junit.framework.TestResult$1.protect(TestResult.java:106)
       at junit.framework.TestResult.runProtected(TestResult.java:124)
       at junit.framework.TestResult.run(TestResult.java:109)
       at junit.framework.TestCase.run(TestCase.java:118)
       at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
       at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

        Activity

        Hide
        Mondrian Importer User added a comment -
        {nobody}, 07/25/2008: IP, Artifact Created: 71.6.42.5 |
        {jhyde}, 07/25/2008: IP, Comment Added: 66.92.12.96
        Show
        Mondrian Importer User added a comment - {nobody}, 07/25/2008: IP, Artifact Created: 71.6.42.5 | {jhyde}, 07/25/2008: IP, Comment Added: 66.92.12.96
        Hide
        Mondrian Importer User added a comment -
        {jhyde}, 07/25/2008: Logged In: YES
        user_id=312935
        Originator: NO

        What do you think this case should return? If you can try in VB or in SSAS, that would be great.

        Note we have very similar test cases already:
                // The +ve format gives "-0.01", but the negative format gives "0.0",
                // so we move onto the "Nil" format.
                checkFormat(null, new Double(-0.001), "0.##;(0.##);Nil", "Nil");
                checkFormat(null, new Double(-0.01), "0.##;(0.##);Nil", "(0.01)");
                checkFormat(null, new Double(-0.01), "0.##;(0.#);Nil", "Nil");

        And by the way, since you logged the bug anonymously, who are you?
        Show
        Mondrian Importer User added a comment - {jhyde}, 07/25/2008: Logged In: YES user_id=312935 Originator: NO What do you think this case should return? If you can try in VB or in SSAS, that would be great. Note we have very similar test cases already:         // The +ve format gives "-0.01", but the negative format gives "0.0",         // so we move onto the "Nil" format.         checkFormat(null, new Double(-0.001), "0.##;(0.##);Nil", "Nil");         checkFormat(null, new Double(-0.01), "0.##;(0.##);Nil", "(0.01)");         checkFormat(null, new Double(-0.01), "0.##;(0.#);Nil", "Nil"); And by the way, since you logged the bug anonymously, who are you?
        Hide
        Julian Hyde added a comment -
        Fixed in change 13066. Will be in mondrian-3.1.5/mondrian-4.0.
        Show
        Julian Hyde added a comment - Fixed in change 13066. Will be in mondrian-3.1.5/mondrian-4.0.

          People

          • Assignee:
            Julian Hyde
            Reporter:
            Unassigned User
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: