Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-54463

Refactoring _isFragment method in ModuleFrameworkImpl

    Details

      Description

      I would like to refactor the _isFragment method to check the bundle as fragment or not by adapting to BundleRevision and Checking for the type

      As-Is

      private boolean _isFragmentBundle(Bundle bundle) {
      		Dictionary<String, String> headers = bundle.getHeaders();
      
      		String fragmentHost = headers.get(Constants.FRAGMENT_HOST);
      
      		if (fragmentHost == null) {
      			return false;
      		}
      
      		return true;
      	}
      

      To-be

      if ((bundle.adapt(BundleRevision.class).getTypes() & BundleRevision.TYPE_FRAGMENT) == 0) {
          return true;
      }else{
             return false;
      }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sherry.zhu Sherry Zhu
              Reporter:
              kamesh.sampath Kamesh Sampath (Inactive)
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                5 years, 43 weeks, 6 days ago

                  Packages

                  Version Package
                  7.0.0 M5