Index: HSLToRGBOperation.java
===================================================================
--- HSLToRGBOperation.java	(revision 43861)
+++ HSLToRGBOperation.java	(revision 43862)
@@ -56,7 +56,7 @@
      *
      */
     public HSLToRGBOperation(OperationFactory factory) {
-        this.factory = factory;
+        super(factory);
     }
 
     @Override
@@ -66,20 +66,20 @@
         RasterLegendManager legendManager = RasterLegendLocator.getRasterLegendManager();
 
         try {
-            if (!colorInterpretation.isHSL()) {
-                throw new UnsupportedOperationException("The color interpretation of input buffer isn't HSL");
+            if (!getInputColorInterpretation().isHSL()) {
+                throw new UnsupportedOperationException("The color interpretation of input getInputBuffer() isn't HSL");
             }
 
-            int[] inputBandTypes = buffer.getBandTypes();
-            if (inputBandTypes[colorInterpretation.getBand(ColorInterpretation.HUE_BAND)] != BufferManager.TYPE_BYTE
-                || inputBandTypes[colorInterpretation.getBand(ColorInterpretation.SATURATION_BAND)] != BufferManager.TYPE_BYTE
-                || inputBandTypes[colorInterpretation.getBand(ColorInterpretation.LIGHTNESS_BAND)] != BufferManager.TYPE_BYTE) {
+            int[] inputBandTypes = getInputBuffer().getBandTypes();
+            if (inputBandTypes[getInputColorInterpretation().getBand(ColorInterpretation.HUE_BAND)] != BufferManager.TYPE_BYTE
+                || inputBandTypes[getInputColorInterpretation().getBand(ColorInterpretation.SATURATION_BAND)] != BufferManager.TYPE_BYTE
+                || inputBandTypes[getInputColorInterpretation().getBand(ColorInterpretation.LIGHTNESS_BAND)] != BufferManager.TYPE_BYTE) {
                 throw new UnsupportedOperationException("The type of bands isn't BYTE");
             }
 
-            int sourceBands = this.buffer.getBandCount();
-            NoData[] sourceNoDatas = this.buffer.getBandNoData();
-            int[] sourceTypes = this.buffer.getBandTypes();
+            int sourceBands = this.getInputBuffer().getBandCount();
+            NoData[] sourceNoDatas = this.getInputBuffer().getBandNoData();
+            int[] sourceTypes = this.getInputBuffer().getBandTypes();
 
             List<String> colorInterpretations = new ArrayList<String>();
             List<NoData> noDatas = new ArrayList<NoData>();
@@ -97,8 +97,8 @@
             noDatas.add(null);
             noDatas.add(null);
 
-            if (colorInterpretation.hasAlphaBand()) {
-                int alphaBand = colorInterpretation.getAlphaBand();
+            if (getInputColorInterpretation().hasAlphaBand()) {
+                int alphaBand = getInputColorInterpretation().getAlphaBand();
                 if(sourceTypes[alphaBand]!=BufferManager.TYPE_BYTE){
                     throw new UnsupportedOperationException("The type of ALPHA band isn't BYTE");
                 }
@@ -107,30 +107,28 @@
                 noDatas.add(sourceNoDatas[alphaBand]);
             }
 
-            if (copyUnprocessedBands) {
+            if (mustCopyUnprocessedBands()) {
                 for (int band = 0; band < sourceBands; band++) {
-                    if (!isProcessableBand(band) && !colorInterpretation.isAlphaInterpretation(band)) {
-                        colorInterpretations.add(colorInterpretation.get(band));
+                    if (!isProcessableBand(band) && !getInputColorInterpretation().isAlphaInterpretation(band)) {
+                        colorInterpretations.add(getInputColorInterpretation().get(band));
                         noDatas.add(sourceNoDatas[band]);
-                        types.add(this.buffer.getBandTypes()[band]);
+                        types.add(this.getInputBuffer().getBandTypes()[band]);
                     }
                 }
             }
 
-            outputColorInterpretation =
-                legendManager.createColorInterpretation(colorInterpretations.toArray(new String[0]));
-            this.parameters.setDynValue(OUTPUT_COLOR_INTERPRETATION_PARAM, outputColorInterpretation);
-            int[] typesInt = new int[types.size()];
-            for (Iterator<Integer> iterator = types.iterator(); iterator.hasNext();) {
-                int i = 0;
-                Integer type = (Integer) iterator.next();
-                typesInt[i] = type.intValue();
-            }
-
-            this.outputBuffer =
-                manager.createBuffer(this.buffer.getRows(), this.buffer.getColumns(), typesInt,
-                    noDatas.toArray(new NoData[0]), this.buffer.getProjection(), this.buffer.getEnvelope());
-        } catch (LocatorException | BufferException | CreateEnvelopeException e) {
+            setOutputColorInterpretation(
+                legendManager.createColorInterpretation(colorInterpretations));
+            this.setParameter(OUTPUT_COLOR_INTERPRETATION_PARAM, getOutputColorInterpretation());
+            this.setOutputBuffer(
+                manager.createBuffer(
+                        this.getInputBuffer().getRows(), 
+                        this.getInputBuffer().getColumns(), 
+                        this.getTypesAsArray(types),
+                        this.getNoDatasAsArray(noDatas), 
+                        this.getInputBuffer().getProjection(), 
+                        this.getInputBuffer().getEnvelope()));
+        } catch (Exception e) {
             throw new ProcessingOperationException(e);
         }
     }
@@ -142,15 +140,15 @@
 
             // List<Integer> bandsToProcess = new ArrayList<Integer>();
 
-            if (copyUnprocessedBands) {
-                int bands = this.buffer.getBandCount();
-                int outBand = colorInterpretation.hasAlphaBand() ? 4 : 3;
+            if (mustCopyUnprocessedBands()) {
+                int bands = this.getInputBuffer().getBandCount();
+                int outBand = getInputColorInterpretation().hasAlphaBand() ? 4 : 3;
                 for (int band = 0; band < bands; band++) {
-                    if (colorInterpretation.isAlphaInterpretation(band)) {
-                        outputBuffer.getBand(outputColorInterpretation.getAlphaBand()).copyFrom(
-                            this.buffer.getBand(band));
+                    if (getInputColorInterpretation().isAlphaInterpretation(band)) {
+                        getOutputBuffer().getBand(getOutputColorInterpretation().getAlphaBand()).copyFrom(
+                            this.getInputBuffer().getBand(band));
                     } else if (!isProcessableBand(band)) {
-                        outputBuffer.getBand(outBand).copyFrom(this.buffer.getBand(band));
+                        getOutputBuffer().getBand(outBand).copyFrom(this.getInputBuffer().getBand(band));
                         outBand++;
                     }
                 }
@@ -158,20 +156,20 @@
 
             Object[] rowBandsBuffer = new Object[3];
 
-            for (int row = 0; row < this.buffer.getRows(); row++) {
-                Band bufferBandHue = buffer.getBand(colorInterpretation.getBand(ColorInterpretation.HUE_BAND));
+            for (int row = 0; row < this.getInputBuffer().getRows(); row++) {
+                Band bufferBandHue = getInputBuffer().getBand(getInputColorInterpretation().getBand(ColorInterpretation.HUE_BAND));
                 rowBandsBuffer[0] = bufferBandHue.createRowBuffer();
                 bufferBandHue.fetchRow(row, rowBandsBuffer[0]);
-                Band bufferBandSaturation = buffer.getBand(colorInterpretation.getBand(ColorInterpretation.SATURATION_BAND));
+                Band bufferBandSaturation = getInputBuffer().getBand(getInputColorInterpretation().getBand(ColorInterpretation.SATURATION_BAND));
                 rowBandsBuffer[1] = bufferBandSaturation.createRowBuffer();
                 bufferBandSaturation.fetchRow(row, rowBandsBuffer[1]);
-                Band bufferBandLightness = buffer.getBand(colorInterpretation.getBand(ColorInterpretation.LIGHTNESS_BAND));
+                Band bufferBandLightness = getInputBuffer().getBand(getInputColorInterpretation().getBand(ColorInterpretation.LIGHTNESS_BAND));
                 rowBandsBuffer[2] = bufferBandLightness.createRowBuffer();
                 bufferBandLightness.fetchRow(row, rowBandsBuffer[2]);
 
                 List<Object> outputRowBuffers = new ArrayList<Object>();
                 for (int band = 0; band < 3; band++) {
-                    Band outputBufferBand = outputBuffer.getBand(band);
+                    Band outputBufferBand = getOutputBuffer().getBand(band);
                     Object outputRowBuffer = outputBufferBand.createRowBuffer();
                     outputRowBuffers.add(outputRowBuffer);
                 }
@@ -179,7 +177,7 @@
                 processRow(rowBandsBuffer, outputRowBuffers);
 
                 for (int band = 0; band < 3; band++) {
-                    Band outputBufferBand = outputBuffer.getBand(band);
+                    Band outputBufferBand = getOutputBuffer().getBand(band);
                     outputBufferBand.putRow(row, outputRowBuffers.get(band));
                 }
 
@@ -216,12 +214,13 @@
      * @param band
      * @return
      */
-    private boolean isProcessableBand(int band) {
-        return isHSLBand(band) && this.buffer.getBandTypes()[band] == BufferManager.TYPE_BYTE;
+    @Override
+    protected boolean isProcessableBand(int band) {
+        return isHSLBand(band) && this.getInputBuffer().getBandTypes()[band] == BufferManager.TYPE_BYTE;
     }
 
     private boolean isHSLBand(int band) {
-        String bandColorInterpretation = colorInterpretation.get(band);
+        String bandColorInterpretation = getInputColorInterpretation().get(band);
         return (bandColorInterpretation.equals(ColorInterpretation.HUE_BAND)
             || bandColorInterpretation.equals(ColorInterpretation.SATURATION_BAND)
             || bandColorInterpretation.equals(ColorInterpretation.LIGHTNESS_BAND));
