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

Service Builder Generated Class possibility of Syntax Error

    Details

      Description

      Running Service Builder with a service.xml that contains the name 'value' for field and finder-column, will result in an error for the generated PersistanceImpl class.

      Reproduce:
      1. Make sure you have blade and create service builder template
      blade create -t service-builder -v 7.0 -p com.liferay.test tests
      2. Go to the file tests > tests-service > service.xml
      3. Add the following in their section 'other fields' and 'finder methods' and save:

      <column name="value" type="String" />
      
      <finder name="test" return-type="Collection">
          <finder-column name="value" />
      </finder>
      

      4. Go to test folder and run 'blade gw buildService'
      5. Then run 'blade gw build'

      Expected Behavior:
      Builds succesfully

      Actual Behavior:
      Build fails with following error:

      :tests-service:compileJavaC:\Users\liferay\Desktop\liferay\tests\tests-service\src\main\java\com\liferay\tests\service\persistence\impl\FooPersistenceImpl.java:2393: error: variable value is already defined in method getBytest_PrevAndNext(Session,Foo,String,OrderByComparator<Foo>,boolean)
                              for (Object value : values) {
                                          ^
      Note: C:\Users\liferay\Desktop\liferay\tests\tests-service\src\main\java\com\liferay\tests\service\persistence\impl\FooPersistenceImpl.java uses unchecked or unsafe operations.
      Note: Recompile with -Xlint:unchecked for details.
      1 error
       FAILED
      
      FAILURE: Build failed with an exception.
      
      

        Attachments

          Activity

            People

            • Assignee:
              sharry.shi Sharry Shi
              Reporter:
              fortunato.maldonado Fortunato Maldonado (Inactive)
              Participants of an Issue:
              Recent user:
              Enterprise Release HU
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                45 weeks, 6 days ago

                Packages

                Version Package
                7.0.0 DXP FP69
                7.0.X
                7.1.10 DXP FP6
                7.1.10.2 SP2
                7.1.3 CE GA4
                7.1.X
                7.2.X
                Master