MultiplyCoverages process only works when jai-ext enabled

Description

This method:
org.geotools.process.raster.MultiplyCoveragesProcess#execute

Sets the coverages to be multiplied like this:
param.parameter("Sources").setValue(sources);

This works for JAI-EXT, but when using the older jai, it expects its parameters to be named 'source0' and 'source1'.
So adding these lines should fix it:

Currently a rather ugly NullPointerException is thrown when using JAI:

2017-05-16 07:08:00,629 ERROR [org.geoserver.wps.executor] - Process execution failed
org.geotools.process.ProcessException: java.lang.NullPointerException
at org.geotools.process.factory.AnnotationDrivenProcessFactory$InvokeMethodProcess.execute(AnnotationDrivenProcessFactory.java:565)
at org.geoserver.wps.executor.ProcessStartupFilter$ProcessStartupWrapper.execute(ProcessStartupFilter.java:51)
at org.geoserver.wps.executor.DefaultProcessManager$ProcessCallable.call(DefaultProcessManager.java:201)
at org.geoserver.wps.executor.DefaultProcessManager$ProcessCallable.call(DefaultProcessManager.java:169)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at org.geotools.coverage.processing.OperationJAI.resampleToCommonGeometry(OperationJAI.java:427)
at org.geotools.coverage.processing.OperationJAI.doOperation(OperationJAI.java:294)
at org.geotools.coverage.processing.CoverageProcessor.doOperation(CoverageProcessor.java:605)
at org.geotools.coverage.processing.CoverageProcessor.doOperation(CoverageProcessor.java:627)
at org.geotools.process.raster.MultiplyCoveragesProcess.execute(MultiplyCoveragesProcess.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.geotools.process.factory.AnnotationDrivenProcessFactory$InvokeMethodProcess.execute(AnnotationDrivenProcessFactory.java:549)
... 7 more

Environment

None

Assignee

Unassigned

Reporter

Jeroen Dries

Triage

None

Components

Fix versions

Affects versions

Priority

High
Configure