Uploaded image for project: 'appNG'
  1. appNG
  2. APPNG-2150

PropertyConstantCreator and ApplicationPropertyConstantCreator incorrect UTF-8 encoding

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 1.17.1
    • Component/s: appng-tools
    • Environment:

      windows

      Description

      There are actually several issues for the ApplicationPropertyConstantCreator:

      the class comment does not resolve the artifactId and version

      /** Property constants for ${project.artifactId} ${project.version} */
      public class PropertyConstants {
      

      UTF-8 characters might be encoded incorrectly (i had different results with different build tools on windows)

      properties with a "." generate invalid java code:

      <property id="complex.property" description="Gehälter in €">1000</property>

      results in:

      /** Geh�lter in � */
      public static final String PROP_COMPLEX_._PROPERTY = "complex.property";

       

      PropertyConstantCreator may encode UTF-8 characters incorrectly as well

      person.salary=Gehälter in €!
      /** Gehälter in �?�! */
      public static final String PERSON_SALARY = "person.salary";

       

      Possible solution for the second set of issues:

      • Enforce UTF-8 writer (or add a property to configure the encoding)
      • Field name should replace "." with "_"

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mueller.matthias Matthias Müller
                Reporter:
                c.brueckner Christian Brückner
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: