Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-4350

OpenmrsClassLoader may chose wrong ModuleClassLoader when one module name is a substring of another module name and there is a period in the name

    Details

    • Complexity:
      Low

      Description

      We have fixed as part of TRUNK-4348 the general case when one module name is a substring of another. But, as Wyclif Luyima points out, this may still fail if for modules with periods in the name. For instance, if there was a reporting.ui module, OpenmrsClassLoader would potentially match it with the reporting module classloader.

      Potential fix?

      We could change it so that it takes the classname and truncates at the last dot and then do an equals comparison. Are there any cases when we think doing that wouldn't be the right thing?

      For example:
      int pos = className.lastIndexOf(".");
      String classPackageName = className.substring(0, pos);
      tryToLoad = classPackageName.equals(moduleClassLoader.getModul().getPackageName())

        Gliffy Diagrams

          Attachments

            Issue Links

              Attachments-Category-Modification

                Activity

                  People

                  • Assignee:
                    pmuchowski Paweł Muchowski
                    Reporter:
                    mogoodrich Mark Goodrich
                    Watchers:
                    Daniel Kayiwa, Mark Goodrich, Paweł Muchowski, Rafal Korytkowski, Wyclif Luyima
                    Designated Committer:
                    Rafal Korytkowski
                  • Votes:
                    0 Vote for this issue
                    Watchers:
                    5 Start watching this issue

                    Dates

                    • Created:
                      Updated:
                      Resolved:

                      Time Tracking

                      Estimated:
                      Original Estimate - 2 hours Original Estimate - 2 hours
                      2h
                      Remaining:
                      Remaining Estimate - 0 minutes
                      0m
                      Logged:
                      Time Spent - 3 days, 1 hour
                      3d 1h