Uploaded image for project: 'Magnolia Resources Module'
  1. Magnolia Resources Module
  2. MGNLRES-103

InstallTextResourcesTask's pattern is always set to UTF-8

XMLWordPrintable

      Hey guys,

      I've found a bug in the resources module concerning the install task. Please take a closer look to the constructor of InstallTextResourcesTask:

      public class InstallTextResourcesTask extends AbstractRepositoryTask {
      
        ...
      
          public InstallTextResourcesTask(String pattern, String template, boolean processed, String modelClass, boolean preserveResourcesParameters) {
              this("Install text resources", "Installs all resources matching the " + pattern + " pattern.", InstallTextResourceTask.DEFAULT_ENCODING, pattern, template, processed, modelClass, preserveResourcesParameters);
          }
      
          public InstallTextResourcesTask(String pattern, String template, String encoding, boolean processed, String modelClass, boolean preserveResourcesParameters) {
              this("Install text resources", "Installs all resources matching the " + pattern + " pattern.", encoding, pattern, template, processed, modelClass, preserveResourcesParameters);
          }
      
          public InstallTextResourcesTask(String taskName, String taskDescription, String pattern, String encoding, String template, boolean processed, String modelClass, boolean preserveResourcesParameters) {
              super(taskName, taskDescription);
              this.pattern = pattern;
              this.template = template;
              this.modelClass = modelClass;
              this.processed = processed;
              this.preserveResourcesParameters = preserveResourcesParameters;
          }
      
          ...
      
      }
      

      Notice the order of the parameters the first two constructors call the last big constructor:

        taskName, taskDescription, encoding, pattern, ...
      

      But in the last constructor the parameters "encoding" and "pattern" are swapped:

        taskName, taskDescription, pattern, encoding
      

      This leads to every task having a pattern of "UTF-8" which is definetly not what we want.

        Acceptance criteria

              knedoma Karel Nedoma
              christian.hamm@elekta.com Christian Hamm
              Nucleus
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD