Aladdin - Scala Bugtracking
[#1115] project: eclipse-plugin priority: low category: bug
submitter assigned to status date submitted
Nikolay Burak fixed 2007-05-20 15:23:45.0
subject [contrib #482] OOME when parsing expression inside XML
code
Got the following exception when trying to save a file containing this fragment of code:

object test {
  class Game {
    var players: List[Player] = _
    
    def toXml = <game><players>{players.map(_.toXml)}</players><game>
  }
  
  class Player {
    def toXml = <player/>
  }
}
what happened
java.lang.OutOfMemoryError: Java heap space
	at java.util.Arrays.copyOf(Unknown Source)
	at java.lang.AbstractStringBuilder.expandCapacity(Unknown Source)
	at java.lang.AbstractStringBuilder.append(Unknown Source)
	at java.lang.StringBuffer.append(Unknown Source)
	at scala.compat.StringBuilder.append(StringBuilder.scala:30)
	at scala.tools.nsc.ast.parser.MarkupParsers$MarkupParser.putChar(MarkupParsers.scala:49)
	at scala.tools.nsc.ast.parser.MarkupParsers$MarkupParser.xText(MarkupParsers.scala:463)
	at scala.tools.nsc.ast.parser.MarkupParsers$MarkupParser.content(MarkupParsers.scala:356)
	at scala.tools.nsc.ast.parser.MarkupParsers$MarkupParser.element(MarkupParsers.scala:381)
	at scala.tools.nsc.ast.parser.MarkupParsers$MarkupParser.content_LT(MarkupParsers.scala:334)
	at scala.tools.nsc.ast.parser.MarkupParsers$MarkupParser.xLiteral(MarkupParsers.scala:499)
	at scala.tools.nsc.ast.parser.Parsers$Parser.simpleExpr(Parsers.scala:1095)
	at scala.tools.nsc.ast.parser.Parsers$Parser.prefixExpr(Parsers.scala:1071)
	at scala.tools.nsc.ast.parser.Parsers$Parser.postfixExpr(Parsers.scala:1024)
	at scala.tools.nsc.ast.parser.Parsers$Parser.expr(Parsers.scala:960)
	at scala.tools.nsc.ast.parser.Parsers$Parser.expr(Parsers.scala:869)
	at scala.tools.nsc.ast.parser.Parsers$Parser.equalsExpr(Parsers.scala:825)
	at scala.tools.nsc.ast.parser.Parsers$Parser.funDefOrDcl(Parsers.scala:1954)
	at scala.tools.nsc.ast.parser.Parsers$Parser.defOrDcl(Parsers.scala:1850)
	at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$16.apply(Parsers.scala:2264)
	at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$16.apply(Parsers.scala:2264)
	at scala.tools.nsc.ast.parser.Parsers$Parser.joinComment(Parsers.scala:311)
	at scala.tools.nsc.ast.parser.Parsers$Parser.templateStatSeq(Parsers.scala:2264)
	at scala.tools.nsc.ast.parser.Parsers$Parser.templateBody(Parsers.scala:2163)
	at scala.tools.nsc.ast.parser.Parsers$Parser.templateBodyOpt(Parsers.scala:2171)
	at scala.tools.nsc.ast.parser.Parsers$Parser.templateOpt(Parsers.scala:2148)
	at scala.tools.nsc.ast.parser.Parsers$Parser.classDef(Parsers.scala:2062)
	at scala.tools.nsc.ast.parser.Parsers$Parser.tmplDef(Parsers.scala:2029)
	at scala.tools.nsc.ast.parser.Parsers$Parser.defOrDcl(Parsers.scala:1856)
	at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$16.apply(Parsers.scala:2264)
	at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$16.apply(Parsers.scala:2264)
	at scala.tools.nsc.ast.parser.Parsers$Parser.joinComment(Parsers.scala:311)
what expected should work
[back to overview]
Changes of this bug report
Nikolay  edited on  2007-05-20 15:32:28.0
Sean  edited on  2007-05-21 12:46:11.0
Have no idea why this was assigned to me.
Nikolay  edited on  2007-05-21 13:14:03.0
The original contribution was for the eclipse plugin. I changed this in the BTS but I left it for Burak. I hope he knows better what's happening
Nikolay  edited on  2007-05-21 14:33:55.0
Sean wrote: If its a matter of a fix not being propagated into the Plugin yet, that will happen in the next release. It doesn't need to be reported as a bug on the plugin... But neither 2.5.0-RC2 nor current checkout (r11109) scalac crash on that. Although they report error in XML literal. If the game tag is properly closed they compile it ok. Maybe the author deleted the / when he was substituting < with &lt;
Burak  edited on  2007-05-21 14:44:39.0
it's a matter of plug-in not being in sync, this is a dupe of the bug that got fixed last week.
Burak  edited on  2007-05-22 17:24:01.0
un-escaped the code
Burak  edited on  2007-05-22 17:24:23.0