playframework/playframework — pull request #3033 by gmethvin (2014-09-01 05:28:07+00:00)
Title: DB evolution: Application stops working if '# --- !Downs' part does not exists or empty

If ``# --- !Downs`` part in a database evolution file does not exists or is empty, application stops working with following stack trace:

```
Unexpected exception

NullPointerException: null
No source available, here is the exception stack trace:

->java.lang.NullPointerException:

play.api.db.evolutions.Evolution.(Evolutions.scala:36)

play.api.db.evolutions.Evolutions$$anonfun$databaseEvolutions$1.apply(Evolutions.scala:378)

play.api.db.evolutions.Evolutions$$anonfun$databaseEvolutions$1.apply(Evolutions.scala:374)

play.api.libs.Collections$.loop$1(Collections.scala:29)

play.api.libs.Collections$.unfoldLeft(Collections.scala:33)

play.api.db.evolutions.Evolutions$.databaseEvolutions(Evolutions.scala:374)

play.api.db.evolutions.Evolutions$$anonfun$evolutionScript$2.apply(Evolutions.scala:332)

play.api.db.evolutions.Evolutions$$anonfun$evolutionScript$2.apply(Evolutions.scala:330)

scala.Option.map(Option.scala:145)

play.api.db.evolutions.Evolutions$.evolutionScript(Evolutions.scala:330)

play.api.db.evolutions.EvolutionsPlugin.handleWebCommand(Evolutions.scala:583)

play.core.ReloadableApplication$$anonfun$handleWebCommand$1$$anonfun$apply$5$$anonfun$apply$6.apply(ApplicationProvider.scala:178)

play.core.ReloadableApplication$$anonfun$handleWebCommand$1$$anonfun$apply$5$$anonfun$apply$6.apply(ApplicationProvider.scala:177)

scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:110)

scala.collection.immutable.List.foldLeft(List.scala:83)

play.core.ReloadableApplication$$anonfun$handleWebCommand$1$$anonfun$apply$5.apply(ApplicationProvider.scala:177)

play.core.ReloadableApplication$$anonfun$handleWebCommand$1$$anonfun$apply$5.apply(ApplicationProvider.scala:176)

scala.Option.flatMap(Option.scala:170)

play.core.ReloadableApplication$$anonfun$handleWebCommand$1.apply(ApplicationProvider.scala:176)

play.core.ReloadableApplication$$anonfun$handleWebCommand$1.apply(ApplicationProvider.scala:176)

scala.Option.orElse(Option.scala:266)

play.core.ReloadableApplication.handleWebCommand(ApplicationProvider.scala:174)

play.core.server.Server$$anonfun$getHandlerFor$1.apply(Server.scala:82)

play.core.server.Server$$anonfun$getHandlerFor$1.apply(Server.scala:82)

scala.util.control.Exception$Catch$$anonfun$either$1.apply(Exception.scala:125)

scala.util.control.Exception$Catch$$anonfun$either$1.apply(Exception.scala:125)

scala.util.control.Exception$Catch.apply(Exception.scala:103)

scala.util.control.Exception$Catch.either(Exception.scala:125)

play.core.server.Server$class.getHandlerFor(Server.scala:82)

play.core.server.NettyServer.getHandlerFor(NettyServer.scala:37)

play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$10.apply(PlayDefaultUpstreamHandler.scala:157)

play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$10.apply(PlayDefaultUpstreamHandler.scala:157)

scala.util.Either.fold(Either.scala:99)

play.core.server.netty.PlayDefaultUpstreamHandler.messageReceived(PlayDefaultUpstreamHandler.scala:142)

org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)

org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)

org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)

com.typesafe.netty.http.pipelining.HttpPipeliningHandler.messageReceived(HttpPipeliningHandler.java:62)

org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:88)

org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)

org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)

org.jboss.netty.handler.codec.http.HttpContentDecoder.messageReceived(HttpContentDecoder.java:108)

org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)

org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)

org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)

org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)

org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:459)

org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:536)

org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:435)

org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)

org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)

org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)

org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)

org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)

org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)

org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)

org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)

org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)

org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)

org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)

org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)

java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

java.lang.Thread.run(Unknown Source)

```
an applicable command (uncommented) should exists in Downs part. I am using `select * from dual` command!

I am developing play with java and Oracle Database.