Uploaded image for project: 'eXo ECMS'
  1. eXo ECMS
  2. ECMS-2698

java.lang.ArrayIndexOutOfBoundsException appears when process by method splif of class NodeLocation

    Details

    • Similar issues:
      Show 9 results 
    • BV:
      0
    • Support Status:
      Fixed in Product
    • BO:
      0

      Description

      method split of class org.exoplatform.services.wcm.core.NodeLocation has bug which cause Caused by: java.lang.ArrayIndexOutOfBoundsException: 3
      at org.exoplatform.services.wcm.core.NodeLocation.split(NodeLocation.java:306)
      at org.exoplatform.services.wcm.core.NodeLocation.getNodeLocationByExpression(NodeLocation.java:180)
      at org.exoplatform.wcm.webui.clv.UICLVPresentation.getCategories(UICLVPresentation.java:182)
      at org.exoplatform.wcm.webui.clv.UICLVPresentation.getCategories(UICLVPresentation.java:156)
      at org.exoplatform.wcm.webui.clv.UICLVPresentation.getCategories(UICLVPresentation.java:195)
      at org.exoplatform.wcm.webui.clv.UICLVPresentation.getCategories(UICLVPresentation.java:156)
      at org.exoplatform.wcm.webui.clv.UICLVPresentation.getCategories(UICLVPresentation.java:195)
      at org.exoplatform.wcm.webui.clv.UICLVPresentation.getCategories(UICLVPresentation.java:156)
      at org.exoplatform.wcm.webui.clv.UICLVPresentation.getCategories(UICLVPresentation.java:145)

      case study
      split(" repository:collaboration:/jcr:system/jcr:versionStorage/47972d920afb869f01c6d01013e0c1f6/1/jcr:frozenNode", ":")

        Gliffy Diagrams

          Issue Links

            Activity

            thuy_luuthanh Luu Thanh Thuy (Inactive) created issue -
            Hide
            nam.phung Phung Hai Nam (Inactive) added a comment - - edited

            When I configed for the category navigation by ContentListViewer that will show the Folder structure (not in category)

            in groovy template I called

            def categories = uicomponent.getCategories("nt:unstructured");
            

            This cause the above problem

            After investigated I saw in NodeLocation class we have a method

            private static final String[] split(String s, String ch) {
                String[] ss = new String[3];
                int prev = 0;
                int i=0;
                while(true) {
                  int next = s.indexOf(ch, prev);
                  if (next==-1) {
                    ss[i] = s.substring(prev);
                    break;
                  }
                  ss[i++] = s.substring(prev, next);
                  prev = next+1;
                }
            
                return ss;
            }
            
            

            Some where in recursive we have this method is called with:

            split(" repository:collaboration:/jcr:system/jcr:versionStorage/47972d920afb869f01c6d01013e0c1f6/1/jcr:frozenNode", ":")
            

            then i > 3

            I see you init an Array length 3. and some case variable i is greater than 3 -> problem occur

            Please check this. This is regression. So I would like we can fix it for ECMS 2.1.x and PLF 3.0.x (preparing to release)

            Show
            nam.phung Phung Hai Nam (Inactive) added a comment - - edited When I configed for the category navigation by ContentListViewer that will show the Folder structure (not in category) in groovy template I called def categories = uicomponent.getCategories( "nt:unstructured" ); This cause the above problem After investigated I saw in NodeLocation class we have a method private static final String [] split( String s, String ch) { String [] ss = new String [3]; int prev = 0; int i=0; while ( true ) { int next = s.indexOf(ch, prev); if (next==-1) { ss[i] = s.substring(prev); break ; } ss[i++] = s.substring(prev, next); prev = next+1; } return ss; } Some where in recursive we have this method is called with: split( " repository:collaboration:/jcr:system/jcr:versionStorage/47972d920afb869f01c6d01013e0c1f6/1/jcr:frozenNode" , ":" ) then i > 3 I see you init an Array length 3. and some case variable i is greater than 3 -> problem occur Please check this. This is regression. So I would like we can fix it for ECMS 2.1.x and PLF 3.0.x (preparing to release)
            thuy_luuthanh Luu Thanh Thuy (Inactive) made changes -
            Field Original Value New Value
            Priority Minor [ 4 ] Major [ 3 ]
            thanhtt Thanh Trung TRAN (Inactive) made changes -
            Affects Version/s wcm-2.1.6 [ 13377 ]
            Affects Version/s wcm-2.1.x [ 11997 ]
            thanhtt Thanh Trung TRAN (Inactive) made changes -
            Link This issue is related to ECMS-2488 [ ECMS-2488 ]
            minh.dang Minh Dang (Inactive) made changes -
            Original Estimate 4 hours [ 14400 ]
            Remaining Estimate 4 hours [ 14400 ]
            Labels ecms-2011-S36
            Assignee Le Thanh Hai [ hai_lethanh ]
            Fix Version/s wcm-2.3.0 [ 11950 ]
            Fix Version/s ecms-2011-S36 [ 15164 ]
            minh.dang Minh Dang (Inactive) made changes -
            Fix Version/s wcm-2.x [ 11661 ]
            minh.dang Minh Dang (Inactive) made changes -
            Fix Version/s wcm-2.1.6 [ 13377 ]
            Fix Version/s wcm-2.x [ 11661 ]
            Fix Version/s wcm-2.3.0 [ 11950 ]
            Priority Major [ 3 ] Critical [ 2 ]
            minh.dang Minh Dang (Inactive) made changes -
            Link This issue is cloned by ECMS-2701 [ ECMS-2701 ]
            Hide
            nam.phung Phung Hai Nam (Inactive) added a comment -

            exactly

            Show
            nam.phung Phung Hai Nam (Inactive) added a comment - exactly
            hai_lethanh Le Thanh Hai (Inactive) made changes -
            Attachment 2011-09-07-ECMS-2701.patch [ 41417 ]
            Support Status New Product Patch Proposed
            hai_lethanh Le Thanh Hai (Inactive) logged work - 07/Sep/11 4:26 AM
            • Time Spent:
              1 hour
               
              <No comment>
            hai_lethanh Le Thanh Hai (Inactive) made changes -
            Remaining Estimate 4 hours [ 14400 ] 0 minutes [ 0 ]
            Time Spent 1 hour [ 3600 ]
            Worklog Id 44653 [ 44653 ]
            hai_lethanh Le Thanh Hai (Inactive) made changes -
            Attachment 2011-09-07-ECMS-2698.patch [ 41418 ]
            hai_lethanh Le Thanh Hai (Inactive) made changes -
            Attachment 2011-09-07-ECMS-2701.patch [ 41417 ]
            Hide
            minh.dang Minh Dang (Inactive) added a comment -

            VALIDATED ON BEHALF OF PM

            Show
            minh.dang Minh Dang (Inactive) added a comment - VALIDATED ON BEHALF OF PM
            thanhtt Thanh Trung TRAN (Inactive) made changes -
            Link This issue should also fix CCP-1032 [ CCP-1032 ]
            Hide
            ci-server CI Server added a comment -

            Integrated in ecms-2.1.x-ci #772
            ECMS-2698: java.lang.ArrayIndexOutOfBoundsException is thrown when using method split of class NodeLocation

            Fix description

            • Edit code to loop only three times to get three string items (repository, workspace, nodepath) (Revision 73273)

            Result = SUCCESS
            thanhtt :
            Files :

            • /ecms/branches/2.1.x/core/services/src/main/java/org/exoplatform/services/wcm/core/NodeLocation.java
            • /ecms/branches/2.1.x/patch/2.1.6/ECMS-2698
            • /ecms/branches/2.1.x/patch/2.1.6/ECMS-2698/ECMS-2698.patch
            • /ecms/branches/2.1.x/patch/2.1.6/ECMS-2698/readme.txt
            Show
            ci-server CI Server added a comment - Integrated in ecms-2.1.x-ci #772 ECMS-2698 : java.lang.ArrayIndexOutOfBoundsException is thrown when using method split of class NodeLocation Fix description Edit code to loop only three times to get three string items (repository, workspace, nodepath) (Revision 73273) Result = SUCCESS thanhtt : Files : /ecms/branches/2.1.x/core/services/src/main/java/org/exoplatform/services/wcm/core/NodeLocation.java /ecms/branches/2.1.x/patch/2.1.6/ ECMS-2698 /ecms/branches/2.1.x/patch/2.1.6/ ECMS-2698 / ECMS-2698 .patch /ecms/branches/2.1.x/patch/2.1.6/ ECMS-2698 /readme.txt
            thanhtt Thanh Trung TRAN (Inactive) made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            Support Status Product Patch Proposed Fixed in Product
            Hide
            chau_trannam Tran Nam Chau (Inactive) added a comment -

            Tested OK plf 3.0.6

            Show
            chau_trannam Tran Nam Chau (Inactive) added a comment - Tested OK plf 3.0.6
            chau_trannam Tran Nam Chau (Inactive) made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            aheritier Arnaud HERITIER (Inactive) made changes -
            Workflow Workflow with Waiting Status [ 83887 ] WKF-JIRA_WAITING-1.0 [ 136227 ]
            aheritier Arnaud HERITIER (Inactive) made changes -
            Workflow WKF-JIRA_WAITING-1.0 [ 136227 ] WKF-JIRA_WAITING-1.0-Closed-Editable [ 184763 ]
            fdrouet Frederic DROUET made changes -
            Workflow WKF-JIRA_WAITING-1.0-Closed-Editable [ 184763 ] WKF-DEV-ENG3 [ 232084 ]
            Transition Time In Source Status Execution Times Last Executer Last Execution Date
            Open Open Resolved Resolved
            1d 4h 38m 1 Thanh Trung TRAN (Inactive) 07/Sep/11 2:01 PM
            Resolved Resolved Closed Closed
            15h 6m 1 Tran Nam Chau (Inactive) 08/Sep/11 5:08 AM

              People

              • Assignee:
                hai_lethanh Le Thanh Hai (Inactive)
                Reporter:
                thuy_luuthanh Luu Thanh Thuy (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response:

                  Time Tracking

                  Estimated:
                  Original Estimate - 4 hours
                  4h
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour Time Not Required
                  1h

                    Development