Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-22036

batch property is incorrectly renamed in job.xml when refactoring

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 4.4.0.Alpha1
    • 4.3.1.CR1
    • batch
    • None
    • Hide

      1. create batchlet and job.xml as mentioned in description
      2. refactor -> rename myProp to myProp1
      3. check job.xml and you will see incorrect value myProp1 - should be namedProperty because Im using @BatchProperty(name = "namedProperty") in MyBatchlet

      Show
      1. create batchlet and job.xml as mentioned in description 2. refactor -> rename myProp to myProp1 3. check job.xml and you will see incorrect value myProp1 - should be namedProperty because Im using @BatchProperty(name = "namedProperty") in MyBatchlet

      my job.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <job id="myJob" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/jobXML_1_0.xsd"
          version="1.0">
          <step id="step1" >
          	<batchlet ref="myBatchlet">
          	<properties>
          		<property name="namedProperty" value="A"/>
          	</properties>
          	</batchlet>
          </step>
      </job>
      

      my batchlet:

      package batch;
      
      import javax.batch.api.AbstractBatchlet;
      import javax.batch.api.BatchProperty;
      import javax.inject.Inject;
      import javax.inject.Named;
      
      @Named
      public class MyBatchlet extends AbstractBatchlet {
      	
      	@Inject
      	@BatchProperty(name = "namedProperty") String myProp;
      
      	public MyBatchlet() {
      		// TODO Auto-generated constructor stub
      	}
      
      	@Override
      	public String process() throws Exception {
      		// TODO Auto-generated method stub
      		return null;
      	}
      
      }
      

      When I rename myProp in MyBatchelet to let's say myProp1 the value in job.xml will get changed to myProp1. This will result in warning because Im using @BatchProperty(name ="namedProperty")

            scabanovich Viacheslav Kabanovich (Inactive)
            rawagner@redhat.com Rastislav Wagner
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: