Index: LinearStretchEnhancementOperation.java
===================================================================
--- LinearStretchEnhancementOperation.java	(revision 43863)
+++ LinearStretchEnhancementOperation.java	(revision 43864)
@@ -60,7 +60,7 @@
      *
      */
     public LinearStretchEnhancementOperation(OperationFactory factory) {
-        this.factory = factory;
+        super(factory);
     }
 
     @Override
@@ -68,45 +68,31 @@
         super.preProcess();
         BufferManager manager = BufferLocator.getBufferManager();
 
-        if(this.parameters.getDynClass().getDynField(STATISTICS_PARAM)!=null) {
-            statistics = (Statistics) this.parameters.getDynValue(STATISTICS_PARAM);
-        }
+        statistics = (Statistics) this.getParameter(STATISTICS_PARAM, null);
         if (statistics == null) {
-            statistics = this.buffer.getStatistics(null);
-        };
-        if(this.parameters.getDynClass().getDynField(REMOVE_ENDS_PARAM)!=null) {
-            removeEnds = (Boolean)this.parameters.getDynValue(REMOVE_ENDS_PARAM);
-        } else {
-            removeEnds = false;
-        };
-        if(this.parameters.getDynClass().getDynField(TAIL_TRIM_PARAM)!=null) {
-            tailTrim = (Boolean)this.parameters.getDynValue(TAIL_TRIM_PARAM);
-        } else {
-            tailTrim = false;
-        };
-        if(this.parameters.getDynClass().getDynField(TAIL_TRIM_PERCENT_PARAM)!=null) {
-            tailTrimPercent = (Double)this.parameters.getDynValue(TAIL_TRIM_PERCENT_PARAM);
-            tailTrimPercent = (tailTrimPercent>100)?100:tailTrimPercent;
-            tailTrimPercent = (tailTrimPercent<0)?0:tailTrimPercent;
-        } else {
-            tailTrimPercent = 0; // FIXME: ¿0 o 100?
-        };
+            statistics = this.getInputBuffer().getStatistics(null);
+        }
+        removeEnds = (boolean) this.getParameter(REMOVE_ENDS_PARAM, false);
+        tailTrim = (boolean) this.getParameter(TAIL_TRIM_PARAM, false);
+        tailTrimPercent = (double) this.getParameter(TAIL_TRIM_PERCENT_PARAM, 0);
+        tailTrimPercent = (tailTrimPercent>100)?100:tailTrimPercent;
+        tailTrimPercent = (tailTrimPercent<0)?0:tailTrimPercent;
 
-        int bands = this.buffer.getBandCount();
+        int bands = this.getInputBuffer().getBandCount();
         rowProcessors = new RowProcessor[bands];
         int [] bandTypes = new int[bands];
         //FIXME: Falta la gestión del parámetro copyUnprocessedBands, de momento se copian sin tenerlo en cuenta
         for (int i = 0; i < bandTypes.length; i++) {
-            if(bandsToProcess.contains(i)){
+            if(this.getBandsToProcess().contains(i)){
                 bandTypes[i] = BufferManager.TYPE_BYTE;
             } else {
-                bandTypes[i] = this.buffer.getBandTypes()[i];
+                bandTypes[i] = this.getInputBuffer().getBandTypes()[i];
             }
         }
-        NoData[] noData = this.buffer.getBandNoData();
+        NoData[] noData = this.getInputBuffer().getBandNoData();
         NoData[] resultNoData = new NoData[noData.length];
         for (int band = 0; band < noData.length; band++) {
-            int bandType = this.buffer.getBand(band).getDataType();
+            int bandType = this.getInputBuffer().getBand(band).getDataType();
             switch (bandType) {
             case BufferManager.TYPE_BYTE:
                 rowProcessors[band] = new ByteRowProcessor(band);
@@ -139,13 +125,13 @@
         }
 
         try {
-            this.outputBuffer = manager.createBuffer(
-                this.buffer.getRows(),
-                this.buffer.getColumns(),
+            this.setOutputBuffer( manager.createBuffer(
+                this.getInputBuffer().getRows(),
+                this.getInputBuffer().getColumns(),
                 bandTypes,
                 resultNoData,
-                this.buffer.getProjection(),
-                this.buffer.getEnvelope());
+                this.getInputBuffer().getProjection(),
+                this.getInputBuffer().getEnvelope()));
         } catch (LocatorException | BufferException | CreateEnvelopeException e) {
             throw new ProcessingOperationException(e);
         }
@@ -154,12 +140,12 @@
     @Override
     public void process() throws ProcessingOperationException {
         super.process();
-        for (int band=0; band<this.buffer.getBandCount(); band++){
-            if (bandsToProcess.contains(band)) {
-                Band bufferBand = this.buffer.getBand(band);
-                Band outputBufferBand = this.outputBuffer.getBand(band);
+        for (int band=0; band<this.getInputBuffer().getBandCount(); band++){
+            if (this.getBandsToProcess().contains(band)) {
+                Band bufferBand = this.getInputBuffer().getBand(band);
+                Band outputBufferBand = this.getOutputBuffer().getBand(band);
 
-                for (int row = 0; row < this.buffer.getRows(); row++) {
+                for (int row = 0; row < this.getInputBuffer().getRows(); row++) {
                     Object rowBuffer = bufferBand.createRowBuffer();
                     bufferBand.fetchRow(row, rowBuffer);
 
@@ -172,7 +158,7 @@
                 }
             } else {
                 try {
-                    this.outputBuffer.getBand(band).copyFrom(this.buffer.getBand(band));
+                    this.getOutputBuffer().getBand(band).copyFrom(this.getInputBuffer().getBand(band));
                 } catch (BandException e) {
                     throw new ProcessingOperationException(e);
                 }
@@ -185,7 +171,6 @@
         super.postProcess();
     }
 
-
     interface RowProcessor {
         void processRow(Object inputRow, Object outputRow);
         byte processValue(Object value);
@@ -201,7 +186,7 @@
 
         public AbstractRowProcessor(int band) {
             this.band = band;
-            noData = buffer.getBand(band).getNoData();
+            noData = getInputBuffer().getBand(band).getNoData();
             if(noData.isDefined()) {
                 minResult = (byte)1;
             }
@@ -244,7 +229,7 @@
                 return (byte)0;
             }
 
-            int iValue = 0xFF & ((Byte) value).byteValue();
+            int iValue = 0xFF & ((Byte) value);
             Double dValue = new Double(iValue);
 
             double result;
@@ -284,7 +269,7 @@
                 return (byte)0;
             }
 
-            int iValue = ((Short) value).shortValue();
+            int iValue = ((Short) value);
             Double dValue = ((Number) iValue).doubleValue();
 
             double result;
@@ -324,7 +309,7 @@
             }
 
             //FIXME ???:
-            int iValue = 0xFFFF & ((Short) value).shortValue();
+            int iValue = 0xFFFF & ((Short) value);
             Double dValue = ((Number) iValue).doubleValue();
 
             double result;
